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§
Sourcefn diagnostics(&self) -> Rc<RendererDiagnostics>
fn diagnostics(&self) -> Rc<RendererDiagnostics>
A value controlling the renderer’s diagnostics.
Sourcefn scene_invalidated(
&self,
handler: Rc<dyn Fn(&SceneInvalidatedEventArgs)>,
) -> Rc<dyn IDisposable>
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.
Sourcefn recalculate_children(&self, visual: &Visual)
fn recalculate_children(&self, visual: &Visual)
Informs the renderer that the z-ordering of a visual’s children has changed.
Sourcefn resized(&self, size: Size)
fn resized(&self, size: Size)
Called when a resize notification is received by the control being rendered.
Sourcefn paint(&self, rect: Rect)
fn paint(&self, rect: Rect)
Called when a paint notification is received by the control being rendered.
Sourcefn try_get_render_interface_feature(
&self,
feature_type: TypeId,
) -> LocalFuture<Option<RenderInterfaceFeature>>
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.
Provided Methods§
Sourcefn compositor(&self) -> Option<Rc<Compositor>>
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".