Xui.Core.Canvas.Composition.GPU

Assembly: Xui.Core · C# declarations · Assembly overview

Types

class GpuNode

A retained GPU leaf, presented by its runtime-owned surface.

GPU nodes have no canvas command buffers, inherited canvas paint, or children. A platform can derive from this type to own its native presentation container.

public class GpuNode : Node
{
    public ICompositionGpuSurface? Surface { get; }

    protected override void DisposeCore();
}

void GpuNode.DisposeCore()

protected override void DisposeCore();

Overrides release their owned content, children and platform resources, then call base.

ICompositionGpuSurface? GpuNode.Surface

public ICompositionGpuSurface? Surface { get; }

The runtime-owned GPU surface, created on first declaration.

enum GpuSurfaceFailure

Why a context could not present a native GPU surface.

public enum GpuSurfaceFailure
{
    None,
    PortableFallbackRequired,
    NotSupported
}

GpuSurfaceFailure.None

None

The native GPU surface was accepted.

GpuSurfaceFailure.NotSupported

NotSupported

The runtime could not create a GPU device or native GPU surface.

GpuSurfaceFailure.PortableFallbackRequired

PortableFallbackRequired

This drawing context requires portable output, for example an SVG capture or a native context under an unsupported clip. An offscreen fallback may still work.

interface ICompositionGpuSurface

Runtime-owned presentation resource for a retained GPU node.

public interface ICompositionGpuSurface : IDisposable
{
    bool HasContent { get; }

    void RequestRender(IGpuSurfaceContent content);
}

bool ICompositionGpuSurface.HasContent

bool HasContent { get; }

Whether the surface already holds a successfully presented frame.

void ICompositionGpuSurface.RequestRender(IGpuSurfaceContent content)

void RequestRender(IGpuSurfaceContent content);

Schedules drawing after native layout; the runtime owns frame acquisition and presentation.

interface IGpuSurfaceContent

A stable reference used both as a GPU surface's key and as its renderer.

Implement on a class, typically the View that owns the scene. The window calls Render on its UI thread after placing the native surface. Do not retain or dispose the borrowed target; encode and commit GPU commands during this call. Bounds are supplied by GroupOptions; target dimensions are physical pixels. Canvas paint is not inherited.

public interface IGpuSurfaceContent
{
    void Render(IGpuRenderTarget target);
}

void IGpuSurfaceContent.Render(IGpuRenderTarget target)

void Render(IGpuRenderTarget target);

Draws and submits one frame into the borrowed presentation target.

interface IGpuSurfaceFactory

Runtime factory for native GPU composition surfaces owned by a window.

public interface IGpuSurfaceFactory
{
    bool IsSupported { get; }

    ICompositionGpuSurface CreateSurface();
}

ICompositionGpuSurface IGpuSurfaceFactory.CreateSurface()

ICompositionGpuSurface CreateSurface();

Creates a surface whose lifetime belongs to the retained composition tree.

Throws A native GPU surface cannot be created on this device.: A native GPU surface cannot be created on this device.

bool IGpuSurfaceFactory.IsSupported

bool IsSupported { get; }

Whether native GPU presentation is available.