cogl path: make sure marking the clip state dirty takes affect
authorRobert Bragg <robert@linux.intel.com>
Thu, 14 Jan 2010 18:11:57 +0000 (18:11 +0000)
committerChris Lord <chris@linux.intel.com>
Mon, 8 Feb 2010 13:35:45 +0000 (13:35 +0000)
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.

clutter/cogl/cogl/cogl-primitives.c

index 726ceba..419fc77 100644 (file)
@@ -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