Expand description
paint_list_api — the trait + common vocabulary every engine emits
into and NetRender renders from. See
genet/docs/2026-05-17_paintlist_polyglot_renderer.md (design,
PM-3 resolution) and genet/docs/2026-05-20_paintlist_extraction_plan.md
(the move into this neutral netrender-workspace crate).
§Shape
PaintListis the producer-facing trait engines implement. Concrete impls (GenetPaintList,NematicPaintList,ScryingPaintList, inker’s document list) live in their respective engine crates and carry richer internal state (palettes, spatial trees) behind the trait’sPaintList::commandsview.PaintCmdis the closed-set command stream the renderer pattern- matches against. Compositor primitives push/pop composition state;Draw*primitives emit one item each. PM-3: no generic extension hole — engine-specific items either map to common ops or hand off viaPaintCmd::DrawExternalTexture.primitivesholds the engine-facing display-list vocabulary (color, euclid geometry, border/line/blend enums). This crate owns that vocabulary; it does not depend on netrender. Thepaint_list_rendercrate translatesPaintCmd→netrender::Sceneand is the only place the two vocabularies meet.
§Lowering contract
The renderer owns PaintCmd → netrender::Scene translation. The
DrawExternalTexture lowering specifically is the per-frame
compositor pass (ExternalTextureComposite with scene_op_boundary),
not a vello SceneOp::Image. This sidesteps tile-cache
invalidation for mutating textures (WebGL canvas, embedded
iframes, paint worklet output, etc.) by construction.
Re-exports§
pub use items::*;pub use primitives::*;pub use specs::*;
Modules§
- items
- Paint-primitive payloads: the
*Itemtypes eachPaintCmd::Draw*variant carries, plus supporting types (PathData,BorderDetails, gradient payloads,GlyphInstance, etc.). - primitives
- Engine-facing primitive vocabulary for the PaintList layer.
- specs
- Compositor-primitive payloads: clip / transform / layer / shadow
specs and the filter-op enum carried on
LayerSpec.
Structs§
- Common
Placement - Bounds-and-flags aggregator every paint item carries. In the
PaintList model the clip and transform state come from compositor
primitives (
PushClip/PopClip,PushTransform/PopTransform), not from per-item references — so this is lighter than theGenetDisplayList::CommonItemPlacementit descends from. - Engine
Id - Identifies which engine produced a
PaintList. Used for diagnostics and for keying thePaintEnvelopediscriminant. - Font
Resource - A font referenced by one or more
DrawTextruns. Carried in the paint output’s font side-table (PaintList::fonts) rather than inline on eachTextRunItem, so a font shared across many runs ships its bytes once. The renderer interns eachFontResourceinto its font palette and mapskey→ its internal font id;TextRunItem::font_instancethen resolves through that map. - Image
Resource - A decoded image referenced by one or more
DrawImage/DrawRepeatingImageitems. LikeFontResource, the pixels travel in the paint output’s image side-table (PaintList::images) rather than inline on each item, so an image used by several items ships its bytes once. The renderer interns eachImageResourceinto its atlas and mapskey→ its internal image id;ImageItem::image_keythen resolves through that map. - Paint
Envelope - Wire shape for transporting a
PaintListacross IPC, fixture files, or any boundary where the producer’s concretePaintListimpl can’t be carried by name. PM-3 doc proposedenum { Genet(GenetPaintList), Nematic(...), Scrying(...) }; implementation went with a flat struct +EngineIddiscriminant because none of the concrete impls carry engine-specific extra fields beyond what the trait already exposes, and the enum shape would forcepaint-apito depend on every engine crate. - Primitive
Flags - Per-item presentation flags. Carried inline on every
CommonPlacementaggregator.
Enums§
- Paint
Cmd - One paint operation. Push-order is paint-order. The renderer pattern-
matches on this to lower into its internal
Scene.
Traits§
- Paint
List - What an engine emits — the unit of paint output for one rendered frame. Fully serializable so the same value can cross IPC, sit in a fixture file for capture/replay, or feed the renderer’s lowering.