/*
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 e}from"../../../geometry/support/aaBoundingRect.js";import{BitmapTile as i}from"./BitmapTile.js";import t from"./webgl/TileContainer.js";import{BitmapTechnique as n}from"./webgl/shaderGraph/techniques/bitmap/BitmapTechnique.js";class r extends t{constructor(){super(...arguments),this._bitmapTechnique=null}get requiresDedicatedFBO(){return this.children.some(e=>"additive"===e.bitmap.blendFunction)}createTile(t){const n=this.tileInfoView.getTileBounds(e(),t),r=this.tileInfoView.getTileResolution(t.level),[s,h]=this.tileInfoView.tileInfo.size;return new i(t,r,n[0],n[3],s,h)}onAttach(){super.onAttach(),this._bitmapTechnique=new n}onDetach(){super.onDetach(),this._bitmapTechnique?.shutdown(),this._bitmapTechnique=null}renderChildren(e){if(super.renderChildren(e),!this.visible||1!==e.drawPhase||null==this._bitmapTechnique)return;const i=this.children.map(e=>e.bitmap);this._bitmapTechnique.render(e,{bitmaps:i})}}export{r as BitmapTileContainer};
