[mutter] monitor: Move logical to CRTC transform helper to MetaOutput



commit 1b67f49f7f702d2c5190ead1cd4bd0602103afa2
Author: Jonas Ådahl <jadahl gmail com>
Date:   Tue Jan 14 22:21:38 2020 +0100

    monitor: Move logical to CRTC transform helper to MetaOutput
    
    So that it can be used on a per output basis in the future.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042

 src/backends/meta-monitor.c |  8 +-------
 src/backends/meta-output.c  | 14 ++++++++++++++
 src/backends/meta-output.h  |  3 +++
 3 files changed, 18 insertions(+), 7 deletions(-)
---
diff --git a/src/backends/meta-monitor.c b/src/backends/meta-monitor.c
index 2b0aa5ac6..578fec941 100644
--- a/src/backends/meta-monitor.c
+++ b/src/backends/meta-monitor.c
@@ -455,14 +455,8 @@ meta_monitor_logical_to_crtc_transform (MetaMonitor          *monitor,
                                         MetaMonitorTransform  transform)
 {
   MetaOutput *output = meta_monitor_get_main_output (monitor);
-  MetaMonitorTransform new_transform;
-
-  new_transform = (transform + output->panel_orientation_transform) %
-                  META_MONITOR_TRANSFORM_FLIPPED;
-  if (meta_monitor_transform_is_flipped (transform))
-    new_transform += META_MONITOR_TRANSFORM_FLIPPED;
 
-  return new_transform;
+  return meta_output_logical_to_crtc_transform (output, transform);
 }
 
 MetaMonitorTransform
diff --git a/src/backends/meta-output.c b/src/backends/meta-output.c
index 2139a17a3..2e8a787db 100644
--- a/src/backends/meta-output.c
+++ b/src/backends/meta-output.c
@@ -62,6 +62,20 @@ meta_output_get_assigned_crtc (MetaOutput *output)
   return priv->crtc;
 }
 
+MetaMonitorTransform
+meta_output_logical_to_crtc_transform (MetaOutput           *output,
+                                       MetaMonitorTransform  transform)
+{
+  MetaMonitorTransform new_transform;
+
+  new_transform = (transform + output->panel_orientation_transform) %
+                  META_MONITOR_TRANSFORM_FLIPPED;
+  if (meta_monitor_transform_is_flipped (transform))
+    new_transform += META_MONITOR_TRANSFORM_FLIPPED;
+
+  return new_transform;
+}
+
 static void
 meta_output_dispose (GObject *object)
 {
diff --git a/src/backends/meta-output.h b/src/backends/meta-output.h
index 5756669ba..2372eb3ac 100644
--- a/src/backends/meta-output.h
+++ b/src/backends/meta-output.h
@@ -129,6 +129,9 @@ void meta_output_assign_crtc (MetaOutput *output,
 META_EXPORT_TEST
 void meta_output_unassign_crtc (MetaOutput *output);
 
+MetaMonitorTransform meta_output_logical_to_crtc_transform (MetaOutput           *output,
+                                                            MetaMonitorTransform  transform);
+
 META_EXPORT_TEST
 MetaCrtc * meta_output_get_assigned_crtc (MetaOutput *output);
 


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