1
0
Fork 0
forked from wry/wry

Retain surface textures for animations

This commit is contained in:
atagen 2026-05-21 15:45:32 +10:00
parent 3540cdc4be
commit fba9d65ba1
8 changed files with 365 additions and 19 deletions

View file

@ -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));