summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel van Vugt <daniel.van.vugt@canonical.com>2020-11-18 16:20:57 +0800
committerMarge Bot <marge-bot@gnome.org>2020-11-20 17:14:26 +0000
commita0dbf3b84c1aa5a90932fb0e437c6fbed99dd6bb (patch)
treeb10243c7d4693db43466efd08b183aab80f0fdbf
parent4b32c92ec6a3c6750dfb4184fea79bc0925d47e5 (diff)
downloadmutter-a0dbf3b84c1aa5a90932fb0e437c6fbed99dd6bb.tar.gz
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>
-rw-r--r--clutter/clutter/cogl/clutter-stage-cogl.c12
1 files changed, 11 insertions, 1 deletions
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,