[Mesa-dev] Mesa (master): SwapBuffersRegionNOK: invert rectangles on y axis
Ian Romanick
idr at freedesktop.org
Fri Oct 5 14:24:24 PDT 2012
On 10/02/2012 02:47 PM, Matt Turner wrote:
> Module: Mesa
> Branch: master
> Commit: 0a523a8820e8a2549ac1c7887eb1892b228af44b
> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0a523a8820e8a2549ac1c7887eb1892b228af44b
>
> Author: Robert Bragg <robert at linux.intel.com>
> Date: Tue Sep 18 16:10:03 2012 +0100
>
> SwapBuffersRegionNOK: invert rectangles on y axis
>
> The EGL_NOK_swap_region2 spec states that the rectangles are specified
> with a bottom-left origin within a surface coordinate space also with a
> bottom left origin, so this patch ensures the rectangles are flipped
> before passing them on to dri2_copy_region.
>
> Fixes piglit's egl-nok-swap-region test.
>
> Tested-by: Matt Turner <mattst88 at gmail.com>
Should this be included in stable branches as well?
> ---
>
> src/egl/drivers/dri2/platform_x11.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
> index 2533774..44e4373 100644
> --- a/src/egl/drivers/dri2/platform_x11.c
> +++ b/src/egl/drivers/dri2/platform_x11.c
> @@ -777,10 +777,9 @@ dri2_swap_buffers_region(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
> if (numRects > (int)ARRAY_SIZE(rectangles))
> return dri2_copy_region(drv, disp, draw, dri2_surf->region);
>
> - /* FIXME: Invert y here? */
> for (i = 0; i < numRects; i++) {
> rectangles[i].x = rects[i * 4];
> - rectangles[i].y = rects[i * 4 + 1];
> + rectangles[i].y = dri2_surf->base.Height - rects[i * 4 + 1] - rects[i * 4 + 3];
> rectangles[i].width = rects[i * 4 + 2];
> rectangles[i].height = rects[i * 4 + 3];
> }
>
> _______________________________________________
> mesa-commit mailing list
> mesa-commit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-commit
>
More information about the mesa-dev
mailing list