/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{create as t}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import e from"../webgl/brushes/WGLBrush.js";class a extends e{constructor(){super(...arguments),this._visualState={time:0,dvsMat3:t(),displayViewMat3:t()}}dispose(){}prepareState(t){const{context:e}=t;e.setColorMask(!0,!0,!0,!0),e.setStencilFunction(514,0,255)}draw(t,e){const{requestRender:a,allowDelayedRender:s}=t,{displayData:r}=e;if(null==r)return;if("loaded"===r.state.name&&r.attach({context:t.context,getProgram:(e,a)=>t.painter.materialManager.getProgram(e,a)}),"attached"!==r.state.name)return;const i=r.state.resources;!s||i.ready||null==a?(this._visualState.time=t.animationsEnabled?t.time/1e3:0,this._visualState.dvsMat3=e.transforms.displayViewScreenMat3,this._visualState.displayViewMat3=t.state.displayViewMat3,r.flowStyle.render({context:t.context,getProgram:(e,a)=>t.painter.materialManager.getProgram(e,a)},this._visualState,i),r.flowStyle.animated&&null!=a&&t.animationsEnabled&&a()):a()}}export{a as default};
