[cairo-commit] src/cairo-gl-surface.c

Eric Anholt anholt at kemper.freedesktop.org
Fri Jan 29 13:04:01 PST 2010


 src/cairo-gl-surface.c |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 8558cd579059974758bda696c33f08399267d33e
Author: Eric Anholt <eric at anholt.net>
Date:   Thu Jan 28 17:39:34 2010 -0800

    [gl] Use GL_MESA_pack_invert to flip get_image of windows around.
    
    This doesn't have any fallback for a GL that fails to implement the
    extension.  Fixes 120 testcases for gl-window.

diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c
index 338f496..df0cb14 100644
--- a/src/cairo-gl-surface.c
+++ b/src/cairo-gl-surface.c
@@ -759,9 +759,13 @@ _cairo_gl_surface_get_image (cairo_gl_surface_t      *surface,
 
     glPixelStorei (GL_PACK_ALIGNMENT, 1);
     glPixelStorei (GL_PACK_ROW_LENGTH, image->stride / cpp);
+    if (surface->fb == 0 && GLEW_MESA_pack_invert)
+	glPixelStorei (GL_PACK_INVERT_MESA, 1);
     glReadPixels (interest->x, interest->y,
 		  interest->width, interest->height,
 		  format, type, image->data);
+    if (surface->fb == 0 && GLEW_MESA_pack_invert)
+	glPixelStorei (GL_PACK_INVERT_MESA, 0);
 
     while ((err = glGetError ()))
 	fprintf (stderr, "GL error 0x%08x\n", (int) err);


More information about the cairo-commit mailing list