pub enum DrawOp {
Quad {
id: String,
rect: Rect,
scissor: Option<Rect>,
shader: ShaderHandle,
uniforms: UniformBlock,
},
GlyphRun {Show 18 fields
id: String,
rect: Rect,
scissor: Option<Rect>,
shader: ShaderHandle,
color: Color,
text: String,
size: f32,
line_height: f32,
family: FontFamily,
mono_family: FontFamily,
weight: FontWeight,
mono: bool,
wrap: TextWrap,
anchor: TextAnchor,
layout: TextLayout,
underline: bool,
strikethrough: bool,
link: Option<String>,
},
AttributedText {
id: String,
rect: Rect,
scissor: Option<Rect>,
shader: ShaderHandle,
runs: Vec<(String, RunStyle)>,
size: f32,
line_height: f32,
wrap: TextWrap,
anchor: TextAnchor,
layout: TextLayout,
},
Icon {
id: String,
rect: Rect,
scissor: Option<Rect>,
source: IconSource,
color: Color,
size: f32,
stroke_width: f32,
},
Image {
id: String,
rect: Rect,
scissor: Option<Rect>,
image: Image,
tint: Option<Color>,
radius: Corners,
fit: ImageFit,
},
AppTexture {
id: String,
rect: Rect,
scissor: Option<Rect>,
texture: AppTexture,
alpha: SurfaceAlpha,
fit: ImageFit,
transform: Affine2,
},
Vector {
id: String,
rect: Rect,
scissor: Option<Rect>,
asset: Arc<VectorAsset>,
render_mode: VectorRenderMode,
},
BackdropSnapshot,
}Expand description
One paint operation in the laid-out frame.
Variants§
Quad
A rectangular region painted by a shader (typically
stock::rounded_rect, but custom shaders also emit Quad).
GlyphRun
A run of text. The draw op carries the author text and measured layout; backends shape/rasterize through the shared glyph atlas path.
Fields
shader: ShaderHandlefamily: FontFamilymono_family: FontFamilyMonospace face used when mono is set. Stamped from the
source El’s mono_font_family (themed via
Theme::mono_font_family).
weight: FontWeightanchor: TextAnchorlayout: TextLayoutunderline: boolUnderline / strikethrough state lifted from the source El’s
text_underline / text_strikethrough. Backends fold them
into the synthesized RunStyle before shaping so the
decoration pass in crate::text::atlas runs uniformly
for standalone leaves and attributed paragraphs.
link: Option<String>Optional link URL from the El’s text_link. Carried for
future hit-test work; today it just pins color + underline
via RunStyle::with_link.
AttributedText
An attributed paragraph: a sequence of styled runs that flow
together inside one rect. The runtime hands runs straight to
crate::text::atlas::GlyphAtlas::shape_and_rasterize_runs so
wrapping decisions cross run boundaries (real prose, not glued
segments). layout is an approximate pre-shaping measurement
from text::metrics — backends shape for accurate placement;
SVG uses it to lay tspan baselines.
Fields
shader: ShaderHandleruns: Vec<(String, RunStyle)>Source-order styled spans. Each String may contain
embedded \n to express in-paragraph hard breaks.
anchor: TextAnchorlayout: TextLayoutIcon
A vector icon scaled into rect. The source is either a
built-in crate::tree::IconName (24x24 lucide-style) or an
app-supplied crate::SvgIcon. SVG bundle output renders the
vector paths directly; wgpu/vulkano backends bake an MTSDF (or
tessellate for non-flat materials); backends without a native
vector painter fall back to a glyph for built-ins.
Fields
source: IconSourceImage
A raster image painted into rect. The image carries the
pixel data (Arc-shared with the source El) and is keyed by
image.content_hash() in backend texture caches. rect is the
post-fit destination; for Cover it can extend past the El’s
content area and is clipped via scissor. SVG bundle output
emits a placeholder rect labelled with the image’s hash.
Fields
AppTexture
An app-owned GPU texture composited into the paint stream.
Unlike DrawOp::Image, the backend does not upload pixels —
it samples the existing texture identified by texture during
paint, keying its bind-group cache on
crate::surface::AppTextureId. rect is the post-fit
destination rect; for Cover it can extend past the El’s
content area and is clipped via scissor. transform is an
affine applied to the textured quad in destination space,
around the centre of rect. alpha selects the blend path.
SVG bundle output emits a placeholder rect labelled with the
texture’s id.
Vector
An app-supplied vector asset. render_mode decides whether the
backend preserves authored paint or treats the asset as a
one-colour mask. SVG bundle output emits a placeholder rect
labelled with the asset’s hash.
BackdropSnapshot
Mid-frame snapshot of the current target into a sampled texture, scheduled before any backdrop-sampling pass.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DrawOp
impl !RefUnwindSafe for DrawOp
impl Send for DrawOp
impl Sync for DrawOp
impl Unpin for DrawOp
impl UnsafeUnpin for DrawOp
impl !UnwindSafe for DrawOp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.