1
0
Fork 0
forked from wry/wry

autocommit 2022-04-15 20:23:03 CEST

This commit is contained in:
Julian Orth 2022-04-15 20:23:03 +02:00
parent 5f13954dbc
commit fdf0ab7388
17 changed files with 159 additions and 87 deletions

View file

@ -102,11 +102,12 @@ impl WlBuffer {
match &self.storage {
WlBufferStorage::Shm { mem, stride } => {
self.texture.set(None);
let ctx = self.client.state.render_ctx.get().unwrap();
let tex = mem.access(|mem| {
ctx.shmem_texture(mem, self.format, self.width, self.height, *stride)
})??;
self.texture.set(Some(tex));
if let Some(ctx) = self.client.state.render_ctx.get() {
let tex = mem.access(|mem| {
ctx.shmem_texture(mem, self.format, self.width, self.height, *stride)
})??;
self.texture.set(Some(tex));
}
}
WlBufferStorage::Dmabuf(img) => {
if self.texture.get().is_none() {