[mutter] clutter/stage-cogl: Don't paint the blue debug region where it's also red



commit f78cfc0c8015bb45b2ddb0922820dfce32c25400
Author: Daniel van Vugt <daniel van vugt canonical com>
Date:   Wed Nov 18 18:09:32 2020 +0800

    clutter/stage-cogl: Don't paint the blue debug region where it's also red
    
    When using CLUTTER_DEBUG_PAINT_DAMAGE_REGION, the blue swap region is
    always a superset of the red redraw region. So painting both in full (since
    the previous commit) just meant the red region was overdrawn and came out
    purple. That doesn't provide enough visual contrast, changes the user
    experience unexpectedly and reduces performance.
    
    So just subtract the redraw region from the swap region. This way the
    red redraw region is always red, not purple.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1571>

 clutter/clutter/cogl/clutter-stage-cogl.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/clutter/clutter/cogl/clutter-stage-cogl.c b/clutter/clutter/cogl/clutter-stage-cogl.c
index 92bc6ae519..ffc13bad7c 100644
--- a/clutter/clutter/cogl/clutter-stage-cogl.c
+++ b/clutter/clutter/cogl/clutter-stage-cogl.c
@@ -645,6 +645,8 @@ clutter_stage_cogl_redraw_view_primary (ClutterStageCogl *stage_cogl,
                                        view_rect.x,
                                        view_rect.y);
 
+      cairo_region_subtract (swap_region_in_stage_space, queued_redraw_clip);
+
       paint_damage_region (stage_window, view,
                            swap_region_in_stage_space, queued_redraw_clip);
 


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