pub struct DiscardScene;Expand description
A PaintScene sink that accepts every paint command and records
nothing — the zero-GPU-cost target for a subtree that still needs its
paint pass driven for the pass’s side effects (hero-rect reporting
through PaintCtx::with_hero_registry, other paint-time widget state)
even though its pixels will never be composited. The navigator’s
transition machinery is the motivating case: a page whose resolved alpha
is 0 still has to paint to report hero rects and advance animating
children, but every command it emits is otherwise wasted GPU work.
§Guarantee
No paint command reaches any scene: every PaintScene method on
DiscardScene is a no-op, whether overridden here directly or
inherited from the trait’s own no-op (or no-op-delegating) default.
Anything driven through PaintCtx rather than through
&mut dyn PaintScene — the hero registry, the frame clock, paced-class
bubbling — is unaffected, since none of that machinery routes through the
scene it’s handed.
Trait Implementations§
Source§impl PaintScene for DiscardScene
impl PaintScene for DiscardScene
Source§fn fill_rect(&mut self, _origin: Point, _size: Size, _color: AlphaColor<Srgb>)
fn fill_rect(&mut self, _origin: Point, _size: Size, _color: AlphaColor<Srgb>)
origin with size, filled with
the solid color.Source§fn draw_text(&mut self, _origin: Point, _text: &str)
fn draw_text(&mut self, _origin: Point, _text: &str)
origin. Read moreSource§fn fill_rounded_rect(
&mut self,
_origin: Point,
_size: Size,
_radius: f64,
_color: AlphaColor<Srgb>,
)
fn fill_rounded_rect( &mut self, _origin: Point, _size: Size, _radius: f64, _color: AlphaColor<Srgb>, )
Source§fn fill_rounded_rect_radii(
&mut self,
origin: Point,
size: Size,
radii: CornerRadii,
color: AlphaColor<Srgb>,
)
fn fill_rounded_rect_radii( &mut self, origin: Point, size: Size, radii: CornerRadii, color: AlphaColor<Srgb>, )
radii — the
shape a uniform PaintScene::fill_rounded_rect cannot express (a
bottom-anchored sheet with only its top corners rounded, a segmented
control’s end caps). Read moreSource§fn stroke_line(
&mut self,
_p0: Point,
_p1: Point,
_width: f64,
_color: AlphaColor<Srgb>,
)
fn stroke_line( &mut self, _p0: Point, _p1: Point, _width: f64, _color: AlphaColor<Srgb>, )
Source§fn push_clip(&mut self, _origin: Point, _size: Size)
fn push_clip(&mut self, _origin: Point, _size: Size)
origin/size) onto the backend clip stack;
subsequent draws are clipped to it until the matching PaintScene::pop_clip. Read moreSource§fn push_clip_rounded(&mut self, _origin: Point, _size: Size, _radius: f64)
fn push_clip_rounded(&mut self, _origin: Point, _size: Size, _radius: f64)
origin/size, corner
radius) onto the backend clip stack; subsequent draws are clipped to
the rounded shape until the matching PaintScene::pop_clip — the same
pop PaintScene::push_clip uses, since there is one clip stack. Read moreSource§fn push_clip_rounded_radii(
&mut self,
origin: Point,
size: Size,
radii: CornerRadii,
)
fn push_clip_rounded_radii( &mut self, origin: Point, size: Size, radii: CornerRadii, )
radii onto the backend clip stack, popped
by the same PaintScene::pop_clip as every other push. Read moreSource§fn pop_clip(&mut self)
fn pop_clip(&mut self)
PaintScene::push_clip.Source§fn draw_glyph_run(&mut self, _run: GlyphRun)
fn draw_glyph_run(&mut self, _run: GlyphRun)
Source§fn draw_image(&mut self, _data: &ImageData, _dest: Rect)
fn draw_image(&mut self, _data: &ImageData, _dest: Rect)
data.widthxdata.height) size to fill the absolute dest rect. Read moreSource§fn draw_shader(&mut self, _program: &ShaderProgram, _dest: Rect, _time: f32)
fn draw_shader(&mut self, _program: &ShaderProgram, _dest: Rect, _time: f32)
dest. Read moreSource§fn draw_scene_texture(&mut self, _id: u64, _dest: Rect)
fn draw_scene_texture(&mut self, _id: u64, _dest: Rect)
ExternalPass)
into the scene. Read moreSource§fn draw_shadow(
&mut self,
_origin: Point,
_size: Size,
_radius: f64,
_std_dev: f64,
_color: AlphaColor<Srgb>,
)
fn draw_shadow( &mut self, _origin: Point, _size: Size, _radius: f64, _std_dev: f64, _color: AlphaColor<Srgb>, )
box-shadow) at origin/size. Read moreSource§fn fill_rect_brush(&mut self, origin: Point, size: Size, brush: &Brush)
fn fill_rect_brush(&mut self, origin: Point, size: Size, brush: &Brush)
origin with size, filled
with an arbitrary brush (solid color or gradient). Read moreSource§fn fill_rounded_rect_brush(
&mut self,
_origin: Point,
_size: Size,
_radius: f64,
_brush: &Brush,
)
fn fill_rounded_rect_brush( &mut self, _origin: Point, _size: Size, _radius: f64, _brush: &Brush, )
brush (solid color or gradient). Read moreSource§fn push_layer(&mut self, _origin: Point, _size: Size, _alpha: f32)
fn push_layer(&mut self, _origin: Point, _size: Size, _alpha: f32)
origin/size) onto the backend layer
stack; subsequent draws are composited at alpha until the matching
PaintScene::pop_layer. Read moreSource§fn pop_layer(&mut self)
fn pop_layer(&mut self)
PaintScene::push_layer.Source§fn clear_rect(&mut self, _origin: Point, _size: Size)
fn clear_rect(&mut self, _origin: Point, _size: Size)
origin/size) to full
transparency (alpha 0), erasing everything already painted below it in
this scene — a real destination-clearing composite, not merely skipping
paint over the region. Read moreSource§fn fill_path(&mut self, _origin: Point, _path: &BezPath, _brush: &Brush)
fn fill_path(&mut self, _origin: Point, _path: &BezPath, _brush: &Brush)
frust_scene::arc_path) at origin, using the nonzero winding
rule and brush. Read moreSource§fn stroke_path(
&mut self,
_origin: Point,
_path: &BezPath,
_width: f64,
_brush: &Brush,
)
fn stroke_path( &mut self, _origin: Point, _path: &BezPath, _width: f64, _brush: &Brush, )
origin with width
and round caps/joins, using brush. Read moreSource§fn stroke_path_dashed(
&mut self,
origin: Point,
path: &BezPath,
width: f64,
_dash: DashPattern,
brush: &Brush,
)
fn stroke_path_dashed( &mut self, origin: Point, path: &BezPath, width: f64, _dash: DashPattern, brush: &Brush, )
origin as a dashed line: the same
stroke PaintScene::stroke_path paints, broken into dash’s on/off
runs by the render crate at encode time. Read moreSource§fn push_transform(&mut self, _transform: Affine)
fn push_transform(&mut self, _transform: Affine)
transform, composed with the current one, onto the
backend transform stack; subsequent draws are transformed until the
matching PaintScene::pop_transform. Read moreSource§fn pop_transform(&mut self)
fn pop_transform(&mut self)
PaintScene::push_transform.Source§fn push_snapshot(
&mut self,
_key: u64,
origin: Point,
size: Size,
alpha: f32,
scale: f64,
)
fn push_snapshot( &mut self, _key: u64, origin: Point, size: Size, alpha: f32, scale: f64, )
key across frames. The alpha and scale are presentation parameters
applied to the whole cached body (alpha blending, uniform scale). Read moreSource§fn pop_snapshot(&mut self)
fn pop_snapshot(&mut self)
PaintScene::push_snapshot’s default: pop layer, then transform.
Recorders that don’t override both may see unbalanced stacks if only one
is overridden; the default pair is provided for source compatibility.Auto Trait Implementations§
impl Freeze for DiscardScene
impl RefUnwindSafe for DiscardScene
impl Send for DiscardScene
impl Sync for DiscardScene
impl Unpin for DiscardScene
impl UnsafeUnpin for DiscardScene
impl UnwindSafe for DiscardScene
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.