clutter/stage: Only add paint volumes of mapped actors to stage clip

Right now we damage the stage even if an actor is not mapped, for
example in the overview.

Stop doing so, reducing over-paint significantly in some situations.
Clones will still do stage damage on their own.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2035>
(cherry picked from commit 136caca5d5)
This commit is contained in:
Robert Mader 2021-10-03 21:17:49 +02:00 committed by Florian Müllner
parent c33ca49dfc
commit 7f9defb444

View File

@ -2849,10 +2849,13 @@ clutter_stage_maybe_finish_queue_redraws (ClutterStage *stage)
{
ClutterActor *redraw_actor = key;
QueueRedrawEntry *entry = value;
ClutterPaintVolume old_actor_pv, new_actor_pv;
g_hash_table_iter_steal (&iter);
if (clutter_actor_is_mapped (redraw_actor))
{
ClutterPaintVolume old_actor_pv, new_actor_pv;
_clutter_paint_volume_init_static (&old_actor_pv, NULL);
_clutter_paint_volume_init_static (&new_actor_pv, NULL);
@ -2881,6 +2884,7 @@ clutter_stage_maybe_finish_queue_redraws (ClutterStage *stage)
*/
add_to_stage_clip (stage, NULL);
}
}
g_object_unref (redraw_actor);
free_queue_redraw_entry (entry);