egl/wayland: Damage INT32_MAX x INT32_MAX region for eglSwapBuffers
authorKristian Høgsberg <krh@bitplanet.net>
Thu, 5 Dec 2013 00:13:35 +0000 (16:13 -0800)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 5 Dec 2013 00:13:42 +0000 (16:13 -0800)
If we're not using EGL_EXT_swap_buffers_with_damage, we have to
damage the full extent.  EGL operates on buffer coordinates, but
wl_surface.damage takes surface coordinates.  EGL doesn't know the
buffer transformation (rotated or scaled) and can't post accurate
damage in surface coordinates.  The damage event however is clipped to
the surface extents so we can just damage the maximum rectangle.

In case of EGL_EXT_swap_buffers_with_damage, the application knows
the buffer transform and is expected to pass in rectangles in
surface space.

https://bugs.freedesktop.org/show_bug.cgi?id=70250
Cc: "10.0" mesa-stable@lists.freedesktop.org
src/egl/drivers/dri2/platform_wayland.c

index b1ac4b779b193f3391a8fb0302ed0fba62bf705a..43e8f4b0c5a95408055d8bf03dcd1f2a01087d2d 100644 (file)
@@ -600,8 +600,8 @@ dri2_swap_buffers_with_damage(_EGLDriver *drv,
    dri2_surf->dy = 0;
 
    if (n_rects == 0) {
-      wl_surface_damage(dri2_surf->wl_win->surface, 0, 0,
-                        dri2_surf->base.Width, dri2_surf->base.Height);
+      wl_surface_damage(dri2_surf->wl_win->surface,
+                        0, 0, INT32_MAX, INT32_MAX);
    } else {
       for (i = 0; i < n_rects; i++) {
          const int *rect = &rects[i * 4];