pub enum DrawCmd {
Rect {
rect: Rect,
color: Color,
radius: f64,
border: f64,
},
Text {
text: String,
origin: Point,
size: f64,
color: Color,
},
PushClip(Rect),
PopClip,
Viewport {
rect: Rect,
id: u64,
},
}Expand description
A structured record of a scene primitive, kept alongside the lowered oxideav
nodes so a GPU backend can consume the scene without re-deriving primitives
from vector paths (the CPU rasterizer uses the nodes; the GPU path uses
these). See Scene::commands.
Variants§
Rect
A box: radius rounds the corners (0 = sharp); border > 0 strokes the
outline at that width instead of filling.
Text
A single line of text at origin (top-left).
PushClip(Rect)
Begin clipping subsequent primitives to rect (nests until PopClip).
GPU backends map this to a scissor rectangle.
PopClip
End the innermost clip region opened by PushClip.
Viewport
A reserved area for embedded content (a browser page, video, or any
externally-rendered surface), identified by id. The compositor draws
the content here: the CPU path blits the registered content [Pixmap]
over the placeholder fill after rasterizing; a GPU backend samples the
imported (dma-buf / IOSurface / shared-handle) texture into this rect.
See Scene::fill_viewport.