Skip to main content

PlatformDrawingContext

Struct PlatformDrawingContext 

Source
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>

Source

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).

Source

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).

Source

pub fn platform_impl(&mut self) -> &mut (dyn IDrawingContextImpl + 'a)

The platform drawing context implementation.

Source

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<'_>

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_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 draw_rectangle_acrylic_core( &mut self, material: &dyn IExperimentalAcrylicMaterial, rect: RoundedRect, )

Draws a rectangle filled with an acrylic-like material. Read more
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_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.

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.