/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import e from"./webgl/WGLContainer.js";import{BitmapTechnique as i}from"./webgl/shaderGraph/techniques/bitmap/BitmapTechnique.js";class s extends e{constructor(){super(...arguments),this._hasCrossfade=!1,this._bitmapTechnique=null}get requiresDedicatedFBO(){return super.requiresDedicatedFBO||this._hasCrossfade}beforeRender(e){super.beforeRender(e),this._manageFade()}onAttach(){super.onAttach(),this._bitmapTechnique=new i}onDetach(){super.onDetach(),this._bitmapTechnique?.shutdown(),this._bitmapTechnique=null}renderChildren(e){super.renderChildren(e),this.visible&&1===e.drawPhase&&null!=this._bitmapTechnique&&this._bitmapTechnique.render(e,{bitmaps:this.children})}_manageFade(){this.children.reduce((e,i)=>e+(i.inFadeTransition?1:0),0)>=2?(this.children.forEach(e=>e.blendFunction="additive"),this._hasCrossfade=!0):(this.children.forEach(e=>e.blendFunction="standard"),this._hasCrossfade=!1)}}export{s as BitmapContainer};
