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>
This commit is contained in:
Daniel van Vugt 2020-11-18 18:09:32 +08:00 committed by Marge Bot
parent 96a185d8bc
commit f78cfc0c80

View File

@ -645,6 +645,8 @@ clutter_stage_cogl_redraw_view_primary (ClutterStageCogl *stage_cogl,
view_rect.x, view_rect.x,
view_rect.y); view_rect.y);
cairo_region_subtract (swap_region_in_stage_space, queued_redraw_clip);
paint_damage_region (stage_window, view, paint_damage_region (stage_window, view,
swap_region_in_stage_space, queued_redraw_clip); swap_region_in_stage_space, queued_redraw_clip);