Module paint
Expand description
The paint stream: a page as a display list instead of pixels.
PaintSource runs where the engine runs. It asks the engine for its
layout whenever the page may have changed, converts it into a
Frame, resolves image URLs to content hashes
(reading the bytes from the engine’s own cache, never fetching again) and
emits the frame with the Patch from the previous one. PaintEngine
wraps any WebViewEngine with one, so a WebView draws the list.
PageRenderer draws a frame with this toolkit’s Vello and text stack —
the same code natively and in the WASM client, which receives the frames
and patches instead of pixels and never sees a cookie or a page URL behind
an image.
Modules§
- stream
- A web page as a layered display list.
Structs§
- Page
Canvas - Everything a draw needs besides the frame.
- Page
Renderer - Draws
Frames. Keeps font resolution and decoded images between frames. - Paint
Engine - Any engine, drawn as a display list. Commands and events pass through; the source’s own requests and answers are consumed here.
- Paint
Source - Host-side producer of frames and patches for one page.
- Paint
Update - A new frame, and the patch from the frame before it (
Nonefor the first). - Shared
Frame - One encoded frame of the page this app shares, for the session.
Constants§
- MAX_
SHARE_ PAYLOAD - Largest encoded payload the app → shell channel carries once base64 encoded (its frames are at most 1 MiB).
Traits§
- Blob
Source - Where a renderer gets a blob’s encoded bytes.
Functions§
- queue_
share - Queue one frame for the session. A consumer that fell this far behind starts over from a whole frame.
- set_
share_ watched - The session started (
true) or stopped (false) sharing the page. A start asks for a whole frame; a stop discards what was not sent. - share_
capable - Whether this app can stream a page, for it to tell the session.
- share_
watched - Whether the session shares this app’s page with someone watching.
- take_
share_ frames - The frames to send the session, oldest first.
- take_
share_ keyframe - Whether the next shared frame must be a whole one; asking clears it.