Expand description
Renderer-neutral scene, canvas, display-list, and compositor primitives.
Structs§
- Annotation
- A type-erased application annotation carried by an annotated compositing
region. The value remains strongly typed at the API boundary: consumers
query it with
LayerTree::find_annotationand receive only values of the requested concrete type. Native platform adapters can therefore project their own typed metadata without making the renderer depend on a platform crate. - Border
- Canvas
- Color
Filter - A renderer-independent 4x5 color matrix. Matrix inputs and outputs are straight (unpremultiplied) RGBA in the normalized 0..=1 range. The GPU backend converts its retained premultiplied texture to straight color, applies this matrix, clamps the result, and premultiplies it again.
- Compositor
Diagnostics - Corner
Radii - Per-corner radii in logical pixels, ordered clockwise from the top left.
- Decoration
- Display
List - Drop
Shadow Effect - Renderer-neutral arbitrary-subtree shadow description. The source is isolated first, then its alpha is blurred and colorized by the compositor.
- Effect
Chain - Flattened
Annotation - Annotation placement captured by the most recent layer flatten. A
Nonebounds value representssized: false, which participates at every point in the scene subject to ancestor clipping. - Flattened
Picture - A picture placement observed while flattening. All rectangles here are in logical coordinates; this is intentionally useful for CPU-side scene tests and diagnostics without involving a surface or DPI scale factor.
- Follower
Layer - Retained configuration of a layer that tracks a
LayerLinkleader. - Gaussian
Blur - Renderer-neutral separable Gaussian blur description. Sigma is expressed in logical pixels; a backend converts it to physical pixels at render time. Negative and non-finite values are normalized to zero at this boundary so every backend observes the same effect semantics.
- Glyph
Position - A positioned glyph produced by a text shaper. It is intentionally not a character: a glyph can represent multiple Unicode scalars or none.
- Glyph
Run - Compact, contiguous shaped glyph data shared by display-list commands.
- Gradient
Id - Stable identity for immutable normalized gradient stop data.
- Gradient
Stop - Gradient
Stops - Layer
Anchor - Normalized anchor used by leader/follower layers.
(-1, -1)is the top-left corner,(0, 0)the center, and(1, 1)the bottom-right. - LayerId
- Opaque retained compositor identity. It uses the core generational arena so an ID for a removed layer can never select a later, unrelated layer.
- Layer
Link - Shared identity used to resolve a composited target and any number of followers across otherwise unrelated retained subtrees.
- Layer
Tree - Renderer-independent retained layer arena. Picture display lists are owned once and scene flattening only emits a transient linear command stream. This deliberately has no GPU resources or offscreen textures.
- Linear
Gradient - Paint
- A renderer-neutral paint description.
- Path
- Path
Builder - PathId
- Stable identity for immutable path geometry. It deliberately does not encode paint, placement, or transforms.
- Publisher
Identity - Opaque publication owner minted per leader layer. A link may be shared
across layer trees whose arena indices overlap, so a tree-local
LayerIdcannot name the publisher; instead each leader layer owns one allocation whose identity is inseparable from the owner’s lifetime. Compare only withsame_owner, never by detached address. - RRect
- Radial
Gradient - Shadow
- Canonical single-shadow value used by text and other paint-producing domains. Subsystems should use this type instead of defining a parallel color/offset/blur tuple.
- Stroke
- Surface
Partition Id - Renderer-neutral identity for a detachable composition subtree.
- Sweep
Gradient
Enums§
- Blend
Mode - A blend operation defined over premultiplied linear RGBA values. The GPU
compositor uses the same equations as
blend_premultiplied. - Brush
- Effect
- Ordered single-input effect descriptions. Drop shadows remain a separate layer because they intentionally produce both a shadow and the original source output.
- Fill
Rule - Filter
Quality - Image filtering policy matching Flutter’s public quality vocabulary.
- Image
Sampling - Renderer-neutral raster filtering policy. Ordinary UI images default to linear sampling; pixel art can opt into nearest-neighbour sampling.
- Layer
Kind - LineCap
- Line
Join - Paint
Command - Paint
Style - Whether a
Paintcovers the interior or the outline of a path.
Functions§
- blend_
premultiplied - Reference blend implementation for premultiplied normalized RGBA. It is public so tests and alternate backends can verify their shader formulas.
- blur_
bounds - Expands source bounds by the finite Gaussian support in logical pixels.
- blur_
margin - Conservative logical blur margin for the finite 3-sigma cutoff.
- drop_
shadow_ bounds - Bounds of a shadow plus the original source. The union is deliberately conservative and works for positive, negative, and fractional offsets.
- gaussian_
kernel_ weights - A normalized, symmetric one-dimensional Gaussian kernel represented in
order
[-radius, ..., 0, ..., +radius]. The cutoff is exactly three physical sigma, and sigma zero is the identity kernel. - linear_
gradient_ t - Pad-spread linear parameter in local logical coordinates. A zero-length
axis deterministically chooses the last stop (
t = 1). - normalize_
opacity - Canonical opacity representation shared by widgets, retained layers, and GPU lowering. Non-finite values become transparent and finite values are clamped to the physically meaningful range.
- normalize_
sigma - Canonical sigma normalization used by painting, widgets, and GPU lowering. Non-finite values follow the existing “invalid numeric input is transparent/zero” policy.
- premultiplied_
shadow_ sample - Premultiplied shadow color for one blurred alpha sample. This helper is shared by deterministic CPU tests and documents the exact GPU equation.
- radial_
gradient_ t - Pad-spread radial parameter in local logical coordinates. A non-positive
radius deterministically chooses the last stop (
t = 1). - resolve_
follower_ target - World-space point where a follower’s anchor must land, resolved entirely in leader space. The compositor and the widget tree share this half of the projection; each side then inverts it into its own retained frame (layer world vs. render parent), which is why the callers still differ.
- sample_
gradient_ stops - Samples normalized stops using pad spread and premultiplied-linear color interpolation. At a duplicate offset the last duplicate wins, allowing a hard transition without division by zero.
- sweep_
gradient_ t
Type Aliases§
- Color
Matrix - Compatibility spelling for callers that model a 4×5 filter as a color matrix. The alias keeps one canonical representation and one set of straight/premultiplied semantics.
- Shader
- A renderer-neutral shader value.