pub struct PlatformDrawingContext<'a> { /* private fields */ }Expand description
The drawing context core that draws straight to a platform drawing context implementation.
Implementations§
Source§impl<'a> PlatformDrawingContext<'a>
impl<'a> PlatformDrawingContext<'a>
Sourcepub fn new(platform_impl: Box<dyn IDrawingContextImpl + 'a>) -> Self
pub fn new(platform_impl: Box<dyn IDrawingContextImpl + 'a>) -> Self
Creates a core that draws to platform_impl and disposes it when the
core is disposed (ownsImpl: true).
Sourcepub fn borrowed(platform_impl: &'a mut dyn IDrawingContextImpl) -> Self
pub fn borrowed(platform_impl: &'a mut dyn IDrawingContextImpl) -> Self
Creates a core that draws to platform_impl without taking ownership
of it (ownsImpl: false).
Sourcepub fn platform_impl(&mut self) -> &mut (dyn IDrawingContextImpl + 'a)
pub fn platform_impl(&mut self) -> &mut (dyn IDrawingContextImpl + 'a)
The platform drawing context implementation.
Sourcepub fn draw_rectangle_acrylic(
&mut self,
material: &dyn IExperimentalAcrylicMaterial,
rect: RoundedRect,
)
pub fn draw_rectangle_acrylic( &mut self, material: &dyn IExperimentalAcrylicMaterial, rect: RoundedRect, )
Draws a rectangle filled with an acrylic-like material. A backend without acrylic support gets the rectangle filled with the fallback color of the material.
Trait Implementations§
Source§impl IDrawingContextCore for PlatformDrawingContext<'_>
impl IDrawingContextCore for PlatformDrawingContext<'_>
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_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.
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
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.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for PlatformDrawingContext<'a>
impl<'a> !Send for PlatformDrawingContext<'a>
impl<'a> !Sync for PlatformDrawingContext<'a>
impl<'a> !UnwindSafe for PlatformDrawingContext<'a>
impl<'a> Freeze for PlatformDrawingContext<'a>
impl<'a> Unpin for PlatformDrawingContext<'a>
impl<'a> UnsafeUnpin for PlatformDrawingContext<'a>
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