|
|
f73620 |
From dcf0717d7d90ff525c4f87cf633353caabf0eeeb Mon Sep 17 00:00:00 2001
|
|
|
f73620 |
From: Carlos Garnacho <carlosg@gnome.org>
|
|
|
f73620 |
Date: Fri, 10 Aug 2018 21:30:58 +0200
|
|
|
f73620 |
Subject: [PATCH 2/2] clutter: Avoid relayouts when raising/lowering children
|
|
|
f73620 |
|
|
|
f73620 |
These calls don't actually affect the layout, but the paint order.
|
|
|
f73620 |
It seems safe to skip the full relayout/repaint of the parent actor,
|
|
|
f73620 |
and redraw only the area occupied by the affected child.
|
|
|
f73620 |
---
|
|
|
f73620 |
clutter/clutter/clutter-actor.c | 20 ++++++++++++++++++--
|
|
|
f73620 |
1 file changed, 18 insertions(+), 2 deletions(-)
|
|
|
f73620 |
|
|
|
f73620 |
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
|
|
|
f73620 |
index 6954f0396..7a9da7257 100644
|
|
|
f73620 |
--- a/clutter/clutter/clutter-actor.c
|
|
|
f73620 |
+++ b/clutter/clutter/clutter-actor.c
|
|
|
f73620 |
@@ -1713,6 +1713,22 @@ set_show_on_set_parent (ClutterActor *self,
|
|
|
f73620 |
}
|
|
|
f73620 |
}
|
|
|
f73620 |
|
|
|
f73620 |
+static void
|
|
|
f73620 |
+clutter_actor_queue_redraw_on_parent (ClutterActor *self)
|
|
|
f73620 |
+{
|
|
|
f73620 |
+ const ClutterPaintVolume *pv;
|
|
|
f73620 |
+
|
|
|
f73620 |
+ if (!self->priv->parent)
|
|
|
f73620 |
+ return;
|
|
|
f73620 |
+
|
|
|
f73620 |
+ /* A relayout/redraw is underway */
|
|
|
f73620 |
+ if (self->priv->needs_allocation)
|
|
|
f73620 |
+ return;
|
|
|
f73620 |
+
|
|
|
f73620 |
+ pv = clutter_actor_get_transformed_paint_volume (self, self->priv->parent);
|
|
|
f73620 |
+ _clutter_actor_queue_redraw_with_clip (self->priv->parent, 0, pv);
|
|
|
f73620 |
+}
|
|
|
f73620 |
+
|
|
|
f73620 |
/**
|
|
|
f73620 |
* clutter_actor_show:
|
|
|
f73620 |
* @self: A #ClutterActor
|
|
|
f73620 |
@@ -13618,7 +13634,7 @@ clutter_actor_set_child_above_sibling (ClutterActor *self,
|
|
|
f73620 |
sibling);
|
|
|
f73620 |
g_object_unref(child);
|
|
|
f73620 |
|
|
|
f73620 |
- clutter_actor_queue_relayout (self);
|
|
|
f73620 |
+ clutter_actor_queue_redraw_on_parent (child);
|
|
|
f73620 |
}
|
|
|
f73620 |
|
|
|
f73620 |
/**
|
|
|
f73620 |
@@ -13665,7 +13681,7 @@ clutter_actor_set_child_below_sibling (ClutterActor *self,
|
|
|
f73620 |
sibling);
|
|
|
f73620 |
g_object_unref(child);
|
|
|
f73620 |
|
|
|
f73620 |
- clutter_actor_queue_relayout (self);
|
|
|
f73620 |
+ clutter_actor_queue_redraw_on_parent (child);
|
|
|
f73620 |
}
|
|
|
f73620 |
|
|
|
f73620 |
/**
|
|
|
f73620 |
--
|
|
|
f73620 |
2.21.0
|
|
|
f73620 |
|