actor: new actors should start with an empty paint box

This initializes priv->last_paint_box with a degenerate box, so a newly
allocated actor added to the scenegraph and made visible only needs to
trigger a redraw of its initial position. If we don't have a valid
last_paint_box though we would instead trigger a full stage redraw.
This commit is contained in:
Robert Bragg 2010-09-08 18:17:27 +01:00
parent c2ea35b5ca
commit 072595a1bf

View File

@ -4911,6 +4911,13 @@ clutter_actor_init (ClutterActor *self)
priv->opacity_parent = NULL;
priv->enable_model_view_transform = TRUE;
/* Initialize an empty paint box to start with */
priv->last_paint_box.x1 = 0;
priv->last_paint_box.y1 = 0;
priv->last_paint_box.x2 = 0;
priv->last_paint_box.y2 = 0;
priv->last_paint_box_valid = TRUE;
memset (priv->clip, 0, sizeof (gfloat) * 4);
}