pub struct Scene { /* private fields */ }Expand description
An ordered list of primitives in painter’s order.
Implementations§
Source§impl Scene
impl Scene
pub fn new() -> Self
pub fn clear(&mut self)
Sourcepub fn layer_depth(&self) -> u32
pub fn layer_depth(&self) -> u32
Number of layers currently open (see Scene::push_layer).
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn stats(&self) -> SceneStats
pub fn push_quad(&mut self, quad: &Quad, state: &DrawState)
pub fn push_shadow(&mut self, shadow: &Shadow, state: &DrawState)
Sourcepub fn push_mono_sprite(
&mut self,
bounds: Bounds,
tile: &AtlasTile,
color: Color,
state: &DrawState,
)
pub fn push_mono_sprite( &mut self, bounds: Bounds, tile: &AtlasTile, color: Color, state: &DrawState, )
Draws a coverage-mask sprite (glyph, tintable icon) in color.
Sourcepub fn push_poly_sprite(
&mut self,
bounds: Bounds,
tile: &AtlasTile,
radii: Corners<f32>,
grayscale: bool,
state: &DrawState,
)
pub fn push_poly_sprite( &mut self, bounds: Bounds, tile: &AtlasTile, radii: Corners<f32>, grayscale: bool, state: &DrawState, )
Draws a full color sprite (image, emoji) with optional rounded corners.
Sourcepub fn push_backdrop_blur(
&mut self,
bounds: Bounds,
radii: Corners<f32>,
blur: f32,
tint: Color,
state: &DrawState,
)
pub fn push_backdrop_blur( &mut self, bounds: Bounds, radii: Corners<f32>, blur: f32, tint: Color, state: &DrawState, )
Frosted glass: blurs everything drawn so far behind bounds and draws
it clipped to the rounded rect, tinted with tint.
Sourcepub fn push_layer(&mut self)
pub fn push_layer(&mut self)
Starts a layer: everything pushed until the matching
Scene::pop_layer is drawn into a transparent offscreen target,
then composited through a mask. Layers nest.
Sourcepub fn pop_layer(&mut self, bounds: Bounds, mask: LayerMask, state: &DrawState)
pub fn pop_layer(&mut self, bounds: Bounds, mask: LayerMask, state: &DrawState)
Ends the innermost layer and composites it inside bounds (device px,
transformed and clipped by state) with mask and state.opacity.
Content of the layer outside bounds is discarded, like CSS masks.
Sourcepub fn push_custom(
&mut self,
shader: ShaderId,
bounds: Bounds,
radii: Corners<f32>,
params: [f32; 8],
time: f32,
color: Color,
scale: f32,
state: &DrawState,
)
pub fn push_custom( &mut self, shader: ShaderId, bounds: Bounds, radii: Corners<f32>, params: [f32; 8], time: f32, color: Color, scale: f32, state: &DrawState, )
Draws bounds (rounded by radii) with a registered custom shader.
params reach the shader as input.params0/params1, time as
input.time, color as input.color; scale is the device scale
(device px per logical px).