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§
- Headless
Platform - A first-class, windowless
Platformbackend: it drives the exact sameEventHandlerseam as the winit backend (on_resume→ scriptedon_events →on_redraws →on_suspend) against aHeadlessWindow, 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 (event → reactive → layout → render → pixels) and is both the referencePlatformimpl and a deterministic integration-test harness. - Headless
Window - 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 alwaysHandleError::Unavailable— there is no surface — so a renderer built against it must use itsnew_headlessconstructor, andAppHandlerdetects the unavailable handle to build an offscreen renderer.request_redrawis a no-op:crate::HeadlessPlatformdrives frames explicitly rather than through a windowing system’s redraw queue.
Type Aliases§
- Frame
Sink - A shared slot the platform writes the final frame’s pixels into.
Platform::runyields no value, so a caller that wants the rendered pixels passes one of these viaHeadlessPlatform::capture_intoand reads it afterrunreturns. - Surface
Frame Sink - The multi-surface analogue of
FrameSink: each surface’s final frame keyed by itsSurfaceId. Passed viaHeadlessPlatform::capture_surfaces_intoand read afterMultiSurfacePlatform::run_surfacesreturns.