Skip to main content

render_app

Function render_app 

Source
pub fn render_app<A: App>(
    app: &mut A,
    events: &[SyntheticEvent],
    size: (u32, u32),
    theme: &Theme,
) -> RgbaImage
where A::Msg: Send,
Expand description

Drives an app headlessly: dispatches each event against the current view, applies the emitted messages, then renders one settle frame. Deterministic: scale 1.0, reduced motion, embedded fonts only. The requested size is clamped to the device-supported range (at least 1x1, at most the maximum texture dimension).

App::init runs first with a collecting Proxy; proxied messages are applied at deterministic points (before each event and before the settle frame). Messages sent from spawned threads race those drain points — keep proxy use synchronous in tests.

§Panics

If no compute-capable GPU adapter exists or rendering fails.