Skip to main content

CompositorDrawingContextProxy

Struct CompositorDrawingContextProxy 

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

A drawing context that forwards to another one, postponing state changes until they are needed and applying an optional post transform.

Implementations§

Source§

impl CompositorDrawingContextProxy

Source

pub fn new(inner: Box<dyn IDrawingContextImpl>) -> Self

Source

pub fn into_inner(self) -> Box<dyn IDrawingContextImpl>

Flushes the pending commands and returns the wrapped context.

Source

pub fn post_transform(&self) -> Option<Matrix>

Source

pub fn set_post_transform(&mut self, value: Option<Matrix>)

Source

pub fn auto_flush(&self) -> bool

Source

pub fn set_auto_flush(&mut self, value: bool)

Source

pub fn flush(&mut self)

Trait Implementations§

Source§

impl IDrawingContextImpl for CompositorDrawingContextProxy

Source§

fn transform(&self) -> Matrix

The current transform of the drawing context.
Source§

fn set_transform(&mut self, value: Matrix)

Sets the current transform of the drawing context.
Source§

fn clear(&mut self, color: Color)

Clears the render target to the specified color.
Source§

fn draw_bitmap( &mut self, source: &dyn IBitmapImpl, opacity: f64, source_rect: Rect, dest_rect: Rect, )

Draws a bitmap image.
Source§

fn draw_bitmap_with_mask( &mut self, source: &dyn IBitmapImpl, opacity_mask: &dyn IBrush, opacity_mask_rect: Rect, dest_rect: Rect, )

Draws a bitmap image through an opacity mask.
Source§

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

Draws a line.
Source§

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

Draws a geometry.
Source§

fn draw_rectangle( &mut self, brush: Option<&dyn IBrush>, pen: Option<&dyn IPen>, rect: RoundedRect, box_shadows: &BoxShadows, )

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

fn draw_region( &mut self, brush: Option<&dyn IBrush>, pen: Option<&dyn IPen>, region: &dyn IPlatformRenderInterfaceRegion, )

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

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

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

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

Draws a glyph run.
Source§

fn create_layer(&mut self, size: PixelSize) -> Rc<dyn IDrawingContextLayerImpl>

Creates a new layer: an offscreen render target compatible with this drawing context that can be blitted back onto it.
Source§

fn push_clip(&mut self, clip: Rect)

Pushes a clip rectangle.
Source§

fn push_clip_rounded(&mut self, clip: RoundedRect)

Pushes a rounded clip rectangle.
Source§

fn push_clip_region(&mut self, region: &dyn IPlatformRenderInterfaceRegion)

Pushes a clip region.
Source§

fn pop_clip(&mut self)

Pops the latest pushed clip rectangle or region.
Source§

fn push_layer(&mut self, bounds: Rect)

Enforces rendering to happen on an intermediate surface.
Source§

fn pop_layer(&mut self)

Pops the latest pushed intermediate surface layer.
Source§

fn push_opacity(&mut self, opacity: f64, bounds: Option<Rect>)

Pushes an opacity value.
Source§

fn pop_opacity(&mut self)

Pops the latest pushed opacity value.
Source§

fn push_opacity_mask(&mut self, mask: &dyn IBrush, bounds: Rect)

Pushes an opacity mask.
Source§

fn pop_opacity_mask(&mut self)

Pops the latest pushed opacity mask.
Source§

fn push_geometry_clip(&mut self, clip: &dyn IGeometryImpl)

Pushes a clip geometry.
Source§

fn pop_geometry_clip(&mut self)

Pops the latest pushed geometry clip.
Source§

fn push_render_options(&mut self, render_options: RenderOptions)

Pushes render options.
Source§

fn pop_render_options(&mut self)

Pops the latest pushed render options.
Source§

fn push_text_options(&mut self, text_options: TextOptions)

Pushes text options for the drawing context.
Source§

fn pop_text_options(&mut self)

Pops the latest text options.
Source§

fn get_feature(&mut self, feature_type: TypeId) -> Option<Rc<dyn Any>>

Attempts to get an optional feature from the drawing context implementation; see IOptionalFeatureProvider.
Source§

fn as_drawing_context_impl_with_effects( &mut self, ) -> Option<&mut dyn IDrawingContextImplWithEffects>

The context viewed as IDrawingContextImplWithEffects, when the backend can apply bitmap effects. This replaces the interface cast (impl as IDrawingContextImplWithEffects): a backend that implements the trait overrides this to return itself.
Source§

fn as_drawing_context_with_acrylic_like_support( &mut self, ) -> Option<&mut dyn IDrawingContextWithAcrylicLikeSupport>

The context viewed as IDrawingContextWithAcrylicLikeSupport, when the backend can draw acrylic-like materials. This replaces the interface cast: a backend that implements the trait overrides this to return itself.
Source§

fn as_any_mut(&mut self) -> &mut dyn Any

Lets the backend recover its concrete type.
Source§

fn dispose(&mut self)

Finishes drawing and releases the context (presenting the frame where the context was created by a render target).
Source§

impl IDrawingContextImplWithEffects for CompositorDrawingContextProxy

Source§

fn push_effect(&mut self, clip_rect: Option<Rect>, effect: &dyn IEffect)

Pushes an effect: everything drawn until the matching pop_effect is drawn through it. clip_rect bounds the output of the effect, when known.
Source§

fn pop_effect(&mut self)

Pops the latest pushed effect.
Source§

impl IDrawingContextWithAcrylicLikeSupport for CompositorDrawingContextProxy

Source§

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

Draws a rectangle filled with an acrylic-like material.

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.