pub struct PlanRecorder { /* private fields */ }Expand description
Canvas que materializa todo lo dibujado en un RenderPlan.
Implementations§
Source§impl PlanRecorder
impl PlanRecorder
pub fn new() -> Self
Sourcepub fn into_plan(self) -> RenderPlan
pub fn into_plan(self) -> RenderPlan
Consume el recorder y devuelve el plan acumulado.
Sourcepub fn plan(&self) -> &RenderPlan
pub fn plan(&self) -> &RenderPlan
Acceso de sólo-lectura al plan en construcción.
Trait Implementations§
Source§impl Canvas for PlanRecorder
impl Canvas for PlanRecorder
Source§fn push_clip(&mut self, rect: Rect)
fn push_clip(&mut self, rect: Rect)
Clip subsiguiente al rect dado. Stack-discipline:
push_clip + draw + pop_clip.fn pop_clip(&mut self)
Source§fn stroke_rect(&mut self, rect: Rect, stroke: StrokeStyle)
fn stroke_rect(&mut self, rect: Rect, stroke: StrokeStyle)
Rectángulo sólo stroke (sin fill).
Source§fn stroke_line(&mut self, a: Point, b: Point, stroke: StrokeStyle)
fn stroke_line(&mut self, a: Point, b: Point, stroke: StrokeStyle)
Línea de a→b.
Source§fn stroke_polyline(&mut self, coords: &[f32], stroke: StrokeStyle)
fn stroke_polyline(&mut self, coords: &[f32], stroke: StrokeStyle)
Polilínea sobre coords interleaved
[x0,y0,x1,y1,…].
El backend la rendea como un solo draw call cuando puede.Source§fn fill_triangle_strip(&mut self, coords: &[f32], colors: &[Color])
fn fill_triangle_strip(&mut self, coords: &[f32], colors: &[Color])
Triangle strip rellenado, con un color por vértice
(longitudes deben coincidir:
coords.len()/2 == colors.len()).
Es lo que usa el phosphor trail y los ribbons Sankey.Source§impl Debug for PlanRecorder
impl Debug for PlanRecorder
Source§impl Default for PlanRecorder
impl Default for PlanRecorder
Source§fn default() -> PlanRecorder
fn default() -> PlanRecorder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PlanRecorder
impl RefUnwindSafe for PlanRecorder
impl Send for PlanRecorder
impl Sync for PlanRecorder
impl Unpin for PlanRecorder
impl UnsafeUnpin for PlanRecorder
impl UnwindSafe for PlanRecorder
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
Mutably borrows from an owned value. Read more
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.