From f78cfc0c8015bb45b2ddb0922820dfce32c25400 Mon Sep 17 00:00:00 2001 From: Daniel van Vugt Date: Wed, 18 Nov 2020 18:09:32 +0800 Subject: [PATCH] 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: --- 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 92bc6ae51..ffc13bad7 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);