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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1571>
This commit is contained in:
Daniel van Vugt 2020-11-18 16:20:57 +08:00 committed by Marge Bot
parent 4b32c92ec6
commit a0dbf3b84c

View File

@ -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,