/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../../webgl/enums","../../../../../webgl/Texture"],(function(e,t,r){"use strict";let i=function(){function e(){this._size=[0,0]}var i=e.prototype;return i.dispose=function(){this._layerFBOTexture&&(this._layerFBOTexture.dispose(),this._layerFBOTexture=null)},i.draw=function(e,r,i){const{width:s,height:n}=r;this._createOrResizeResources(e,s,n);const{context:a,painter:l}=e,{amount:o}=i,u=a.gl,T=this._layerFBOTexture;a.bindFramebuffer(r),r.copyToTexture(0,0,s,n,0,0,T),a.setBlendingEnabled(!0),a.setStencilTestEnabled(!1),a.setDepthTestEnabled(!1),a.setClearColor(0,0,0,0),a.clear(u.COLOR_BUFFER_BIT),l.blitTexture(a,T,t.TextureSamplingMode.NEAREST,o)},i._createOrResizeResources=function(e,i,s){const{context:n}=e;this._layerFBOTexture&&this._size[0]===i&&this._size[1]===s||(this._size[0]=i,this._size[1]=s,this._layerFBOTexture?this._layerFBOTexture.resize(i,s):this._layerFBOTexture=new r.Texture(n,{target:t.TextureType.TEXTURE_2D,pixelFormat:t.PixelFormat.RGBA,internalFormat:t.PixelFormat.RGBA,dataType:t.PixelType.UNSIGNED_BYTE,wrapMode:t.TextureWrapMode.CLAMP_TO_EDGE,samplingMode:t.TextureSamplingMode.NEAREST,flipped:!1,width:i,height:s}))},e}();e.Opacity=i,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
