smithay::backend::renderer

Trait Renderer

Source
pub trait Renderer {
    type Error: Error;
    type TextureId: Texture;
    type Frame: Frame<Error = Self::Error, TextureId = Self::TextureId>;

    // Required method
    fn render<F, R>(
        &mut self,
        size: Size<i32, Physical>,
        transform: Transform,
        rendering: F,
    ) -> Result<R, Self::Error>
       where F: FnOnce(&mut Self, &mut Self::Frame) -> R;
}
Expand description

Abstraction of commonly used rendering operations for compositors.

Required Associated Types§

Source

type Error: Error

Error type returned by the rendering operations of this renderer.

Source

type TextureId: Texture

Texture Handle type used by this renderer.

Source

type Frame: Frame<Error = Self::Error, TextureId = Self::TextureId>

Type representing a currently in-progress frame during the Renderer::render-call

Required Methods§

Source

fn render<F, R>( &mut self, size: Size<i32, Physical>, transform: Transform, rendering: F, ) -> Result<R, Self::Error>
where F: FnOnce(&mut Self, &mut Self::Frame) -> R,

Initialize a rendering context on the current rendering target with given dimensions and transformation.

This function may error, if:

  • The given dimensions are unsupported (too large) for this renderer
  • The given Transformation is not supported by the renderer (Transform::Normal is always supported).
  • This renderer implements Bind, no target was bound and has no default target.
  • (Renderers not implementing Bind always have a default target.)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§