feat(wayland): dmabuf

This commit is contained in:
Nova
2022-12-07 14:30:48 -05:00
parent 48719c9862
commit 0dc9dc23e9
3 changed files with 59 additions and 19 deletions

22
src/wayland/dmabuf.rs Normal file
View File

@@ -0,0 +1,22 @@
use super::state::WaylandState;
use smithay::{
backend::allocator::dmabuf::Dmabuf,
delegate_dmabuf,
wayland::dmabuf::{self, DmabufGlobal, DmabufHandler, DmabufState},
};
impl DmabufHandler for WaylandState {
fn dmabuf_state(&mut self) -> &mut DmabufState {
&mut self.dmabuf_state
}
fn dmabuf_imported(
&mut self,
_global: &DmabufGlobal,
dmabuf: Dmabuf,
) -> Result<(), dmabuf::ImportError> {
self.pending_dmabufs.push(dmabuf);
Ok(())
}
}
delegate_dmabuf!(WaylandState);