monitor: Move logical <-> CRTC transform helpers to MetaOutput

So that we avoid leaking the internal guts of MetaOutput into
MetaMonitor, while also making it possible to use it without a
MetaMonitor at hand.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1064
This commit is contained in:
Jonas Ådahl 2020-02-18 11:45:26 +01:00
parent 92f0eb9d14
commit ff59b5d041
3 changed files with 19 additions and 8 deletions

View File

@ -467,12 +467,8 @@ meta_monitor_crtc_to_logical_transform (MetaMonitor *monitor,
MetaMonitorTransform transform)
{
MetaOutput *output = meta_monitor_get_main_output (monitor);
MetaMonitorTransform inverted_paniel_orientation_transform;
inverted_paniel_orientation_transform =
meta_monitor_transform_invert (output->panel_orientation_transform);
return meta_monitor_transform_transform (transform,
inverted_paniel_orientation_transform);
return meta_output_crtc_to_logical_transform (output, transform);
}
static void

View File

@ -73,6 +73,18 @@ meta_output_logical_to_crtc_transform (MetaOutput *output,
panel_orientation_transform);
}
MetaMonitorTransform
meta_output_crtc_to_logical_transform (MetaOutput *output,
MetaMonitorTransform transform)
{
MetaMonitorTransform inverted_panel_orientation_transform;
inverted_panel_orientation_transform =
meta_monitor_transform_invert (output->panel_orientation_transform);
return meta_monitor_transform_transform (transform,
inverted_panel_orientation_transform);
}
static void
meta_output_dispose (GObject *object)
{

View File

@ -129,10 +129,13 @@ 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);
MetaMonitorTransform meta_output_logical_to_crtc_transform (MetaOutput *output,
MetaMonitorTransform transform);
MetaMonitorTransform meta_output_crtc_to_logical_transform (MetaOutput *output,
MetaMonitorTransform transform);
#endif /* META_OUTPUT_H */