/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{spritePadding as t}from"../../../definitions.js";import{fillVertexSpec as e,FillMeshWriter as r}from"./FillMeshWriter.js";import{DataType as i}from"../../../../../../webgl/enums.js";const s={createComputedParams:t=>t,optionalAttributes:e.optionalAttributes,attributes:{...e.attributes,tlbr:{count:4,type:i.UNSIGNED_SHORT,pack:({sprite:e})=>{const{rect:r,width:i,height:s}=e,o=r.x+t,a=r.y+t;return[o,a,o+i,a+s]}},inverseRasterizationScale:{count:1,type:i.BYTE,packPrecisionFactor:16,pack:({sprite:t})=>1/t.rasterizationScale}}};class o extends r{constructor(){super(...arguments),this.vertexSpec=s}_write(t,e,r){const i=r?.asOptimized()??e.readGeometryForDisplay(),s=this._clip(i);if(!s)return;const o=this.evaluatedMeshParams.sprite?.textureBinding;t.recordStart(this.instanceId,this.attributeLayout,o),this._writeGeometry(t,e,s),t.recordEnd()}}export{o as PatternFillMeshWriter,s as patternFillVertexSpec};
