Table of Contents

Struct WebGPUSurfaceHost

Namespace
SixLabors.ImageSharp.Drawing.Processing.Backends
Assembly
SixLabors.ImageSharp.Drawing.WebGPU.dll

Describes the externally-owned native drawable that a WebGPUExternalSurface should attach to. Use the factory method that matches the host toolkit or platform that owns the drawable surface.

public readonly struct WebGPUSurfaceHost
Inherited Members

Remarks

Construct via the platform-specific factory methods. The caller retains ownership of the underlying handles; the external surface never releases them.

Methods

Android(nint, nint)

Creates a host descriptor for an Android native window.

public static WebGPUSurfaceHost Android(nint aNativeWindow, nint eglSurface = 0)

Parameters

aNativeWindow nint

The Android native window pointer (ANativeWindow*).

eglSurface nint

The associated EGL surface (optional).

Returns

WebGPUSurfaceHost

An Android host descriptor.

Cocoa(nint)

Creates a host descriptor for a Cocoa window.

public static WebGPUSurfaceHost Cocoa(nint nsWindow)

Parameters

nsWindow nint

The Cocoa window pointer (NSWindow*).

Returns

WebGPUSurfaceHost

A Cocoa host descriptor.

EGL(nint, nint)

Creates a host descriptor for an EGL display and surface.

public static WebGPUSurfaceHost EGL(nint eglDisplay, nint eglSurface)

Parameters

eglDisplay nint

The EGL display handle (Zero if unspecified).

eglSurface nint

The EGL surface handle (Zero if unspecified).

Returns

WebGPUSurfaceHost

An EGL host descriptor.

Glfw(nint)

Creates a host descriptor for a GLFW-owned window.

public static WebGPUSurfaceHost Glfw(nint glfwWindow)

Parameters

glfwWindow nint

The GLFW window pointer (GLFWwindow*).

Returns

WebGPUSurfaceHost

A GLFW host descriptor.

Sdl(nint)

Creates a host descriptor for an SDL-owned window.

public static WebGPUSurfaceHost Sdl(nint sdlWindow)

Parameters

sdlWindow nint

The SDL window pointer (SDL_Window*).

Returns

WebGPUSurfaceHost

An SDL host descriptor.

UIKit(nint, uint, uint, uint)

Creates a host descriptor for a UIKit window with its framebuffer objects.

public static WebGPUSurfaceHost UIKit(nint uiWindow, uint framebuffer, uint colorbuffer, uint resolveFramebuffer)

Parameters

uiWindow nint

The UIKit window pointer (UIWindow*).

framebuffer uint

The framebuffer object id.

colorbuffer uint

The color buffer object id.

resolveFramebuffer uint

The resolve framebuffer object id.

Returns

WebGPUSurfaceHost

A UIKit host descriptor.

Vivante(nint, nint)

Creates a host descriptor for a Vivante-backed window.

public static WebGPUSurfaceHost Vivante(nint display, nint window)

Parameters

display nint

The Vivante EGL display type (EGLNativeDisplayType).

window nint

The Vivante EGL window type (EGLNativeWindowType).

Returns

WebGPUSurfaceHost

A Vivante host descriptor.

Wayland(nint, nint)

Creates a host descriptor for a Wayland surface.

public static WebGPUSurfaceHost Wayland(nint display, nint surface)

Parameters

display nint

The Wayland display pointer (wl_display*).

surface nint

The Wayland surface pointer (wl_surface*).

Returns

WebGPUSurfaceHost

A Wayland host descriptor.

Win32(nint, nint, nint)

Creates a host descriptor for a Win32 window. The device context handle is optional; when omitted, the surface layer derives one from the window as needed.

public static WebGPUSurfaceHost Win32(nint hwnd, nint hinstance, nint hdc = 0)

Parameters

hwnd nint

The Win32 window handle (HWND).

hinstance nint

The module instance handle (HINSTANCE) associated with the window.

hdc nint

The device context handle (HDC); pass Zero if unavailable.

Returns

WebGPUSurfaceHost

A Win32 host descriptor.

WinRT(nint)

Creates a host descriptor for a WinRT window.

public static WebGPUSurfaceHost WinRT(nint inspectable)

Parameters

inspectable nint

The WinRT window's IInspectable*.

Returns

WebGPUSurfaceHost

A WinRT host descriptor.

X11(nint, nuint)

Creates a host descriptor for an X11 window.

public static WebGPUSurfaceHost X11(nint display, nuint window)

Parameters

display nint

The X11 display pointer (Display*).

window nuint

The X11 window identifier.

Returns

WebGPUSurfaceHost

An X11 host descriptor.