Trait smithay::backend::renderer::ImportAll[][src]

pub trait ImportAll: Renderer {
    fn import_buffer(
        &mut self,
        buffer: &WlBuffer,
        surface: Option<&SurfaceData>,
        damage: &[Rectangle<i32, Buffer>]
    ) -> Option<Result<<Self as Renderer>::TextureId, <Self as Renderer>::Error>>; }
Expand description

Common trait for renderers of any wayland buffer type

Required methods

Import a given buffer into the renderer.

Returns a texture_id, which can be used with Frame::render_texture (or Frame::render_texture_at) or implementation-specific functions.

If not otherwise defined by the implementation, this texture id is only valid for the renderer, that created it.

This operation needs no bound or default rendering target.

The implementation defines, if the id keeps being valid, if the buffer is released, to avoid relying on implementation details, keep the buffer alive, until you destroyed this texture again.

If provided the SurfaceAttributes can be used to do caching of rendering resources and is generally recommended.

The damage argument provides a list of rectangle locating parts of the buffer that need to be updated. When provided with an empty list &[], the renderer is allowed to not update the texture at all.

Returns None, if the buffer type cannot be determined.

Implementors