Skip to main content

IPlatformRenderInterfaceContext

Trait IPlatformRenderInterfaceContext 

Source
pub trait IPlatformRenderInterfaceContext: IOptionalFeatureProvider {
    // Required methods
    fn create_render_target(
        &self,
        surfaces: &[Arc<dyn IPlatformRenderSurface>],
    ) -> Rc<dyn IRenderTarget>;
    fn create_offscreen_render_target(
        &self,
        pixel_size: PixelSize,
        scaling: Vector,
        enable_text_antialiasing: bool,
    ) -> Rc<dyn IDrawingContextLayerImpl>;
    fn is_lost(&self) -> bool;
    fn max_offscreen_render_target_pixel_size(&self) -> Option<PixelSize>;
    fn dispose(&self);

    // Provided methods
    fn public_features(&self) -> HashMap<TypeId, Rc<dyn Any>> { ... }
    fn is_ready_to_create_render_target(
        &self,
        _surfaces: &[Arc<dyn IPlatformRenderSurface>],
    ) -> bool { ... }
}
Expand description

A render backend bound to a graphics context (or to software rendering).

Required Methods§

Source

fn create_render_target( &self, surfaces: &[Arc<dyn IPlatformRenderSurface>], ) -> Rc<dyn IRenderTarget>

Creates a render target for one of the given surfaces.

Source

fn create_offscreen_render_target( &self, pixel_size: PixelSize, scaling: Vector, enable_text_antialiasing: bool, ) -> Rc<dyn IDrawingContextLayerImpl>

Creates an offscreen render target.

Source

fn is_lost(&self) -> bool

Whether the context is lost and must be recreated.

Source

fn max_offscreen_render_target_pixel_size(&self) -> Option<PixelSize>

The largest offscreen render target the context can create, if limited.

Source

fn dispose(&self)

Releases the context.

Provided Methods§

Source

fn public_features(&self) -> HashMap<TypeId, Rc<dyn Any>>

The features of the context that are exposed to user code, by type.

Source

fn is_ready_to_create_render_target( &self, _surfaces: &[Arc<dyn IPlatformRenderSurface>], ) -> bool

Whether a render target can be created for the surfaces right now.

Trait Implementations§

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§