[mutter] clutter-actor: Keep is_dirty unchanged for culled actors



commit ee507d9ab2b2f277447976c3f5ddc55375fef1eb
Author: Daniel van Vugt <daniel van vugt canonical com>
Date:   Thu Mar 28 16:50:21 2019 +0800

    clutter-actor: Keep is_dirty unchanged for culled actors
    
    In a multi-monitor setup there is a separate paint run for each monitor.
    If an actor doesn't intersect the first monitor painted then it is culled
    out for that monitor to save time. Unfortunately this would mean
    `clutter_actor_paint` was setting `is_dirty = FALSE` before the actor had
    yet been painted on any monitor.
    
    This meant that effects like `ClutterOffscreenEffect` were not receiving
    the flag `CLUTTER_EFFECT_PAINT_ACTOR_DIRTY` when they should have, and
    so would rightfully think they don't need to do a full internal
    invalidation. So `ClutterOffscreenEffect`, and probably other effects,
    did not repaint correctly unless on the first monitor in the list.
    
    The fix is to simply avoid setting `is_dirty = FALSE` on those paint
    runs where the actor has been culled out (`clutter_actor_continue_paint`
    wasn't called). It is only safe to clear the flag after
    `clutter_actor_continue_paint` has been called at least once per stage
    paint.
    
    Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1049
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/511

 clutter/clutter/clutter-actor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index fd38338c7..803f76aae 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -4007,12 +4007,12 @@ clutter_actor_paint (ClutterActor *self)
                   pick_mode == CLUTTER_PICK_NONE))
     _clutter_actor_draw_paint_volume (self);
 
-done:
   /* If we make it here then the actor has run through a complete
      paint run including all the effects so it's no longer dirty */
   if (pick_mode == CLUTTER_PICK_NONE)
     priv->is_dirty = FALSE;
 
+done:
   if (clip_set)
     {
       CoglFramebuffer *fb = _clutter_stage_get_active_framebuffer (stage);


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