Class WebGPUExternalSurface
- Namespace
- SixLabors.ImageSharp.Drawing.Processing.Backends
- Assembly
- SixLabors.ImageSharp.Drawing.WebGPU.dll
A WebGPU rendering surface bound to an externally-owned native host. Unlike WebGPUWindow, this type does not own a platform window; the host application owns the UI object, its lifecycle, and the drawable size notifications forwarded through Resize(Size).
public sealed class WebGPUExternalSurface : IDisposable
- Inheritance
-
WebGPUExternalSurface
- Implements
- Inherited Members
Constructors
WebGPUExternalSurface(Configuration, WebGPUSurfaceHost, Size, WebGPUExternalSurfaceOptions)
Initializes a new instance of the WebGPUExternalSurface class.
public WebGPUExternalSurface(Configuration configuration, WebGPUSurfaceHost host, Size framebufferSize, WebGPUExternalSurfaceOptions options)
Parameters
configurationConfigurationThe configuration instance to bind to the created backend.
hostWebGPUSurfaceHostThe native surface host that the WebGPU surface will attach to.
framebufferSizeSizeThe initial framebuffer size in pixels.
optionsWebGPUExternalSurfaceOptionsThe external surface options.
WebGPUExternalSurface(WebGPUSurfaceHost, Size)
Initializes a new instance of the WebGPUExternalSurface class.
public WebGPUExternalSurface(WebGPUSurfaceHost host, Size framebufferSize)
Parameters
hostWebGPUSurfaceHostThe native surface host that the WebGPU surface will attach to.
framebufferSizeSizeThe initial framebuffer size in pixels.
WebGPUExternalSurface(WebGPUSurfaceHost, Size, WebGPUExternalSurfaceOptions)
Initializes a new instance of the WebGPUExternalSurface class.
public WebGPUExternalSurface(WebGPUSurfaceHost host, Size framebufferSize, WebGPUExternalSurfaceOptions options)
Parameters
hostWebGPUSurfaceHostThe native surface host that the WebGPU surface will attach to.
framebufferSizeSizeThe initial framebuffer size in pixels.
optionsWebGPUExternalSurfaceOptionsThe external surface options.
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Resize(Size)
Notifies the external surface that the drawable framebuffer has resized and reconfigures the swapchain when the size changes.
public void Resize(Size framebufferSize)
Parameters
framebufferSizeSizeThe new framebuffer size in pixels.
TryAcquireFrame(out WebGPUSurfaceFrame?)
Tries to acquire the next drawable frame.
public bool TryAcquireFrame(out WebGPUSurfaceFrame? frame)
Parameters
frameWebGPUSurfaceFrameReceives the acquired frame on success.
Returns
TryAcquireFrame(DrawingOptions, out WebGPUSurfaceFrame?)
Tries to acquire the next drawable frame.
public bool TryAcquireFrame(DrawingOptions options, out WebGPUSurfaceFrame? frame)
Parameters
optionsDrawingOptionsThe drawing options for the acquired frame.
frameWebGPUSurfaceFrameReceives the acquired frame on success.