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§
Sourcefn import_dmabuf(
&mut self,
dmabuf: &Dmabuf,
damage: Option<&[Rectangle<i32, BufferCoord>]>,
) -> Result<Self::TextureId, Self::Error>
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§
Sourcefn dmabuf_formats(&self) -> FormatSet
fn dmabuf_formats(&self) -> FormatSet
Returns supported formats for dmabufs.
Sourcefn has_dmabuf_format(&self, format: Format) -> bool
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§
impl ImportDma for GlesRenderer
renderer_gl
only.impl ImportDma for GlowRenderer
renderer_glow
only.impl ImportDma for PixmanRenderer
renderer_pixman
only.impl ImportDma for DummyRenderer
renderer_test
only.impl<R, T> ImportDma for MultiRenderer<'_, '_, R, T>where
<R::Device as ApiDevice>::Renderer: ImportDma + ImportMem + Bind<Dmabuf> + ExportMem,
<T::Device as ApiDevice>::Renderer: Bind<Dmabuf> + ExportMem + ImportDma + ImportMem,
<<R::Device as ApiDevice>::Renderer as ExportMem>::TextureMapping: 'static,
<<T::Device as ApiDevice>::Renderer as ExportMem>::TextureMapping: 'static,
T: 'static + GraphicsApi,
R: 'static + GraphicsApi,
<<R::Device as ApiDevice>::Renderer as RendererSuper>::TextureId: Clone + Send,
<<R::Device as ApiDevice>::Renderer as RendererSuper>::Error: 'static,
<<T::Device as ApiDevice>::Renderer as RendererSuper>::Error: 'static,
renderer_multi
only.