From 7b7787b050a1dd245dea396335ddf96662c6a570 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Mon, 22 Jun 2009 00:05:02 +0100 Subject: [PATCH] [cogl] avoid using the journal in _cogl_add_path_to_stencil_buffer Using cogl_rectangle (and thus the journal) in _cogl_add_path_to_stencil_buffer means we have to consider all the state that the journal may change in case it may interfer with the direct GL calls used. This has proven to be error prone and in this case the journal is an unnecissary overhead. We now simply call glRectf instead of using cogl_rectangle. --- clutter/cogl/gl/cogl-primitives.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/clutter/cogl/gl/cogl-primitives.c b/clutter/cogl/gl/cogl-primitives.c index 30b5553f7..35de5b684 100644 --- a/clutter/cogl/gl/cogl-primitives.c +++ b/clutter/cogl/gl/cogl-primitives.c @@ -169,12 +169,10 @@ _cogl_add_path_to_stencil_buffer (floatVec2 nodes_min, GE( glColorMask (FALSE, FALSE, FALSE, FALSE) ); GE( glDepthMask (FALSE) ); + _cogl_current_matrix_state_flush (); + while (path_start < path_size) { - /* NB: after calling _cogl_journal_flush the current matrix - * state is undefined */ - _cogl_current_matrix_state_flush (); - GE( glVertexPointer (2, GL_FLOAT, sizeof (CoglPathNode), (guchar *) path + G_STRUCT_OFFSET (CoglPathNode, x)) ); @@ -186,9 +184,8 @@ _cogl_add_path_to_stencil_buffer (floatVec2 nodes_min, significant bit */ GE( glStencilMask (merge ? 6 : 3) ); GE( glStencilOp (GL_ZERO, GL_REPLACE, GL_REPLACE) ); - cogl_rectangle (bounds_x, bounds_y, - bounds_x + bounds_w, bounds_y + bounds_h); - _cogl_journal_flush (); + glRectf (bounds_x, bounds_y, + bounds_x + bounds_w, bounds_y + bounds_h); GE( glStencilOp (GL_INVERT, GL_INVERT, GL_INVERT) ); } @@ -221,9 +218,8 @@ _cogl_add_path_to_stencil_buffer (floatVec2 nodes_min, _cogl_current_matrix_push (); _cogl_current_matrix_identity (); - cogl_rectangle (-1.0, -1.0, 1.0, 1.0); - cogl_rectangle (-1.0, -1.0, 1.0, 1.0); - _cogl_journal_flush (); + glRectf (-1.0, -1.0, 1.0, 1.0); + glRectf (-1.0, -1.0, 1.0, 1.0); _cogl_current_matrix_pop ();