Skip to main content

Crate telar_platform_headless

Crate telar_platform_headless 

Source
Expand description

A first-class headless platform_core::Platform backend and the one canonical offscreen window marker.

HeadlessWindow replaces the ad-hoc markers that used to be duplicated across the renderer crates (the HeadlessWindow in renderer-hardware and a per-test struct Fake; in each renderer-software test). One type now satisfies both the renderer bound (raw-window-handle) and the platform bound (platform_core::Window).

HeadlessPlatform drives a real app through the same platform_core::EventHandler seam as the winit backend, without a window system — a deterministic proving ground for the bring-your-own-Platform seam and an integration-test harness that can assert on read-back pixels.

Structs§

HeadlessPlatform
A first-class, windowless Platform backend: it drives the exact same EventHandler seam as the winit backend (on_resumeon_redraws → on_suspend) against a HeadlessWindow, with no event loop, GPU swapchain, or display server. Because the handler builds an offscreen renderer for a headless window, this routes a real app end-to-end (reactive → layout → render → pixels) and is both the reference Platform impl and a deterministic integration-test harness.
HeadlessWindow
The one canonical offscreen window marker. It implements platform_core::Window, so a single type satisfies both the renderer bound (which needs only the raw-window-handle traits) and the platform bound (Window). Its handles are always HandleError::Unavailable — there is no surface — so a renderer built against it must use its new_headless constructor, and AppHandler detects the unavailable handle to build an offscreen renderer. request_redraw is a no-op: crate::HeadlessPlatform drives frames explicitly rather than through a windowing system’s redraw queue.

Type Aliases§

FrameSink
A shared slot the platform writes the final frame’s pixels into. Platform::run yields no value, so a caller that wants the rendered pixels passes one of these via HeadlessPlatform::capture_into and reads it after run returns.
SurfaceFrameSink
The multi-surface analogue of FrameSink: each surface’s final frame keyed by its SurfaceId. Passed via HeadlessPlatform::capture_surfaces_into and read after MultiSurfacePlatform::run_surfaces returns.