Skip to main content

maybe_dump_first_frame

Function maybe_dump_first_frame 

Source
pub fn maybe_dump_first_frame(
    app: &AppHandle,
    diagnostics: &PreviewDiagnostics,
    bgra: &[u8],
    width: u32,
    height: u32,
)
Expand description

One-shot writer: on the very first frame of each session, dump the BGRA bytes to a PNG file under the app cache dir so the user can confirm visually that real pixels reached Rust. Returns the absolute path on success; logs + returns None on encode/write failure (we don’t want a diagnostic to crash the worker).

Subsequent calls within the same session no-op (the dump slot is claimed once via PreviewDiagnostics::try_claim_dump_slot).