Expand description
One frame of one surface, as it sits in the ring.
header u32 magic "TRF1", u16 version, u16 flags, u32 record length,
u32 surface, u64 sequence, u32 width, u32 height,
4 × f32 base colour (premultiplied-free sRGB, alpha last)
sections u16 kind, u16 section flags, u32 length, payload, zero padding to 4A section whose kind the reader does not know is skipped when its sender
set SECTION_OPTIONAL, and refuses the frame otherwise: a later step can
add scene annotations as optional sections that older services ignore,
and service-run motion as required ones that only a service which
announced them in its hello receives.
Sections of version 1:
SECTION_DAMAGE: rectangles of the surface that changed since the previous frame, in pixels. With the header’sFRAME_FULLthe whole surface did. With itsFRAME_DAMAGE_ONLYthe scene holds only what that damage needs, and is never drawn beyond it.SECTION_SCROLL_COPY: copies within the retained surface, in order, before the damage is repainted (what a scroll keeps).SECTION_LAYER: a layer’s new content, transform, opacity and clip; or that it keeps its content; or that it is gone. Layers not named keep everything.SECTION_ORDER: the order layers draw in, bottom first. Without it the previous order holds; new layers go on top.SECTION_BACKDROP: a floating surface’s blurred backdrop: the placeholder image the scene draws, where, how blurred, and the scene composed below it.
Structs§
- Backdrop
- A floating surface’s blurred backdrop.
- Backdrop
Stage - A material stage as a frame carries it.
- Checked
- A frame, read and validated, with what it costs to draw.
- Frame
- A frame record, decoded.
- Frame
Writer - Writes a frame record;
FrameWriter::finishfills in its length. - Layer
Update - Rect
- A rectangle in surface pixels,
x0 <= x1,y0 <= y1. - Scroll
Copy - A copy within the retained surface: the source rectangle and how far it moves, in pixels.
Enums§
- Layer
Change - What a frame does to one layer.
Constants§
- FRAME_
DAMAGE_ ONLY - The scene holds only what the frame’s damage needs (an app leaves out what the pixels it
presented last still show): a service that would have to draw more of it than that damage
refuses the frame (
crate::control::Refusal::DamageOnly) and the app sends it whole. - FRAME_
FULL - The whole surface changed: repaint all of it.
- MAX_
STAGE_ SOURCE - The most WGSL a stage may carry, bytes.
- SECTION_
BACKDROP - SECTION_
DAMAGE - SECTION_
LAYER - SECTION_
OPTIONAL - A reader that does not know this section’s kind skips it.
- SECTION_
ORDER - SECTION_
SCROLL_ COPY - STAGE_
FLOATS - How many numbers a stage’s uniforms hold.
Functions§
- read
- Read one frame record from
bytes(exactly one record) and validate every scene in it againstlimits. Every byte is read once.