From e83943ec9a06f20572e22105f4e6e44740893eb9 Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Mon, 6 May 2013 10:56:26 -0700 Subject: 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. --- src/cairo-gl-device.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cairo-gl-device.c b/src/cairo-gl-device.c index 942eb2af..0166c101 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); -- cgit v1.2.3