From a0dbf3b84c1aa5a90932fb0e437c6fbed99dd6bb Mon Sep 17 00:00:00 2001 From: Daniel van Vugt Date: Wed, 18 Nov 2020 16:20:57 +0800 Subject: [PATCH] clutter/stage-cogl: Scale and offset the swap region before debug painting It was being painted without scaling and offsetting so would only look right at scale 1.0 and only on the view with origin (0,0). Now we include the framebuffer scale and view origin it will be painted in the correct location. Part-of: --- clutter/clutter/cogl/clutter-stage-cogl.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/clutter/clutter/cogl/clutter-stage-cogl.c b/clutter/clutter/cogl/clutter-stage-cogl.c index b7873896f..a5db640b2 100644 --- a/clutter/clutter/cogl/clutter-stage-cogl.c +++ b/clutter/clutter/cogl/clutter-stage-cogl.c @@ -636,9 +636,19 @@ clutter_stage_cogl_redraw_view_primary (ClutterStageCogl *stage_cogl, if (queued_redraw_clip) { + cairo_region_t *swap_region_in_stage_space; + + swap_region_in_stage_space = + scale_offset_and_clamp_region (swap_region, + 1.0f / fb_scale, + view_rect.x, + view_rect.y); + paint_damage_region (stage_window, view, - swap_region, queued_redraw_clip); + swap_region_in_stage_space, queued_redraw_clip); + cairo_region_destroy (queued_redraw_clip); + cairo_region_destroy (swap_region_in_stage_space); } swap_framebuffer (stage_window,