#[non_exhaustive]pub enum SceneNode {
Show 21 variants
Rect {
rect: Rect,
brush: Brush,
radius: [Px; 4],
},
Border {
rect: Rect,
color: Color,
width: Px,
radius: [Px; 4],
},
Text {Show 14 fields
rect: Rect,
text: Arc<str>,
color: Color,
size: Px,
font_family: Option<&'static str>,
text_align: TextAlign,
font_weight: FontWeight,
font_style: FontStyle,
text_decoration: TextDecoration,
letter_spacing: Px,
line_height: Px,
extra_style: TextExtraStyle,
url: Option<Arc<str>>,
font_variation_settings: Option<Arc<str>>,
},
Ellipse {
rect: Rect,
brush: Brush,
},
EllipseBorder {
rect: Rect,
color: Color,
width: Px,
},
PushClip {
rect: Rect,
radius: [Px; 4],
op: ClipOp,
},
PopClip,
PushTransform {
transform: Transform,
},
PopTransform,
Image {
rect: Rect,
handle: ImageHandle,
tint: Color,
fit: ImageFit,
},
Coverage {
rect: Rect,
handle: ImageHandle,
color: Color,
},
Shadow {
rect: Rect,
radius: [Px; 4],
elevation: Px,
color: Color,
},
BeginLayer {
rect: Rect,
layer_id: u32,
alpha: f32,
blur_radius_x: Px,
blur_radius_y: Px,
rectangle_edge: bool,
},
EndLayer {
layer_id: u32,
},
CompositeShadow {
layer_id: u32,
blur_px: Px,
offset_px: (Px, Px),
color: Color,
},
Arc {
rect: Rect,
start_angle: f32,
sweep_angle: f32,
stroke_width: Px,
color: Color,
cap: StrokeCap,
},
VectorMesh {
mesh: Arc<VectorMeshData>,
transform: [f32; 6],
paint: PaintDesc,
clip: Option<u32>,
blend: BlendMode,
},
VectorOverlay {
meshes: Arc<[VectorMeshData]>,
},
PushVectorClip {
mesh: Arc<VectorMeshData>,
op: ClipOp,
},
PopVectorClip,
Callback {
rect: Rect,
payload: PaintCallbackPayload,
},
}Expand description
Paint-space scene graph. Rect/Vec2 compounds carry physical pixels
(like Compose Offset/Size/Rect); scalar lengths use Px so the
dp→px boundary is explicit instead of unitless f32.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Rect
Border
Text
Fields
font_weight: FontWeighttext_decoration: TextDecorationextra_style: TextExtraStyleRarely-tweaked style properties, bundled for ergonomic Default.
Ellipse
EllipseBorder
PushClip
PopClip
PushTransform
PopTransform
Image
Coverage
Tinted A8 coverage mask: samples handle (registered with
register_coverage_a8) as coverage and composites color with
source-over. Lets hosts rasterize geometry once (e.g. cached glyph
coverage tiles) and re-composite it per frame with a new color or
position without re-uploading. rect positions the tile’s top-left;
its size is the registered tile size.
Shadow
Shadow behind a rounded rect, typically driven by StateElevation.
The elevation field controls offset and alpha.
BeginLayer
Mark the start of a graphics layer: the contained subtree is rendered
into an offscreen texture and then composited back into the parent.
alpha is the group-compositing alpha applied at composite time.
blur_radius_x / blur_radius_y are the gaussian blur radii in Px
applied to the layer before compositing (zero = no blur on that axis).
rectangle_edge true = clamp edge pixels (Rectangle). False = transparent out-of-bounds (Unbounded).
EndLayer
Closes the graphics layer opened by the matching BeginLayer.
CompositeShadow
Draws a blurred drop shadow underneath a previously-rendered layer.
Emitted between EndLayer and the layer’s CompositeLayer. The
quad samples the layer’s texture with a 3x3 Gaussian blur and an
optional vertical offset.
Arc
Arc stroke
VectorMesh
Pre-tessellated vector mesh (fill or stroke geometry produced by the
host, e.g. lyon tessellation). Vertices live in the mesh’s own local
space; transform is a 2x3 affine that maps local -> world pixels as
[m00, m01, m10, m11, tx, ty] (out = M * local + t; identity is
[1.0, 0.0, 0.0, 1.0, 0.0, 0.0]) and is applied in the vertex shader.
The current scene PushTransform stack is folded in on top of
transform.
Fields
mesh: Arc<VectorMeshData>VectorOverlay
Screen-space overlays (handles, rubber bands, playhead). Each mesh is positioned in final device pixels and ignores the world PushTransform stack. Emit outside the viewport’s world transform.
Fields
meshes: Arc<[VectorMeshData]>PushVectorClip
Start a vector clip: the mesh is rendered into the stencil buffer
(increment) and subsequent content is masked to it. Mirrors the
rect-based PushClip but for arbitrary tessellated masks.
op selects intersection (keep content inside the mask, the common
case) or difference (cut the mask out, e.g. ASS \iclip drawings).
Difference is exact for a lone mask and for a mask nested inside
intersect clips; a normal clip nested inside a difference mask is
best-effort (see the renderer docs).
PopVectorClip
End a vector clip opened by PushVectorClip.
Callback
Custom GPU paint callback (check egui::PaintCallback).