diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2018-08-10 21:30:58 +0200 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2018-08-15 02:12:08 +0200 |
commit | 955b2b531f4d55d271bf481fe896e3a45682eb71 (patch) | |
tree | d8d9d87e48073b2fe45a9643ee86c165dcb29d6f | |
parent | 620e26b5c823f11e795169d6fa8ff98cd02409d0 (diff) | |
download | mutter-955b2b531f4d55d271bf481fe896e3a45682eb71.tar.gz |
clutter: Avoid relayouts when raising/lowering children
These calls don't actually affect the layout, but the paint order.
It seems safe to skip the full relayout/repaint of the parent actor,
and redraw only the area occupied by the affected child.
-rw-r--r-- | clutter/clutter/clutter-actor.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index 0b2e13f27..97b03fdb5 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -1721,6 +1721,22 @@ set_show_on_set_parent (ClutterActor *self, } } +static void +clutter_actor_queue_redraw_on_parent (ClutterActor *self) +{ + const ClutterPaintVolume *pv; + + if (!self->priv->parent) + return; + + /* A relayout/redraw is underway */ + if (self->priv->needs_allocation) + return; + + pv = clutter_actor_get_transformed_paint_volume (self, self->priv->parent); + _clutter_actor_queue_redraw_with_clip (self->priv->parent, 0, pv); +} + /** * clutter_actor_show: * @self: A #ClutterActor @@ -13633,7 +13649,7 @@ clutter_actor_set_child_above_sibling (ClutterActor *self, sibling); g_object_unref(child); - clutter_actor_queue_relayout (self); + clutter_actor_queue_redraw_on_parent (child); } /** @@ -13680,7 +13696,7 @@ clutter_actor_set_child_below_sibling (ClutterActor *self, sibling); g_object_unref(child); - clutter_actor_queue_relayout (self); + clutter_actor_queue_redraw_on_parent (child); } /** |