summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2012-09-18 16:10:03 +0100
committerMatt Turner <mattst88@gmail.com>2012-10-05 15:03:56 -0700
commite1cb50b15dbb75d1ba0fe184d05be7d302b058ee (patch)
tree2f745354fcde1e97cfd4081af7b361d7b0626b57
parentc8fda5f44a02ab8c1c50a052edc6b189f34352ae (diff)
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@gmail.com> (cherry picked from commit 0a523a8820e8a2549ac1c7887eb1892b228af44b)
-rw-r--r--src/egl/drivers/dri2/platform_x11.c3
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 7486a91ec0c..939af86b67a 100644
--- a/src/egl/drivers/dri2/platform_x11.c
+++ b/src/egl/drivers/dri2/platform_x11.c
@@ -778,10 +778,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];
}