[mutter] clutter/stage-cogl: Scale and offset the swap region before debug painting



commit a0dbf3b84c1aa5a90932fb0e437c6fbed99dd6bb
Author: Daniel van Vugt <daniel van vugt canonical com>
Date:   Wed Nov 18 16:20:57 2020 +0800

    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>

 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 b7873896f4..a5db640b23 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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]