[mutter] clutter/actor: Invalidate paint volumes of clones when ours changes



commit 2be30a3482b3cf3da1b0f380386c92da4f6c5a7c
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Thu Apr 15 15:33:26 2021 +0200

    clutter/actor: Invalidate paint volumes of clones when ours changes
    
    Turns out ClutterClones need a bit of extra handling as always, there's
    currently nothing that invalidates a clones paint volume when the source
    actors paint volume changes.
    
    Since ClutterClones get_paint_volume() implementation simply takes the
    source actors paint volume and returns that, we should make sure they
    are kept in sync and invalidate the clones paint volume as soon as the
    source actor gets its PV invalidated.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1829>

 clutter/clutter/clutter-actor.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
---
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index bcfffc714c..ce0c5ed323 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -1500,9 +1500,28 @@ queue_update_stage_views (ClutterActor *actor)
     }
 }
 
+static void queue_update_paint_volume (ClutterActor *actor);
+
 static void
+queue_update_paint_volume_on_clones (ClutterActor *self)
+{
+  ClutterActorPrivate *priv = self->priv;
+  GHashTableIter iter;
+  gpointer key;
+
+  if (priv->clones == NULL)
+    return;
+
+  g_hash_table_iter_init (&iter, priv->clones);
+  while (g_hash_table_iter_next (&iter, &key, NULL))
+    queue_update_paint_volume (key);
+}
+
+void
 queue_update_paint_volume (ClutterActor *actor)
 {
+  queue_update_paint_volume_on_clones (actor);
+
   while (actor)
     {
       actor->priv->needs_paint_volume_update = TRUE;


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