// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.11/esri/copyright.txt for details.
//>>built
define("require exports ../../../../core/tsSupport/extendsHelper ../../ViewState ../../engine/Bitmap ../../engine/DisplayObject ../../engine/webgl/enums".split(" "),function(c,f,g,m,n,p,k){Object.defineProperty(f,"__esModule",{value:!0});var q=[0,0],r=[0,0];c=function(c){function d(a){var b=c.call(this)||this;b.layerView=a;b._childrenRenderParameters={context:document.createElement("canvas").getContext("2d"),pixelRatio:1,state:new m,stationary:!0,drawPhase:k.WGLDrawPhase.MAP,globalOpacity:1};b.requestRender=
b.requestRender.bind(b);return b}g(d,c);d.prototype.attach=function(){this._bitmap=new n.Bitmap;this._bitmap.stage=this.stage;this._bitmap.attach();this._bitmap.attached=!0;return c.prototype.attach.call(this)};d.prototype.detach=function(){this._bitmap.detach();this._bitmap=null};d.prototype.doRender=function(a){var b;if(a.drawPhase===k.WGLDrawPhase.MAP&&this.layerView.attached){var c=window.devicePixelRatio,d=this.stage.painter,f=a.globalOpacity;b=a.state;var l=a.state.size,g=l[1],h=this._childrenRenderParameters.context.canvas,
e=this._childrenRenderParameters;h.width=l[0]*c;h.height=g*c;e.globalOpacity=f;e.state.copy(b);e.state.pixelRatio=c;e.stationary=a.stationary;a=this._bitmap;a.resolution=b.resolution;this.layerView.render(e);a.source=h;b=e.state.toMap(r,q);a.x=b[0];a.y=b[1];e.state.viewpoint.rotation=0;e.state.rotation=0;d.startStencilDraw();d.drawBitmap(e,a,1);d.endStencilDraw()}};return d}(p.DisplayObject);f.Display=c;f.default=c});