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

Martin Robinson mrobinson at kemper.freedesktop.org
Mon May 6 11:19:43 PDT 2013


 src/cairo-gl-device.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit e83943ec9a06f20572e22105f4e6e44740893eb9
Author: Martin Robinson <mrobinson at igalia.com>
Date:   Mon May 6 10:56:26 2013 -0700

    gl: Bind the default framebuffer before calling gl{Read|Draw}Buffer
    
    Fix more fallout from separating framebuffer binding from setting the
    destination. In some cases it is sufficient to call
    glDrawBuffer/glReadBuffer before binding the framebuffer, but the
    masking-filling-stroking test of cairo-gl-smoke-tests fails if the order
    is incorrect.

diff --git a/src/cairo-gl-device.c b/src/cairo-gl-device.c
index 942eb2a..0166c10 100644
--- a/src/cairo-gl-device.c
+++ b/src/cairo-gl-device.c
@@ -733,15 +733,17 @@ _cairo_gl_context_set_destination (cairo_gl_context_t *ctx,
 
     if (! _cairo_gl_surface_is_texture (surface)) {
 	ctx->make_current (ctx, surface);
+    }
+
+    _cairo_gl_context_bind_framebuffer (ctx, surface, multisampling);
 
+    if (! _cairo_gl_surface_is_texture (surface)) {
 #if CAIRO_HAS_GL_SURFACE
 	glDrawBuffer (GL_BACK_LEFT);
 	glReadBuffer (GL_BACK_LEFT);
 #endif
     }
 
-    _cairo_gl_context_bind_framebuffer (ctx, surface, multisampling);
-
     glDisable (GL_DITHER);
     glViewport (0, 0, surface->width, surface->height);
 


More information about the cairo-commit mailing list