From 4090f0eb6ffe850e70196ca0f2388911ccc6994f Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Wed, 25 May 2022 15:25:52 +0200 Subject: [PATCH] clients/simple-egl: Use INT32_MAX for opaque region Setting the opaque region correctly is common source of error for clients that simply want to express that a whole surface is opaque. This is especially true once buffer_scale and buffer_transform come into play, as unlike for damage, where buffer_damage is the encouraged and user friendly way today, opaque regions are always in logical coordinates. As faulty opaque regions don't have a visual impact in these cases but only increase resource consumption, these errors often remain for long times. See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/1e2bc681712d62081f49e8e74723a596d1578a34 for one of many examples. Give an easy example how to set the opaque region in a conformant and reliable way. Signed-off-by: Robert Mader --- clients/simple-egl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/clients/simple-egl.c b/clients/simple-egl.c index 3d5e9226..53055cc0 100644 --- a/clients/simple-egl.c +++ b/clients/simple-egl.c @@ -497,9 +497,7 @@ redraw(struct window *window) if (window->opaque || window->fullscreen) { region = wl_compositor_create_region(window->display->compositor); - wl_region_add(region, 0, 0, - window->geometry.width, - window->geometry.height); + wl_region_add(region, 0, 0, INT32_MAX, INT32_MAX); wl_surface_set_opaque_region(window->surface, region); wl_region_destroy(region); } else {