Skip to main content

RenderDataDrawingContext

Struct RenderDataDrawingContext 

Source
pub struct RenderDataDrawingContext { /* private fields */ }
Expand description

The drawing context core that records what is drawn into render data instead of drawing it.

With a compositor the result is a CompositionRenderData registered for serialization to the server; without one the recorded stream refers to the drawn objects directly and is replayed on the same thread.

Implementations§

Source§

impl RenderDataDrawingContext

Source

pub fn new(compositor: Option<Rc<Compositor>>) -> Self

Source

pub fn get_render_results(&mut self) -> Option<Rc<CompositionRenderData>>

Finishes the recording and returns the render data, registered for serialization on the compositor; None if nothing was drawn. The context is ready to record again.

Panics if the context has no compositor.

Source

pub fn get_immediate_scene_brush_content( &mut self, brush: Rc<dyn ITileBrush>, rect: Option<Rect>, use_scalable_rasterization: bool, ) -> Option<Rc<ImmediateRenderDataSceneBrushContent>>

Finishes a compositor-less recording and returns what was recorded as the content of the scene brush brush; None if nothing was drawn. rect is the bounds of the content; without it the bounds of what was drawn are used.

Source

pub fn reset(&mut self)

Discards what has been recorded so far.

Trait Implementations§

Source§

impl IDrawingContextCore for RenderDataDrawingContext

Source§

fn draw_line_core(&mut self, pen: &Rc<dyn IPen>, p1: Point, p2: Point)

Draws a line. The pen is visible.
Source§

fn draw_geometry_impl_core( &mut self, brush: Option<&Rc<dyn IBrush>>, pen: Option<&Rc<dyn IPen>>, geometry: &Arc<dyn IGeometryImpl>, )

Draws a platform geometry.
Source§

fn draw_geometry_core( &mut self, brush: Option<&Rc<dyn IBrush>>, pen: Option<&Rc<dyn IPen>>, geometry: &Ref<Geometry>, )

Draws a geometry object. The default implementation draws its platform implementation, if it has one.
Source§

fn draw_rectangle_core( &mut self, brush: Option<&Rc<dyn IBrush>>, pen: Option<&Rc<dyn IPen>>, rrect: RoundedRect, box_shadows: &BoxShadows, )

Draws a rectangle with the specified brush and pen.
Source§

fn draw_ellipse_core( &mut self, brush: Option<&Rc<dyn IBrush>>, pen: Option<&Rc<dyn IPen>>, rect: Rect, )

Draws an ellipse with the specified brush and pen.
Source§

fn draw_bitmap( &mut self, source: &RefCounted<SharedBitmapImpl>, opacity: f64, source_rect: Rect, dest_rect: Rect, )

Draws a platform bitmap, given by a counted reference to it (upstream’s IRef<IBitmapImpl>): a context that keeps the bitmap beyond the call takes a counted reference of its own.
Source§

fn custom(&mut self, custom: &Arc<dyn ICustomDrawOperation>)

Draws a custom drawing operation.
Source§

fn draw_glyph_run( &mut self, foreground: Option<&Rc<dyn IBrush>>, glyph_run: &Rc<GlyphRun>, )

Draws a glyph run.
Source§

fn push_clip_core(&mut self, rect: Rect)

Source§

fn push_rounded_clip_core(&mut self, rect: RoundedRect)

Source§

fn push_geometry_clip_core(&mut self, clip: &Ref<Geometry>)

Source§

fn push_opacity_core(&mut self, opacity: f64)

Source§

fn push_opacity_mask_core(&mut self, mask: &Rc<dyn IBrush>, bounds: Rect)

Source§

fn push_transform_core(&mut self, matrix: Matrix)

Source§

fn push_render_options_core(&mut self, render_options: RenderOptions)

Source§

fn push_text_options_core(&mut self, text_options: TextOptions)

Source§

fn push_effect_core(&mut self, effect: &Rc<dyn IEffect>, bounds: Rect)

Source§

fn pop_clip_core(&mut self)

Source§

fn pop_geometry_clip_core(&mut self)

Source§

fn pop_opacity_core(&mut self)

Source§

fn pop_opacity_mask_core(&mut self)

Source§

fn pop_transform_core(&mut self)

Source§

fn pop_render_options_core(&mut self)

Source§

fn pop_text_options_core(&mut self)

Source§

fn pop_effect_core(&mut self)

Source§

fn dispose_core(&mut self)

Releases the core. Called once, after every pushed state has been popped, when an owned context is disposed.
Source§

fn draw_rectangle_acrylic_core( &mut self, material: &dyn IExperimentalAcrylicMaterial, rect: RoundedRect, )

Draws a rectangle filled with an acrylic-like material. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.