text: // All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  // See https://js.arcgis.com/4.10/esri/copyright.txt for details.
  //>>built
  define("require exports ../../../../../core/tsSupport/extendsHelper ../../../../../core/libs/gl-matrix-2/gl-matrix ../enums ../Utils ./WGLGeometryBrush ../shaders/MaterialPrograms ../../../../webgl/VertexArrayObject".split(" "),function(k,r,u,v,t,l,w,x,y){Object.defineProperty(r,"__esModule",{value:!0});k=function(h){function e(){var b=null!==h&&h.apply(this,arguments)||this;b._vertexAttributeLayout={geometry:[{name:"a_pos",count:2,type:5122,offset:0,stride:24,normalized:!1,divisor:0},{name:"a_color",
  count:4,type:5121,offset:4,stride:24,normalized:!0,divisor:0},{name:"a_vertexOffset",count:2,type:5122,offset:8,stride:24,normalized:!1,divisor:0},{name:"a_texAndSize",count:4,type:5121,offset:12,stride:24,normalized:!1,divisor:0},{name:"a_refSymbolAndPlacementOffset",count:4,type:5121,offset:16,stride:24,normalized:!1,divisor:0},{name:"a_vvSize",count:1,type:5126,offset:20,stride:24,normalized:!1,divisor:0}],visibility:[{name:"a_visible",count:1,type:5121,offset:0,stride:1,normalized:!0,divisor:0}],
  visibilityRange:[{name:"a_visibilityRange",count:2,type:5121,offset:0,stride:2,normalized:!1,divisor:0}]};b._glyphsTextureSize=v.vec2f32.create();return b}u(e,h);e.prototype.dispose=function(){};e.prototype.drawGeometry=function(b,c,m,d){d=b.context;var f=b.painter,a=b.drawPhase,e=b.state,n=b.rendererInfo,g=m.materialInfo,l=m.indexCount;m=m.indexFrom;var p=g.materialKeyInfo,h=p.isMapAligned()?1:0;if(b.requiredLevel===c.key.level||h){var k=b.drawPhase===t.WGLDrawPhase.LABEL_ALPHA,q=g.materialKey;k&&
  (q|=8);if(a=f.materialManager.getProgram(q,a))d.setStencilTestEnabled(!1),d.bindProgram(a),q=this._getVAO(d,c),d.bindVAO(q),k?(d.setBlendingEnabled(!1),a.setUniform1f("u_fadeStep",c.fader.value)):(g=g.texBindingInfo[0],f.textureManager.bindGlyphsPage(d,g.pageId,g.unit),a.setUniform1i(g.semantic,g.unit)),f=f.textureManager.glyphs,this._glyphsTextureSize[0]=f.width/4,this._glyphsTextureSize[1]=f.height/4,f=1===h?e.displayViewMat3:e.displayMat3,p.vvSizeMinMaxValue&&a.setUniform4fv("u_vvSizeMinMaxValue",
  n.vvSizeMinMaxValue),p.vvSizeScaleStops&&a.setUniform1f("u_vvSizeScaleStopsValue",n.vvSizeScaleStopsValue),p.vvSizeFieldStops&&(a.setUniform1fv("u_vvSizeFieldStopsValues",n.vvSizeFieldStopsValues),a.setUniform1fv("u_vvSizeFieldStopsSizes",n.vvSizeFieldStopsSizes)),p.vvSizeUnitValue&&a.setUniform1f("u_vvSizeUnitValueWorldToPixelsRatio",n.vvSizeUnitValueToPixelsRatio),d.bindTexture(b.labelFBO.colorTexture,3),a.setUniform1i("u_referenceTex",3),a.setUniform1f("u_mapRotation",Math.floor(e.rotation/360*
  254)),a.setUniform1f("u_mapAligned",h),a.setUniformMatrix3fv("u_displayMat3",f),a.setUniformMatrix3fv("u_dvsMat3",c.dvsMat3),a.setUniform2fv("u_mosaicSize",this._glyphsTextureSize),a.setUniform1f("u_pixelRatio",b.pixelRatio),a.setUniform1f("u_opacity",1),a.setUniform1f("u_zoomLevel",Math.round(10*b.displayLevel)),a.setUniform2fv("u_screenSize",b.state.size),d.drawElements(4,l,5125,4*m),d.bindVAO(null),d.setStencilTestEnabled(!0),d.setBlendingEnabled(!0)}};e.prototype.getGeometryType=function(){return t.WGLGeometryType.LABEL};
  e.prototype._getVAO=function(b,c){if((c=c.labelGeometry)&&c.vao)return c.vao;var e=c.vertexBufferMap[l.C_VBO_GEOMETRY],d=c.vertexBufferMap[l.C_VBO_VISIBILITY_RANGE],f=c.indexBuffer;if(!e||!f||!d)return null;c.vao=new y(b,x.label.attributes,this._vertexAttributeLayout,{geometry:e,visibility:c.vertexBufferMap[l.C_VBO_VISIBILITY],visibilityRange:d},f);return c.vao};return e}(w.default);r.default=k});