[Cogl] [PATCH] egl-winsys: eglSwapBuffersRegion expects coordinates relative to top-left

Tomeu Vizoso tomeu at tomeuvizoso.net
Tue Sep 18 05:42:03 PDT 2012


We were inverting previously the rects, probably mislead by
glXCopySubBuffer.
---
 cogl/winsys/cogl-winsys-egl.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/cogl/winsys/cogl-winsys-egl.c b/cogl/winsys/cogl-winsys-egl.c
index dcd17ed..e456f50 100644
--- a/cogl/winsys/cogl-winsys-egl.c
+++ b/cogl/winsys/cogl-winsys-egl.c
@@ -678,27 +678,13 @@ _cogl_winsys_onscreen_bind (CoglOnscreen *onscreen)
 
 static void
 _cogl_winsys_onscreen_swap_region (CoglOnscreen *onscreen,
-                                   const int *user_rectangles,
+                                   const int *rectangles,
                                    int n_rectangles)
 {
   CoglContext *context = COGL_FRAMEBUFFER (onscreen)->context;
   CoglRenderer *renderer = context->display->renderer;
   CoglRendererEGL *egl_renderer = renderer->winsys;
   CoglOnscreenEGL *egl_onscreen = onscreen->winsys;
-  CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
-  int framebuffer_height  = cogl_framebuffer_get_height (framebuffer);
-  int *rectangles = g_alloca (sizeof (int) * n_rectangles * 4);
-  int i;
-
-  /* eglSwapBuffersRegion expects rectangles relative to the
-   * bottom left corner but we are given rectangles relative to
-   * the top left so we need to flip them... */
-  memcpy (rectangles, user_rectangles, sizeof (int) * n_rectangles * 4);
-  for (i = 0; i < n_rectangles; i++)
-    {
-      int *rect = &rectangles[4 * i];
-      rect[1] = framebuffer_height - rect[1] - rect[3];
-    }
 
   /* At least for eglSwapBuffers the EGL spec says that the surface to
      swap must be bound to the current context. It looks like Mesa
-- 
1.7.11.4



More information about the Cogl mailing list