waylandsink: Use G_MAXINT32 for surface damage

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>
This commit is contained in:
Robert Mader 2021-12-13 12:21:06 +01:00 committed by GStreamer Marge Bot
parent 3bbd091bb4
commit 1249362f96

View file

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