Skip to main content

Module paint

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§

PageCanvas
Everything a draw needs besides the frame.
PageRenderer
Draws Frames. Keeps font resolution and decoded images between frames.
PaintEngine
Any engine, drawn as a display list. Commands and events pass through; the source’s own requests and answers are consumed here.
PaintSource
Host-side producer of frames and patches for one page.
PaintUpdate
A new frame, and the patch from the frame before it (None for the first).
SharedFrame
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§

BlobSource
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.