mirror of
https://github.com/brl/mutter.git
synced 2025-07-28 04:29:23 +00:00
Changes cogl_rectangle to take x1, y1, x2, y2 args not x1, y1, width, height
This makes it consistent with cogl_rectangle_with_{multi,}texture_coords. Notably the reason cogl_rectangle_with_{multi,}texture_coords wasn't changed instead is that the former approach lets you describe back facing rectangles. (though technically you could pass negative width/height values to achieve this; it doesn't seem as neat.)
This commit is contained in:
@@ -180,7 +180,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_w, bounds_h);
|
||||
cogl_rectangle (bounds_x, bounds_y,
|
||||
bounds_x + bounds_w, bounds_y + bounds_h);
|
||||
|
||||
GE( glStencilOp (GL_INVERT, GL_INVERT, GL_INVERT) );
|
||||
}
|
||||
@@ -206,8 +207,8 @@ _cogl_add_path_to_stencil_buffer (floatVec2 nodes_min,
|
||||
GE( glMatrixMode (GL_PROJECTION) );
|
||||
GE( glPushMatrix () );
|
||||
GE( glLoadIdentity () );
|
||||
cogl_rectangle (-1.0, -1.0, 2, 2);
|
||||
cogl_rectangle (-1.0, -1.0, 2, 2);
|
||||
cogl_rectangle (-1.0, -1.0, 1.0, 1.0);
|
||||
cogl_rectangle (-1.0, -1.0, 1.0, 1.0);
|
||||
GE( glPopMatrix () );
|
||||
GE( glMatrixMode (GL_MODELVIEW) );
|
||||
GE( glPopMatrix () );
|
||||
@@ -412,7 +413,8 @@ _cogl_path_fill_nodes ()
|
||||
CoglPathNode, 0),
|
||||
ctx->clip.stencil_used);
|
||||
|
||||
cogl_rectangle (bounds_x, bounds_y, bounds_w, bounds_h);
|
||||
cogl_rectangle (bounds_x, bounds_y,
|
||||
bounds_x + bounds_w, bounds_y + bounds_h);
|
||||
|
||||
/* The stencil buffer now contains garbage so the clip area needs to
|
||||
be rebuilt */
|
||||
|
@@ -404,7 +404,8 @@ _cogl_add_stencil_clip (float x_offset,
|
||||
GE( glStencilFunc (GL_NEVER, 0x1, 0x1) );
|
||||
GE( glStencilOp (GL_REPLACE, GL_REPLACE, GL_REPLACE) );
|
||||
|
||||
cogl_rectangle (x_offset, y_offset, width, height);
|
||||
cogl_rectangle (x_offset, y_offset,
|
||||
x_offset + width, y_offset + height);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -412,7 +413,8 @@ _cogl_add_stencil_clip (float x_offset,
|
||||
rectangle */
|
||||
GE( glStencilFunc (GL_NEVER, 0x1, 0x3) );
|
||||
GE( glStencilOp (GL_INCR, GL_INCR, GL_INCR) );
|
||||
cogl_rectangle (x_offset, y_offset, width, height);
|
||||
cogl_rectangle (x_offset, y_offset,
|
||||
x_offset + width, y_offset + height);
|
||||
|
||||
/* Subtract one from all pixels in the stencil buffer so that
|
||||
only pixels where both the original stencil buffer and the
|
||||
@@ -423,7 +425,7 @@ _cogl_add_stencil_clip (float x_offset,
|
||||
GE( glMatrixMode (GL_PROJECTION) );
|
||||
GE( glPushMatrix () );
|
||||
GE( glLoadIdentity () );
|
||||
cogl_rectangle (-1.0, -1.0, 2, 2);
|
||||
cogl_rectangle (-1.0, -1.0, 1.0, 1.0);
|
||||
GE( glPopMatrix () );
|
||||
GE( glMatrixMode (GL_MODELVIEW) );
|
||||
GE( glPopMatrix () );
|
||||
|
Reference in New Issue
Block a user