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
This commit is contained in:
Emmanuele Bassi 2010-05-26 16:32:23 +01:00 committed by Robert Bragg
parent 7a7dedebd5
commit 2ba6ab6dbc

View File

@ -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...
*/