From b31f2dd4a2d6df62f1049cd8c57dea627193f0d4 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Thu, 14 Jan 2010 18:11:57 +0000 Subject: [PATCH] cogl path: make sure marking the clip state dirty takes affect When we trashed the contents of the stencil buffer during _cogl_path_fill_nodes we marked the clip stack state as dirty and expected the clip stack code would clean up our glStencilFunc state. The problem is that we only try and update the clip state during _cogl_journal_init (when we flush the framebuffer state) which is only called when the journal first gets something logged in it. To make sure the stencil state is cleaned up we now also flush the journal so _cogl_journal_init will be called for the next logged rectangle. --- cogl/cogl-primitives.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cogl/cogl-primitives.c b/cogl/cogl-primitives.c index 726cebaf4..419fc77fd 100644 --- a/cogl/cogl-primitives.c +++ b/cogl/cogl-primitives.c @@ -1496,7 +1496,14 @@ _cogl_path_fill_nodes (void) bounds_x + bounds_w, bounds_y + bounds_h); /* The stencil buffer now contains garbage so the clip area needs to - be rebuilt */ + * be rebuilt. + * + * NB: We only ever try and update the clip state during + * _cogl_journal_init (when we flush the framebuffer state) which is + * only called when the journal first gets something logged in it; so + * we call cogl_flush() to emtpy the journal. + */ + cogl_flush (); _cogl_clip_stack_state_dirty (clip_state); } else