From ab9c7671f57a03ab34dac97bbd3a787b5f0ab65d Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 7 May 2009 18:47:50 +0100 Subject: [PATCH] [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. --- clutter/clutter-group.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/clutter/clutter-group.c b/clutter/clutter-group.c index 8e52850..148309b 100644 --- a/clutter/clutter-group.c +++ b/clutter/clutter-group.c @@ -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 -- 2.7.4