/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["../../../../chunks/_rollupPluginBabelHelpers","../../ViewState","../../engine/Container","../../engine/webgl/enums"],(function(e,t,r,i){"use strict";return function(r){function n(i){var n;return(n=r.call(this)||this).layerView=i,n._childrenRenderParameters={context:null,pixelRatio:1,state:new t,stationary:!0,painter:null},n._name=n.constructor.name,n.requestRender=n.requestRender.bind(e._assertThisInitialized(n)),n}e._inheritsLoose(n,r);var a=n.prototype;return a.doRender=function(e){if(e.drawPhase!==i.WGLDrawPhase.MAP)return;const t=window.devicePixelRatio,{stationary:r,context:n,painter:a,profiler:o}=e,s=this._childrenRenderParameters;s.context=n.gl,s.state.copy(e.state),s.state.pixelRatio=t,s.stationary=r,s.painter=a;const l=this.createRenderParams(e);a.beforeRenderLayer(l,this.clips?255:0,l.globalOpacity),o.recordContainerStart(this._name);const d=n.getBoundFramebufferObject(),c=n.getViewport();n.resetState(),n.bindFramebuffer(d),n.setViewport(c.x,c.y,c.width,c.height),this.layerView._renderTarget.framebuffer=d.glName,this.layerView._renderTarget.viewport[0]=c.x,this.layerView._renderTarget.viewport[1]=c.y,this.layerView._renderTarget.viewport[2]=c.width,this.layerView._renderTarget.viewport[3]=c.height,this.layerView.render(s),n.enforceState(),a.compositeLayer(l,l.globalOpacity),o.recordContainerEnd()},a.createRenderParams=function(e){return{...e,blendMode:this.blendMode,effects:this.computedEffects,globalOpacity:e.globalOpacity*this.opacity,inFadeTransition:this.inFadeTransition}},n}(r.Container)}));
