Retain surface textures for animations
This commit is contained in:
parent
3540cdc4be
commit
fba9d65ba1
8 changed files with 365 additions and 19 deletions
|
|
@ -310,6 +310,19 @@ impl WlBuffer {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn get_stable_texture(&self) -> Option<Rc<dyn GfxTexture>> {
|
||||
match &*self.storage.borrow() {
|
||||
None => None,
|
||||
Some(s) => match s {
|
||||
WlBufferStorage::Shm {
|
||||
dmabuf_buffer_params,
|
||||
..
|
||||
} => dmabuf_buffer_params.tex.clone(),
|
||||
WlBufferStorage::Dmabuf { tex, .. } => tex.clone(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
pub fn update_texture_or_log(&self, surface: &WlSurface, sync_shm: bool) {
|
||||
if let Err(e) = self.update_texture(surface, sync_shm) {
|
||||
log::warn!("Could not update texture: {}", ErrorFmt(e));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue