Table of Contents

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

configuration Configuration

The configuration instance to bind to the created backend.

host WebGPUSurfaceHost

The native surface host that the WebGPU surface will attach to.

framebufferSize Size

The initial framebuffer size in pixels.

options WebGPUExternalSurfaceOptions

The external surface options.

WebGPUExternalSurface(WebGPUSurfaceHost, Size)

Initializes a new instance of the WebGPUExternalSurface class.

public WebGPUExternalSurface(WebGPUSurfaceHost host, Size framebufferSize)

Parameters

host WebGPUSurfaceHost

The native surface host that the WebGPU surface will attach to.

framebufferSize Size

The 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

host WebGPUSurfaceHost

The native surface host that the WebGPU surface will attach to.

framebufferSize Size

The initial framebuffer size in pixels.

options WebGPUExternalSurfaceOptions

The 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

framebufferSize Size

The new framebuffer size in pixels.

TryAcquireFrame(out WebGPUSurfaceFrame?)

Tries to acquire the next drawable frame.

public bool TryAcquireFrame(out WebGPUSurfaceFrame? frame)

Parameters

frame WebGPUSurfaceFrame

Receives the acquired frame on success.

Returns

bool

true when a frame is available; otherwise false.

TryAcquireFrame(DrawingOptions, out WebGPUSurfaceFrame?)

Tries to acquire the next drawable frame.

public bool TryAcquireFrame(DrawingOptions options, out WebGPUSurfaceFrame? frame)

Parameters

options DrawingOptions

The drawing options for the acquired frame.

frame WebGPUSurfaceFrame

Receives the acquired frame on success.

Returns

bool

true when a frame is available; otherwise false.