aboutsummaryrefslogtreecommitdiff
path: root/src/capture/kms.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-06-14 02:05:54 +0200
committerdec05eba <dec05eba@protonmail.com>2024-06-14 02:05:54 +0200
commit3e2e2444d9fa65ae404604542689cf7829c99cfa (patch)
tree704adb5142d2c3e2dc74c0b0b46fb248cfa7e8a1 /src/capture/kms.c
parent5f24cd6de6be57da2f36aa047c50285625213b47 (diff)
Properly cut out cursor outside video area when dealing with hevc amd padding
Diffstat (limited to 'src/capture/kms.c')
-rw-r--r--src/capture/kms.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/capture/kms.c b/src/capture/kms.c
index e479019..2d1cea3 100644
--- a/src/capture/kms.c
+++ b/src/capture/kms.c
@@ -358,10 +358,15 @@ bool gsr_capture_kms_capture(gsr_capture_kms *self, AVFrame *frame, bool hdr, bo
self->base.egl->eglDestroyImage(self->base.egl->egl_display, cursor_image);
self->base.egl->glBindTexture(target, 0);
+ self->base.egl->glEnable(GL_SCISSOR_TEST);
+ self->base.egl->glScissor(target_x, target_y, self->capture_size.x, self->capture_size.y);
+
gsr_color_conversion_draw(&self->base.color_conversion, self->base.cursor_texture,
cursor_pos, cursor_size,
(vec2i){0, 0}, cursor_size,
texture_rotation, cursor_texture_is_external);
+
+ self->base.egl->glDisable(GL_SCISSOR_TEST);
}
self->base.egl->eglSwapBuffers(self->base.egl->egl_display, self->base.egl->egl_surface);