From 2be30a3482b3cf3da1b0f380386c92da4f6c5a7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Thu, 15 Apr 2021 15:33:26 +0200 Subject: [PATCH] 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: --- 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 bcfffc714..ce0c5ed32 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;