[mutter/wip/display-no-wayland: 1/33] MetaBackgroundGroup: don't use clutter_actor_get_children()



commit 3093b5c95d8fc690568e63a3eb691f2bfe4033cc
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Wed Feb 27 17:47:48 2013 +0100

    MetaBackgroundGroup: don't use clutter_actor_get_children()
    
    In C code we can use ClutterActorIter and avoid allocating a GList.

 src/compositor/meta-background-group.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/compositor/meta-background-group.c b/src/compositor/meta-background-group.c
index 01dd27a..cf08843 100644
--- a/src/compositor/meta-background-group.c
+++ b/src/compositor/meta-background-group.c
@@ -73,13 +73,12 @@ void
 meta_background_group_set_visible_region (MetaBackgroundGroup *self,
                                           cairo_region_t      *region)
 {
-  GList *children, *l;
+  ClutterActorIter iter;
+  ClutterActor *actor;
 
-  children = clutter_actor_get_children (CLUTTER_ACTOR (self));
-  for (l = children; l; l = l->next)
+  clutter_actor_iter_init (&iter, CLUTTER_ACTOR (self));
+  while (clutter_actor_iter_next (&iter, &actor))
     {
-      ClutterActor *actor = l->data;
-
       if (META_IS_BACKGROUND_ACTOR (actor))
         {
           meta_background_actor_set_visible_region (META_BACKGROUND_ACTOR (actor), region);
@@ -96,7 +95,6 @@ meta_background_group_set_visible_region (MetaBackgroundGroup *self,
           cairo_region_translate (region, x, y);
         }
     }
-  g_list_free (children);
 }
 
 ClutterActor *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]