[clutter] actor: Add freeze/thaw when changing the first/last child
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] actor: Add freeze/thaw when changing the first/last child
- Date: Tue, 14 Feb 2012 15:40:53 +0000 (UTC)
commit 0f5ddb6d6c05e08f1c5c74f2ac867f2f6ec30077
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Mon Feb 13 22:40:15 2012 -0500
actor: Add freeze/thaw when changing the first/last child
This should improve performance when adding/removing lots
of children.
clutter/clutter-actor.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index 08900b4..fb2269b 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -3491,6 +3491,8 @@ clutter_actor_remove_child_internal (ClutterActor *self,
flush_queue = (flags & REMOVE_CHILD_FLUSH_QUEUE) != 0;
notify_first_last = (flags & REMOVE_CHILD_NOTIFY_FIRST_LAST) != 0;
+ g_object_freeze_notify (G_OBJECT (self));
+
if (destroy_meta)
clutter_container_destroy_child_meta (CLUTTER_CONTAINER (self), child);
@@ -3564,6 +3566,8 @@ clutter_actor_remove_child_internal (ClutterActor *self,
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_LAST_CHILD]);
}
+ g_object_thaw_notify (G_OBJECT (self));
+
/* remove the reference we acquired in clutter_actor_add_child() */
g_object_unref (child);
}
@@ -10124,6 +10128,8 @@ clutter_actor_add_child_internal (ClutterActor *self,
old_first_child = self->priv->first_child;
old_last_child = self->priv->last_child;
+ g_object_freeze_notify (G_OBJECT (self));
+
if (create_meta)
clutter_container_create_child_meta (CLUTTER_CONTAINER (self), child);
@@ -10198,6 +10204,8 @@ clutter_actor_add_child_internal (ClutterActor *self,
if (old_last_child != self->priv->last_child)
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_LAST_CHILD]);
}
+
+ g_object_thaw_notify (G_OBJECT (self));
}
/**
@@ -10483,10 +10491,14 @@ clutter_actor_remove_all_children (ClutterActor *self)
if (self->priv->n_children == 0)
return;
+ g_object_freeze_notify (G_OBJECT (self));
+
clutter_actor_iter_init (&iter, self);
while (clutter_actor_iter_next (&iter, NULL))
clutter_actor_iter_remove (&iter);
+ g_object_thaw_notify (G_OBJECT (self));
+
/* sanity check */
g_assert (self->priv->first_child == NULL);
g_assert (self->priv->last_child == NULL);
@@ -10530,10 +10542,14 @@ clutter_actor_destroy_all_children (ClutterActor *self)
if (self->priv->n_children == 0)
return;
+ g_object_freeze_notify (G_OBJECT (self));
+
clutter_actor_iter_init (&iter, self);
while (clutter_actor_iter_next (&iter, NULL))
clutter_actor_iter_destroy (&iter);
+ g_object_thaw_notify (G_OBJECT (self));
+
/* sanity check */
g_assert (self->priv->first_child == NULL);
g_assert (self->priv->last_child == NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]