[Mesa-dev] [PATCH 3/3] egl/wayland: Implement EGL_EXT_swap_buffers_with_damage

Eric Anholt eric at anholt.net
Thu Apr 25 14:02:23 PDT 2013


Robert Bragg <robert at sixbynine.org> writes:
> @@ -491,8 +495,13 @@ dri2_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw)
>     dri2_surf->dx = 0;
>     dri2_surf->dy = 0;
>  
> -   wl_surface_damage(dri2_surf->wl_win->surface, 0, 0,
> -                     dri2_surf->base.Width, dri2_surf->base.Height);
> +   for (i = 0; i < n_rects; i++) {
> +      const int *rect = &rects[i * 4];
> +      wl_surface_damage(dri2_surf->wl_win->surface,
> +                        rect[0],
> +                        dri2_surf->base.Height - rect[1] - rect[3],
> +                        rect[2], rect[3]);
> +   }

It looks like this piece of the spec was missed:

        If <n_rects> is 0 then <rects> is ignored and the entire
        surface is implicitly damaged and the behaviour is equivalent
        to calling eglSwapBuffers.

If an obvious i == 0 case is added (and the rect in original
eglSwapBuffers() optionally dropped), this series is:

Reviewed-by: Eric Anholt <eric at anholt.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130425/f8ff1aab/attachment-0001.pgp>


More information about the mesa-dev mailing list