[mutter] backends/x11/nested: Draw the stage view CRTCs with the correct size



commit eacf2f218746e0f911dfdedf23d38c7bbe75703e
Author: Jonas Ådahl <jadahl gmail com>
Date:   Wed Aug 23 11:47:26 2017 +0800

    backends/x11/nested: Draw the stage view CRTCs with the correct size
    
    The nested stage tries to emulate how CRTCs are drawn, but fails to do
    this when a stage view is scaled as it didn't adapt the viewport size
    according to the stage view scale.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786663

 src/backends/x11/meta-stage-x11-nested.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/backends/x11/meta-stage-x11-nested.c b/src/backends/x11/meta-stage-x11-nested.c
index 4cc58d609..f77e13ade 100644
--- a/src/backends/x11/meta-stage-x11-nested.c
+++ b/src/backends/x11/meta-stage-x11-nested.c
@@ -122,6 +122,7 @@ draw_crtc (MetaMonitor         *monitor,
   CoglMatrix transform;
   float texture_width, texture_height;
   float sample_x, sample_y, sample_width, sample_height;
+  float scale;
   int viewport_x, viewport_y;
   int viewport_width, viewport_height;
   float s_1, t_1, s_2, t_2;
@@ -198,6 +199,11 @@ draw_crtc (MetaMonitor         *monitor,
       viewport_width = monitor_crtc_mode->crtc_mode->width;
       viewport_height = monitor_crtc_mode->crtc_mode->height;
     }
+
+  scale = clutter_stage_view_get_scale (data->view);
+  viewport_width = roundf (viewport_width / scale);
+  viewport_height = roundf (viewport_height / scale);
+
   cogl_framebuffer_set_viewport (onscreen,
                                  viewport_x, viewport_y,
                                  viewport_width, viewport_height);


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