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
impl RenderDataDrawingContext
pub fn new(compositor: Option<Rc<Compositor>>) -> Self
Sourcepub fn get_render_results(&mut self) -> Option<Rc<CompositionRenderData>>
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.
Sourcepub fn get_immediate_scene_brush_content(
&mut self,
brush: Rc<dyn ITileBrush>,
rect: Option<Rect>,
use_scalable_rasterization: bool,
) -> Option<Rc<ImmediateRenderDataSceneBrushContent>>
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.
Trait Implementations§
Source§impl IDrawingContextCore for RenderDataDrawingContext
impl IDrawingContextCore for RenderDataDrawingContext
Source§fn draw_line_core(&mut self, pen: &Rc<dyn IPen>, p1: Point, p2: Point)
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>,
)
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>,
)
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,
)
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,
)
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,
)
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>)
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>,
)
fn draw_glyph_run( &mut self, foreground: Option<&Rc<dyn IBrush>>, glyph_run: &Rc<GlyphRun>, )
Draws a glyph run.
fn push_clip_core(&mut self, rect: Rect)
fn push_rounded_clip_core(&mut self, rect: RoundedRect)
fn push_geometry_clip_core(&mut self, clip: &Ref<Geometry>)
fn push_opacity_core(&mut self, opacity: f64)
fn push_opacity_mask_core(&mut self, mask: &Rc<dyn IBrush>, bounds: Rect)
fn push_transform_core(&mut self, matrix: Matrix)
fn push_render_options_core(&mut self, render_options: RenderOptions)
fn push_text_options_core(&mut self, text_options: TextOptions)
fn push_effect_core(&mut self, effect: &Rc<dyn IEffect>, bounds: Rect)
fn pop_clip_core(&mut self)
fn pop_geometry_clip_core(&mut self)
fn pop_opacity_core(&mut self)
fn pop_opacity_mask_core(&mut self)
fn pop_transform_core(&mut self)
fn pop_render_options_core(&mut self)
fn pop_text_options_core(&mut self)
fn pop_effect_core(&mut self)
Source§fn dispose_core(&mut self)
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,
)
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§
impl !RefUnwindSafe for RenderDataDrawingContext
impl !Send for RenderDataDrawingContext
impl !Sync for RenderDataDrawingContext
impl !UnwindSafe for RenderDataDrawingContext
impl Freeze for RenderDataDrawingContext
impl Unpin for RenderDataDrawingContext
impl UnsafeUnpin for RenderDataDrawingContext
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
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