/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{Bitmap as t}from"../../engine/Bitmap.js";import{BitmapContainer as e}from"../../engine/BitmapContainer.js";class i extends e{constructor(e){super(),this.requestRender=this.requestRender.bind(this),this._layerView=e,this._canvas=document.createElement("canvas"),this._context=this._canvas.getContext("2d"),this._bitmap=new t(this._canvas),this.addChild(this._bitmap)}doRender(t){t.painter.setPipelineState(null);const e=t.state,i=this._createCustomRenderParams(t),a=this._canvas,n=this._bitmap,s=window.devicePixelRatio;a.width=e.size[0]*s,a.height=e.size[1]*s,n.resolution=e.resolution;const o=e.clone();o.pixelRatio=s,n.pixelRatio=s,i.state=o,n.x=e.viewpoint.targetGeometry.x-Math.abs(e.extent.xmax-e.extent.xmin)/2,n.y=e.viewpoint.targetGeometry.y+Math.abs(e.extent.ymax-e.extent.ymin)/2,this._layerView.render(i),n.rotation=e.rotation,n.invalidateTexture(),super.doRender({...t,state:o})}_createCustomRenderParams(t){return{globalOpacity:t.globalOpacity,state:t.state,stationary:t.stationary,pixelRatio:window.devicePixelRatio,context:this._context}}}export{i as Display};
