pub enum Op {
Save,
SaveLayer {
paint: Paint,
mask_composite: Option<MaskKind>,
scope_bounds: Rect,
base_slot: u32,
composite_slot: u32,
can_elide: bool,
backdrop_sigma: Option<f32>,
backdrop_key: Option<u64>,
},
Restore,
Transform(Matrix),
DrawRect {
rect: Rect,
paint: Paint,
bounds: Rect,
slot: u32,
},
DrawPath {
path: Arc<Path>,
fill_rule: FillRule,
paint: Paint,
bounds: Rect,
slot: u32,
},
RRectBlur {
rect: Rect,
radii: [f32; 4],
paint: Paint,
bounds: Rect,
slot: u32,
},
ClipPath {
path: Arc<Path>,
fill_rule: FillRule,
op: ClipOp,
expiry_slot: u32,
},
DrawImage {
image: Image,
src: Rect,
dst: Rect,
sampling: Sampling,
paint: Paint,
bounds: Rect,
slot: u32,
},
GlyphRun {
font: Arc<Font>,
size: f32,
paint: Paint,
glyphs: Arc<Vec<GlyphPos>>,
bounds: Rect,
slot: u32,
},
DrawDisplayList {
list: Arc<DisplayList>,
bounds: Rect,
base_slot: u32,
cache: bool,
},
}Expand description
Op is one recorded display-list command.
Draw and clip operations include the bounds and ordering metadata resolved
by crate::DisplayListBuilder at record time.
Variants§
Save
SaveLayer
Open an offscreen layer scope, closed by the matching Restore. All
oracle fields are backpatched when the scope closes — still record
time; replay reads them, never counts.
Fields
mask_composite: Option<MaskKind>Set = this layer is a MASK: its composite converts the texture to COVERAGE (luminance or alpha) and multiplies the enclosing layer by it (DstIn over the whole enclosing extent, so content outside the mask’s ink disappears).
scope_bounds: RectChildren’s union bounds ∩ clip ∩ hint, list-root space — the layer texture’s size and the composite quad’s rect.
base_slot: u32Slot count when the scope opened. Children continue the SAME
depth line as the parent (Impeller’s global numbering,
Canvas::current_depth_); the layer’s own pass rebases by
subtracting it. Impeller records one span (total_content_depth)
and counts during replay; valo’s replay never counts, so it
records both ends of the span instead.
composite_slot: u32The composite draw’s slot — next on the same line, after the children’s span (so the span is composite_slot - base_slot - 1).
can_elide: boolAlpha-linear + pairwise-disjoint children and a plain-alpha composite: replay may skip the texture entirely and let the alpha ride each child at its own slot (Impeller’s opacity peephole: elision changes nothing about depth).
backdrop_sigma: Option<f32>Set = the layer OPENS pre-filled with a blur of everything
already painted beneath it (σ in local units; replay scales it
into device px). Children paint over that glass, and the
composite applies group alpha to blur + children as one image —
Flutter’s saveLayer(bounds, paint, backdrop). A backdrop layer
never elides: the seed needs a texture.
Restore
Transform(Matrix)
Appends to the current transform (canvas semantics: applies to subsequently drawn geometry first).
DrawRect
DrawPath
RRectBlur
A mask-blurred solid (r)rect in CLOSED FORM — one draw, no filter
passes; why a box shadow costs one quad (Impeller’s
SolidRRectBlurContents). Recorded when a solid paint has mask_blur;
radii are per corner, clockwise from top-left ([0.0; 4] = sharp).
ClipPath
Depth-buffer clip (Impeller’s “new clips”): the renderer
stencils the shape, then writes a depth CEILING at expiry_slot —
Intersect ceilings the exterior, Difference the interior. Draws below
the ceiling fail the depth test there; draws after the scope’s restore
sit above it. Expiry is auto — restore renders nothing.
Fields
DrawImage
Textured quad: src (texture px) → dst (local space). Sampling
picks filter/tiling; paint contributes tint (color as multiplier),
alpha, and blend.
GlyphRun
Positioned glyphs from a laid-out paragraph — the TextFrame analog
(font id + glyph ids + positions, so this crate never depends on
the text stack). One op per placed run; y sits on the
baseline; the renderer picks bitmap/SDF/path per transform.
Fields
font: Arc<Font>The font INSTANCE, carried by value to raster (Skia: text
blobs hold sk_sp<SkTypeface> — nothing is registered
renderer-side). Serialization keeps only the raster identity.
DrawDisplayList
Embed another list by reference — the retained-layer composition op.