[cairo] [PATCH 4/6] [gl] Clear the current_target cache when binding a framebuffer in creation.

Eric Anholt eric at anholt.net
Wed Jan 13 16:08:07 PST 2010


Failing to do so meant that we might not re-bind the framebuffer to
the correct one if we didn't follow up surface creation with drawing
to it.

Fixes many testcases.  Thanks to T. Zachary Laine for tracking down
that the current_target was the source of these issues.
---
 src/cairo-gl-surface.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c
index 9a3faf3..af658cb 100644
--- a/src/cairo-gl-surface.c
+++ b/src/cairo-gl-surface.c
@@ -503,6 +503,7 @@ _cairo_gl_surface_create_scratch (cairo_gl_context_t   *ctx,
 			       GL_TEXTURE_2D,
 			       surface->tex,
 			       0);
+    ctx->current_target = NULL;
 
     while ((err = glGetError ())) {
 	fprintf (stderr, "GL error in surface create: 0x%08x\n", err);
-- 
1.6.5.7



More information about the cairo mailing list