()
| 535 | } |
| 536 | |
| 537 | _updateSize() { |
| 538 | if (!this.device || !this.depthFormat) return; |
| 539 | if (this.depthTexture && this.depthTexture.destroy) { |
| 540 | this.flushDraw(); |
| 541 | const textureToDestroy = this.depthTexture; |
| 542 | this._postSubmitCallbacks.push(() => textureToDestroy.destroy()); |
| 543 | this.depthTextureView = null; |
| 544 | } |
| 545 | this.depthTexture = this.device.createTexture({ |
| 546 | size: { |
| 547 | width: Math.ceil(this.width * this._pixelDensity), |
| 548 | height: Math.ceil(this.height * this._pixelDensity), |
| 549 | depthOrArrayLayers: 1, |
| 550 | }, |
| 551 | format: this.depthFormat, |
| 552 | usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.COPY_SRC, |
| 553 | }); |
| 554 | this.depthTextureView = this.depthTexture.createView(); |
| 555 | |
| 556 | // Clear the main canvas after resize |
| 557 | this.clear(); |
| 558 | } |
| 559 | |
| 560 | _getCanvasColorTextureView() { |
| 561 | const canvasTexture = this.drawingContext.getCurrentTexture(); |
no test coverage detected