Trait ImportDma

Source
pub trait ImportDma: Renderer {
    // Required method
    fn import_dmabuf(
        &mut self,
        dmabuf: &Dmabuf,
        damage: Option<&[Rectangle<i32, BufferCoord>]>,
    ) -> Result<Self::TextureId, Self::Error>;

    // Provided methods
    fn dmabuf_formats(&self) -> FormatSet { ... }
    fn has_dmabuf_format(&self, format: Format) -> bool { ... }
}
Expand description

Trait for Renderers supporting importing dmabufs.

Required Methods§

Source

fn import_dmabuf( &mut self, dmabuf: &Dmabuf, damage: Option<&[Rectangle<i32, BufferCoord>]>, ) -> Result<Self::TextureId, Self::Error>

Import a given raw dmabuf into the renderer.

Returns a texture_id, which can be used with Frame::render_texture_from_to (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.

Provided Methods§

Source

fn dmabuf_formats(&self) -> FormatSet

Returns supported formats for dmabufs.

Source

fn has_dmabuf_format(&self, format: Format) -> bool

Test if a specific dmabuf Format is supported

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§

Source§

impl ImportDma for GlesRenderer

Available on crate feature renderer_gl only.
Source§

impl ImportDma for GlowRenderer

Available on crate feature renderer_glow only.
Source§

impl ImportDma for PixmanRenderer

Available on crate feature renderer_pixman only.
Source§

impl ImportDma for DummyRenderer

Available on crate feature renderer_test only.
Source§

impl<R, T> ImportDma for MultiRenderer<'_, '_, R, T>

Available on crate feature renderer_multi only.