[clutter/wip/optimizations-2: 5/8] actor: Propagate the cloned state to the children
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/wip/optimizations-2: 5/8] actor: Propagate the cloned state to the children
- Date: Fri, 8 Mar 2013 04:38:20 +0000 (UTC)
commit 57badcb5d4c1835fd5bc7c814a1adaf3b007d400
Author: Emmanuele Bassi <ebassi gnome org>
Date: Thu Mar 7 19:10:55 2013 +0000
actor: Propagate the cloned state to the children
If we clone a container, we still want redraws queued on the children to
be propagated.
clutter/clutter-actor.c | 38 +++++++++++++++++++++++++++++++++++++-
1 files changed, 37 insertions(+), 1 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index 849a6b5..06c0156 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -774,6 +774,11 @@ struct _ClutterActorPrivate
/* a set of clones of the actor */
GHashTable *clones;
+ /* whether the actor is inside a cloned branch; this
+ * value is propagated to all the actor's children
+ */
+ gulong in_cloned_branch;
+
/* bitfields: KEEP AT THE END */
/* fixed position and sizes */
@@ -8610,7 +8615,8 @@ _clutter_actor_queue_redraw_full (ClutterActor *self,
* of their parents has been hidden
*/
if (!CLUTTER_ACTOR_IS_MAPPED (self) &&
- !clutter_actor_has_mapped_clones (self))
+ !clutter_actor_has_mapped_clones (self) &&
+ self->priv->in_cloned_branch == 0)
return;
/* given the check above we could end up queueing a redraw on an
@@ -20156,6 +20162,32 @@ clutter_actor_get_child_transform (ClutterActor *self,
clutter_matrix_init_identity (transform);
}
+static void
+clutter_actor_push_in_cloned_branch (ClutterActor *self)
+{
+ ClutterActor *iter;
+
+ for (iter = self->priv->first_child;
+ iter != NULL;
+ iter = iter->priv->next_sibling)
+ clutter_actor_push_in_cloned_branch (iter);
+
+ self->priv->in_cloned_branch += 1;
+}
+
+static void
+clutter_actor_pop_in_cloned_branch (ClutterActor *self)
+{
+ ClutterActor *iter;
+
+ self->priv->in_cloned_branch -= 1;
+
+ for (iter = self->priv->first_child;
+ iter != NULL;
+ iter = iter->priv->next_sibling)
+ clutter_actor_pop_in_cloned_branch (iter);
+}
+
void
_clutter_actor_attach_clone (ClutterActor *actor,
ClutterActor *clone)
@@ -20168,6 +20200,8 @@ _clutter_actor_attach_clone (ClutterActor *actor,
priv->clones = g_hash_table_new (NULL, NULL);
g_hash_table_add (priv->clones, clone);
+
+ clutter_actor_push_in_cloned_branch (actor);
}
void
@@ -20182,6 +20216,8 @@ _clutter_actor_detach_clone (ClutterActor *actor,
g_hash_table_lookup (priv->clones, clone) == NULL)
return;
+ clutter_actor_pop_in_cloned_branch (actor);
+
g_hash_table_remove (priv->clones, clone);
if (g_hash_table_size (priv->clones) == 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]