diff options
author | Robert Bragg <robert@linux.intel.com> | 2011-07-29 16:31:04 +0100 |
---|---|---|
committer | Robert Bragg <robert@linux.intel.com> | 2012-01-16 13:45:27 +0000 |
commit | 8e3bd812d9b03f752a52327974a1035ee692016c (patch) | |
tree | a1ee957105866e8dce700fbcc8d41e3e6da5aca1 | |
parent | 11e603cf005705117876120b456fa1b8ce847c46 (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.
-rw-r--r-- | 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 a100f4d284..08325d3328 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]; } |