* clutter/clutter-actor.c (clutter_actor_paint): Guard against the

actor clip being enabled or disabled in an actor paint
	method. Otherwise the clip stack can be become unbalanced. This
	was happening in ClutterEntry until it was fixed in revision 2983.
This commit is contained in:
Neil Roberts 2008-06-25 08:40:25 +00:00
parent feb16bcf95
commit ed44a845a5
2 changed files with 16 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2008-06-25 Neil Roberts <neil@o-hand.com>
* clutter/clutter-actor.c (clutter_actor_paint): Guard against the
actor clip being enabled or disabled in an actor paint
method. Otherwise the clip stack can be become unbalanced. This
was happening in ClutterEntry until it was fixed in revision 2983.
2008-06-24 Neil Roberts <neil@o-hand.com>
Bug 979 - Wrong call convension for SwapIntervalProc in win32 backend

View File

@ -1391,6 +1391,7 @@ clutter_actor_paint (ClutterActor *self)
{
ClutterActorPrivate *priv;
ClutterMainContext *context;
gboolean clip_set = FALSE;
g_return_if_fail (CLUTTER_IS_ACTOR (self));
@ -1413,10 +1414,13 @@ clutter_actor_paint (ClutterActor *self)
_clutter_actor_apply_modelview_transform (self);
if (priv->has_clip)
{
cogl_clip_set (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]));
clip_set = TRUE;
}
context = clutter_context_get_default ();
if (G_UNLIKELY (context->pick_mode != CLUTTER_PICK_NONE))
@ -1440,7 +1444,7 @@ clutter_actor_paint (ClutterActor *self)
clutter_actor_shader_post_paint (self);
}
if (priv->has_clip)
if (clip_set)
cogl_clip_unset();
cogl_pop_matrix();