Skip to main content

IRenderer

Trait IRenderer 

Source
pub trait IRenderer {
    // Required methods
    fn diagnostics(&self) -> Rc<RendererDiagnostics>;
    fn scene_invalidated(
        &self,
        handler: Rc<dyn Fn(&SceneInvalidatedEventArgs)>,
    ) -> Rc<dyn IDisposable>;
    fn add_dirty(&self, visual: &Visual);
    fn recalculate_children(&self, visual: &Visual);
    fn resized(&self, size: Size);
    fn paint(&self, rect: Rect);
    fn start(&self);
    fn stop(&self);
    fn try_get_render_interface_feature(
        &self,
        feature_type: TypeId,
    ) -> LocalFuture<Option<RenderInterfaceFeature>>;
    fn dispose(&self);

    // Provided method
    fn compositor(&self) -> Option<Rc<Compositor>> { ... }
}
Expand description

Defines the interface for a renderer.

Required Methods§

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.

Indicates that the underlying low-level scene information has been updated. Used to signal that an update to the current pointer-over state may be required.

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 dispose(&self)

Releases the renderer’s resources.

Provided Methods§

Source

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

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

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§