Interface GPUCanvasContext
interface GPUCanvasContext {
__brand: "GPUCanvasContext";
canvas: HTMLCanvasElement | OffscreenCanvas;
configure(configuration: GPUCanvasConfiguration): undefined;
getCurrentTexture(): GPUTexture;
unconfigure(): undefined;
}
__brand: "GPUCanvasContext";
canvas: HTMLCanvasElement | OffscreenCanvas;
configure(configuration: GPUCanvasConfiguration): undefined;
getCurrentTexture(): GPUTexture;
unconfigure(): undefined;
}
Index
Properties
Methods
Properties
Readonly
Internal
__brand
__brand: "GPUCanvasContext"
Readonly
canvas
The canvas this context was created from.
Methods
configure
- configure(configuration): undefined
Configures the context for this canvas. This clears the drawing buffer to transparent black (in [$Replace the drawing buffer$]).
Parameters
- configuration: GPUCanvasConfiguration
Desired configuration for the context.
Returns undefined
- configuration: GPUCanvasConfiguration
getCurrentTexture
- get
Current (): GPUTextureTexture Get the GPUTexture that will be composited to the document by the GPUCanvasContext next. Note: The same GPUTexture object will be returned by every call to GPUCanvasContext#getCurrentTexture until "[$Expire the current texture$]" runs, even if that GPUTexture is destroyed, failed validation, or failed to allocate.
Returns GPUTexture
Nominal type branding. https://github.com/microsoft/TypeScript/pull/33038