From 2ba6ab6dbc34e04b069fb0c88ed8d392a48a7b91 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 26 May 2010 16:32:23 +0100 Subject: [PATCH] cogl: Initialize the framebuffer bits on state flush The place where we actually change the framebuffer is _cogl_framebuffer_flush_state(), so if we changed to a new frame buffer we need to initialize the color bits there. http://bugzilla.openedhand.com/show_bug.cgi?id=2094 --- cogl/cogl-framebuffer.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c index 07b437c04..032bf2209 100644 --- a/cogl/cogl-framebuffer.c +++ b/cogl/cogl-framebuffer.c @@ -641,8 +641,6 @@ _cogl_set_framebuffer_real (CoglFramebuffer *framebuffer) _cogl_matrix_stack_dirty (framebuffer->modelview_stack); _cogl_matrix_stack_dirty (framebuffer->projection_stack); _cogl_clip_state_dirty (&framebuffer->clip_state); - - _cogl_framebuffer_init_bits (framebuffer); } void @@ -785,6 +783,11 @@ _cogl_framebuffer_flush_state (CoglHandle handle, ctx->dirty_gl_viewport = FALSE; } + /* since we might have changed the framebuffer, we should initialize + * the bits; this is a no-op if they have already been initialized + */ + _cogl_framebuffer_init_bits (framebuffer); + /* XXX: Flushing clip state may trash the modelview and projection * matrices so we must do it before flushing the matrices... */