Skip to main content

CompositingRenderer

Struct CompositingRenderer 

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

A renderer that utilizes a Compositor to render the visual tree.

Implementations§

Source§

impl CompositingRenderer

Source

pub fn new( root: &Rc<dyn IPresentationSource>, compositor: &Rc<Compositor>, surfaces: RenderSurfaces, ) -> Rc<CompositingRenderer>

Creates the renderer of the tree hosted by root. surfaces returns the platform surfaces to render to.

The renderer refers to its presentation source weakly: the source owns its renderer.

Source

pub fn with_weak_root( root: Weak<dyn IPresentationSource>, compositor: &Rc<Compositor>, surfaces: RenderSurfaces, ) -> Rc<CompositingRenderer>

Like new, for a presentation source that is still being constructed.

Source

pub fn composition_target(&self) -> &Rc<CompositionTarget>

The composition target the renderer draws the tree to.

Source

pub fn compositor_handle(&self) -> &Rc<Compositor>

The compositor of the renderer.

Source

pub fn set_root(&self, root: Option<Ref<Visual>>)

Sets the visual whose composition visual is the root of the composition target; None detaches the tree.

Source

pub fn set_transparency_level(&self, level: CompositionTransparencyLevel)

Sets the transparency level the composition target renders with.

Source

pub fn set_platform_specific_scene_info( &self, info: Option<Arc<dyn Any + Send + Sync>>, )

Sets the platform-specific scene info passed to the render target.

Source

pub fn hit_tester(&self) -> Option<Rc<dyn IHitTester>>

The renderer as the hit tester of its scene.

Source

pub fn as_any(&self) -> &dyn Any

Source

pub fn trigger_scene_invalidated_for_unit_tests(&self, rect: Rect)

Source

pub fn has_pending_update_for_unit_tests(&self, visual: &Visual) -> bool

Whether the renderer holds visual for its next update pass. For tests only.

Source

pub fn is_disposed(&self) -> bool

Trait Implementations§

Source§

impl IHitTester for CompositingRenderer

Source§

fn hit_test( &self, p: Point, root: &Visual, filter: Option<&dyn Fn(&Visual) -> bool>, ) -> Vec<Ref<Visual>>

Hit tests a location to find the visuals at the specified point, topmost first. Read more
Source§

fn hit_test_geometry( &self, geometry: &Geometry, root: &Visual, filter: Option<&dyn Fn(&Visual) -> bool>, ) -> Vec<GeometryHitTestResult>

Hit tests a geometry to find the visuals intersecting a region, topmost first. Read more
Source§

fn hit_test_first( &self, p: Point, root: &Visual, filter: Option<&dyn Fn(&Visual) -> bool>, ) -> Option<Ref<Visual>>

Hit tests a location to find the first (topmost) visual at the specified point. Read more
Source§

fn hit_test_first_geometry( &self, geometry: &Geometry, root: &Visual, filter: Option<&dyn Fn(&Visual) -> bool>, ) -> Option<GeometryHitTestResult>

Hit tests a geometry to find the first (topmost) visual intersecting a region. Read more
Source§

impl IRenderer for CompositingRenderer

Source§

fn diagnostics(&self) -> Rc<RendererDiagnostics>

A value controlling the renderer’s diagnostics.
Source§

fn scene_invalidated( &self, handler: Rc<dyn Fn(&SceneInvalidatedEventArgs)>, ) -> Rc<dyn IDisposable>

Subscribes to the notification raised when a portion of the scene has been invalidated. Read more
Source§

fn add_dirty(&self, visual: &Visual)

Mark a visual as dirty and needing re-rendering.
Source§

fn recalculate_children(&self, visual: &Visual)

Informs the renderer that the z-ordering of a visual’s children has changed.
Source§

fn resized(&self, _size: Size)

Called when a resize notification is received by the control being rendered.
Source§

fn paint(&self, _rect: Rect)

Called when a paint notification is received by the control being rendered.
Source§

fn start(&self)

Starts the renderer.
Source§

fn stop(&self)

Stops the renderer.
Source§

fn try_get_render_interface_feature( &self, feature_type: TypeId, ) -> LocalFuture<Option<RenderInterfaceFeature>>

Attempts to query for a feature from the platform render interface: a future awaited on the thread of the renderer, which completes with the feature or None (see Compositor::try_get_render_interface_feature: asynchronous because the render interface may live on the render thread). The feature is an object of the server side: what is handed out lends it inside the compositor lock.
Source§

fn compositor(&self) -> Option<Rc<Compositor>>

The compositor of the renderer, if it renders through one (upstream: the IRendererWithCompositor interface).
Source§

fn dispose(&self)

Releases the renderer’s resources.

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.