diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-09-16 22:19:09 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-09-16 23:31:53 +0200 |
commit | 25b7b4e84e00c3fd008f3b94146a3051a35029f2 (patch) | |
tree | 5a20e1bdc9dcde5e497be371bf5808eb9c862d21 /src/window_texture.c | |
parent | 4bcf976a71c3cb7660912b4e888a2197f81eb4b1 (diff) |
Pure vaapi capture (for capture target) and opengl composition for cursor only when capturing window and portal as well, clear background on resize for monitor capture
Diffstat (limited to 'src/window_texture.c')
-rw-r--r-- | src/window_texture.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/window_texture.c b/src/window_texture.c index 0f4aa2c..8eef4c9 100644 --- a/src/window_texture.c +++ b/src/window_texture.c @@ -16,6 +16,7 @@ int window_texture_init(WindowTexture *window_texture, Display *display, Window window_texture->display = display; window_texture->window = window; window_texture->pixmap = None; + window_texture->image = NULL; window_texture->texture_id = 0; window_texture->redirected = 0; window_texture->egl = egl; @@ -34,6 +35,11 @@ static void window_texture_cleanup(WindowTexture *self, int delete_texture) { self->texture_id = 0; } + if(self->image) { + self->egl->eglDestroyImage(self->egl->egl_display, self->image); + self->image = NULL; + } + if(self->pixmap) { XFreePixmap(self->display, self->pixmap); self->pixmap = None; @@ -101,14 +107,14 @@ int window_texture_on_resize(WindowTexture *self) { self->pixmap = pixmap; self->texture_id = texture_id; + self->image = image; cleanup: self->egl->glBindTexture(GL_TEXTURE_2D, 0); - if(image) - self->egl->eglDestroyImage(self->egl->egl_display, image); - if(result != 0) { + if(image) + self->egl->eglDestroyImage(self->egl->egl_display, image); if(texture_id != 0) self->egl->glDeleteTextures(1, &texture_id); if(pixmap) |