cosmic-comp/src/wayland/handlers/dmabuf.rs

30 lines
729 B
Rust
Raw Normal View History

// SPDX-License-Identifier: GPL-3.0-only
use crate::state::State;
use smithay::{
backend::allocator::dmabuf::Dmabuf,
2022-07-04 16:00:29 +02:00
delegate_dmabuf,
wayland::dmabuf::{DmabufGlobal, DmabufHandler, DmabufState, ImportNotifier},
};
impl DmabufHandler for State {
fn dmabuf_state(&mut self) -> &mut DmabufState {
&mut self.common.dmabuf_state
}
2022-07-04 16:00:29 +02:00
fn dmabuf_imported(
&mut self,
global: &DmabufGlobal,
dmabuf: Dmabuf,
import_notifier: ImportNotifier,
) {
if self.backend.dmabuf_imported(global, dmabuf).is_err() {
import_notifier.failed();
} else {
let _ = import_notifier.successful::<State>();
}
}
}
delegate_dmabuf!(State);