[group] Implement pick

Currently, picking in ClutterGroup pollutes the CLUTTER_DEBUG=paint
logs since it just calls the paint function. Reimplementing the pick
doesn't make us lose anything -- it might even be slightly faster
since we don't have to do a (typed) cast and a class dereference.
This commit is contained in:
Emmanuele Bassi 2009-05-07 18:47:50 +01:00
parent 081813fd61
commit ab9c7671f5

View File

@ -96,8 +96,7 @@ clutter_group_paint (ClutterActor *actor)
g_assert (child != NULL);
if (CLUTTER_ACTOR_IS_VISIBLE (child))
clutter_actor_paint (child);
clutter_actor_paint (child);
}
CLUTTER_NOTE (PAINT, "ClutterGroup paint leave '%s'",
@ -109,14 +108,22 @@ static void
clutter_group_pick (ClutterActor *actor,
const ClutterColor *color)
{
ClutterGroupPrivate *priv = CLUTTER_GROUP (actor)->priv;
GList *child_item;
/* Chain up so we get a bounding box pained (if we are reactive) */
CLUTTER_ACTOR_CLASS (clutter_group_parent_class)->pick (actor, color);
/* Just forward to the paint call which in turn will trigger
* the child actors also getting 'picked'.
*/
if (CLUTTER_ACTOR_IS_VISIBLE (actor))
clutter_group_paint (actor);
for (child_item = priv->children;
child_item != NULL;
child_item = child_item->next)
{
ClutterActor *child = child_item->data;
g_assert (child != NULL);
clutter_actor_paint (child);
}
}
static void