SkiaFrameRasterizer
- Namespace: Turian.Engine.UI
- Source File: SkiaFrameRasterizer.cs
Owns a CPU raster SKSurface and turns one Guinevere draw pass into a tightly-packed RGBA8 pixel block. This is the graphics-API-agnostic half of the UI render backend: it has no Vulkan dependency and is unit-testable on its own.
Remarks
The surface is Rgba8888 / Unpremul so the bytes map directly onto VK_FORMAT_R8G8B8A8_* and the compositor can blend with straight src-alpha / one-minus-src-alpha, matching every stock Guinevere backend. The canvas is cleared to fully transparent each frame because the UI is composited over an already-rendered scene rather than owning the whole framebuffer.
Properties
Width
(int) { get; set }: Target width in pixels.
Height
(int) { get; set }: Target height in pixels.
Public Methods
Resize
public void Resize(int width, int height)
Resizes the raster target. Does nothing when the size is unchanged.
Parameters:
width(int): New width in pixels, greater than zero.height(int): New height in pixels, greater than zero.
Render
public ReadOnlySpan<byte> Render(Action<SKCanvas> draw)
Clears the canvas to transparent, invokes draw against it, and returns the flushed frame as tightly-packed top-left-origin RGBA8 pixels (length WidthHeight4). The span is owned by this instance and overwritten by the next call.
Parameters:
draw(Action): Receives the surface canvas for one Guinevere render pass.
Returns: ReadOnlySpan<byte>
Dispose
public void Dispose()