1
0
Fork 0

[Cogl] cogl_clip_{set*,unset} renamed to cogl_clip_{push*,pop}

This is so they self document the stacking semantics of the cogl clip API
This commit is contained in:
Robert Bragg 2009-02-12 11:08:00 +00:00
parent 57ffcdf014
commit 2b5a72dde5
7 changed files with 47 additions and 44 deletions

3
README
View file

@ -276,6 +276,9 @@ Release Notes for Clutter 1.0
* cogl_scale now supports scaling on the z axis
* cogl_clip_set* and cogl_clip_unset have been renamed to cogl_clip_push and
cogl_clip_pop respectively so they self document their stacking semantics.
Release Notes for Clutter 0.8
-------------------------------

View file

@ -1548,7 +1548,7 @@ clutter_actor_paint (ClutterActor *self)
if (priv->has_clip)
{
cogl_clip_set (CLUTTER_UNITS_TO_FIXED (priv->clip[0]),
cogl_clip_push (CLUTTER_UNITS_TO_FIXED (priv->clip[0]),
CLUTTER_UNITS_TO_FIXED (priv->clip[1]),
CLUTTER_UNITS_TO_FIXED (priv->clip[2]),
CLUTTER_UNITS_TO_FIXED (priv->clip[3]));
@ -1578,7 +1578,7 @@ clutter_actor_paint (ClutterActor *self)
}
if (clip_set)
cogl_clip_unset();
cogl_clip_pop();
cogl_pop_matrix();

View file

@ -1066,7 +1066,7 @@ clutter_text_paint (ClutterActor *self)
pango_layout_get_extents (layout, NULL, &logical_rect);
cogl_clip_set (0, 0,
cogl_clip_push (0, 0,
CLUTTER_UNITS_TO_FIXED (alloc.x2 - alloc.x1),
CLUTTER_UNITS_TO_FIXED (alloc.y2 - alloc.y1));
clip_set = TRUE;
@ -1126,7 +1126,7 @@ clutter_text_paint (ClutterActor *self)
cogl_pango_render_layout (layout, text_x, 0, &color, 0);
if (clip_set)
cogl_clip_unset ();
cogl_clip_pop ();
priv->text_x = text_x;
}

View file

@ -296,7 +296,7 @@ void cogl_get_projection_matrix (float m[16]);
void cogl_get_viewport (float v[4]);
/**
* cogl_clip_set:
* cogl_clip_push:
* @x_offset: left edge of the clip rectangle
* @y_offset: top edge of the clip rectangle
* @width: width of the clip rectangle
@ -309,44 +309,44 @@ void cogl_get_viewport (float v[4]);
* current model-view matrix.
*
* The rectangle is intersected with the current clip region. To undo
* the effect of this function, call cogl_clip_unset().
* the effect of this function, call cogl_clip_pop().
*/
void cogl_clip_set (float x_offset,
void cogl_clip_push (float x_offset,
float y_offset,
float width,
float height);
/**
* cogl_clip_set_from_path:
* cogl_clip_push_from_path:
*
* Sets a new clipping area using the current path. The current path
* is then cleared. The clipping area is intersected with the previous
* clipping area. To restore the previous clipping area, call
* cogl_clip_unset().
* cogl_clip_pop().
*
* Since: 1.0
*/
void cogl_clip_set_from_path (void);
void cogl_clip_push_from_path (void);
/**
* cogl_clip_set_from_path_preserve:
* cogl_clip_push_from_path_preserve:
*
* Sets a new clipping area using the current path. The current path
* is then cleared. The clipping area is intersected with the previous
* clipping area. To restore the previous clipping area, call
* cogl_clip_unset().
* cogl_clip_pop().
*
* Since: 1.0
*/
void cogl_clip_set_from_path_preserve (void);
void cogl_clip_push_from_path_preserve (void);
/**
* cogl_clip_unset:
* cogl_clip_pop:
*
* Reverts the clipping region to the state before the last call to
* cogl_clip_set().
* cogl_clip_push().
*/
void cogl_clip_unset (void);
void cogl_clip_pop (void);
/**
* cogl_clip_ensure:
@ -365,8 +365,8 @@ void cogl_clip_ensure (void);
*
* Save the entire state of the clipping stack and then clear all
* clipping. The previous state can be returned to with
* cogl_clip_stack_restore(). Each call to cogl_clip_set() after this
* must be matched by a call to cogl_clip_unset() before calling
* cogl_clip_stack_restore(). Each call to cogl_clip_push() after this
* must be matched by a call to cogl_clip_pop() before calling
* cogl_clip_stack_restore().
*
* Since: 0.8.2

View file

@ -99,7 +99,7 @@ struct _CoglClipStackEntryPath
};
void
cogl_clip_set (float x_offset,
cogl_clip_push (float x_offset,
float y_offset,
float width,
float height)
@ -129,7 +129,7 @@ cogl_clip_set (float x_offset,
}
void
cogl_clip_set_from_path_preserve (void)
cogl_clip_push_from_path_preserve (void)
{
CoglClipStackEntryPath *entry;
CoglClipStack *stack;
@ -157,15 +157,15 @@ cogl_clip_set_from_path_preserve (void)
}
void
cogl_clip_set_from_path (void)
cogl_clip_push_from_path (void)
{
cogl_clip_set_from_path_preserve ();
cogl_clip_push_from_path_preserve ();
cogl_path_new ();
}
void
cogl_clip_unset (void)
cogl_clip_pop (void)
{
gpointer entry;
CoglClipStack *stack;
@ -319,7 +319,7 @@ cogl_clip_stack_restore (void)
/* Empty the current stack */
while (stack->stack_top)
cogl_clip_unset ();
cogl_clip_pop ();
/* Revert to an old stack */
g_slice_free (CoglClipStack, stack);

View file

@ -42,10 +42,10 @@ cogl_get_bitmasks
cogl_paint_init
<SUBSECTION>
CoglClipStackState
cogl_clip_set
cogl_clip_set_from_path
cogl_clip_set_from_path_preserve
cogl_clip_unset
cogl_clip_push
cogl_clip_push_from_path
cogl_clip_push_from_path_preserve
cogl_clip_pop
cogl_clip_stack_save
cogl_clip_stack_restore
cogl_clip_ensure

View file

@ -136,14 +136,14 @@ on_paint (ClutterActor *actor, CallbackData *data)
Clip *clip = (Clip *) node->data;
if (clip->type == CLIP_RECTANGLE)
cogl_clip_set (CLUTTER_INT_TO_FIXED (clip->x1),
cogl_clip_push (CLUTTER_INT_TO_FIXED (clip->x1),
CLUTTER_INT_TO_FIXED (clip->y1),
CLUTTER_INT_TO_FIXED (clip->x2 - clip->x1),
CLUTTER_INT_TO_FIXED (clip->y2 - clip->y1));
else
{
make_clip_path (clip);
cogl_clip_set_from_path ();
cogl_clip_push_from_path ();
}
}
@ -178,7 +178,7 @@ on_paint (ClutterActor *actor, CallbackData *data)
draw_shapes (stage_size.width - 310, stage_size.height - 110);
/* Remove all of the clipping */
g_slist_foreach (data->clips, (GFunc) cogl_clip_unset, NULL);
g_slist_foreach (data->clips, (GFunc) cogl_clip_pop, NULL);
/* Draw the bounding box for each of the clips */
for (node = data->clips; node; node = node->next)