waylandsink: Use G_MAXINT32 for surface damage
authorRobert Mader <robert.mader@collabora.com>
Mon, 13 Dec 2021 11:21:06 +0000 (12:21 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 13 Jan 2022 19:39:59 +0000 (19:39 +0000)
Each time we call `wl_surface_damage()` we want to do full surface
damage. Like Mesa, just use `G_MAXINT32` to ensure we always do
full damage, reducing the need to track the right dimensions.

`window->video_rectangle` is now unused, but we keep it around for
now as we may need it again in the future.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1446>

subprojects/gst-plugins-bad/ext/wayland/wlwindow.c

index 34b7b17..152b94e 100644 (file)
@@ -412,7 +412,6 @@ gst_wl_window_resize_video_surface (GstWlWindow * window, gboolean commit)
   if (commit)
     wl_surface_commit (window->video_surface_wrapper);
 
-  /* this is saved for use in wl_surface_damage */
   window->video_rectangle = res;
 }
 
@@ -452,8 +451,8 @@ gst_wl_window_render (GstWlWindow * window, GstWlBuffer * buffer,
 
   if (G_LIKELY (buffer)) {
     gst_wl_buffer_attach (buffer, window->video_surface_wrapper);
-    wl_surface_damage (window->video_surface_wrapper, 0, 0,
-        window->video_rectangle.w, window->video_rectangle.h);
+    wl_surface_damage (window->video_surface_wrapper, 0, 0, G_MAXINT32,
+        G_MAXINT32);
     wl_surface_commit (window->video_surface_wrapper);
   } else {
     /* clear both video and parent surfaces */
@@ -513,7 +512,8 @@ gst_wl_window_update_borders (GstWlWindow * window)
       window->display, &info);
   gwlbuf = gst_buffer_add_wl_buffer (buf, wlbuf, window->display);
   gst_wl_buffer_attach (gwlbuf, window->area_surface_wrapper);
-  wl_surface_damage (window->area_surface_wrapper, 0, 0, width, height);
+  wl_surface_damage (window->area_surface_wrapper, 0, 0, G_MAXINT32,
+      G_MAXINT32);
 
   /* at this point, the GstWlBuffer keeps the buffer
    * alive and will free it on wl_buffer::release */