/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{FeatureTechnique as e}from"../FeatureTechnique.js";import{isHittest as t,getSelectionDefines as s,getFeatureTextures as r,getFeatureUniforms as i,resolveDynamicUniforms as a,isHighlight as o,getFeaturePipelineState as n}from"../featureTechniqueUtils.js";import{getAntialiasingControls as p}from"./utils.js";import{GradientStrokeShader as u}from"../shaders/GradientStrokeShader.js";class c extends e{constructor(){super(...arguments),this.type=17,this.shaders={geometry:new u},this.symbologyPlane=1}_getShaderOptions(e,o,n){const{painter:u,pixelRatio:c}=e,h=o.instance.getInput();return{shader:this.shaders.geometry,uniforms:{...a(e,o.target,h.uniforms),...i(e,o.target),antialiasingControls:p(c),mosaicInfo:u.textureManager.getMosaicInfo(e,o.textureKey),technique:{isColorPass:n}},textures:{...r(e),mosaicTexture:u.textureManager.getMosaicTexture(e,o.textureKey)},defines:{...s(e)},optionalAttributes:h.optionalAttributes,useComputeBuffer:t(e)}}render(e,s){const{painter:r}=e;if(t(e)||o(e)){const t=n(e);return r.setPipelineState(t),r.setShader(this._getShaderOptions(e,s,1)),void r.submitDraw(e,s)}e.context.setClearDepth(1),e.context.clear(256);const i={color:!1,depth:{write:{zNear:0,zFar:1},test:513},stencil:{write:!1,test:{compare:514,mask:255,op:{fail:7680,zFail:7680,zPass:7680}}}};r.setShader(this._getShaderOptions(e,s,0)),r.setPipelineState(i),r.submitDraw(e,s);const a={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:{write:!1,test:515},stencil:{write:!1,test:{compare:514,mask:255,op:{fail:7680,zFail:7680,zPass:7680}}}};r.setShader(this._getShaderOptions(e,s,1)),r.setPipelineState(a),r.submitDraw(e,s)}}export{c as GradientStrokeTechnique};
