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
This commit is contained in:
Jonas Ådahl 2020-01-14 22:21:38 +01:00
parent c447d76cd4
commit 1b67f49f7f
3 changed files with 18 additions and 7 deletions

View File

@ -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

View File

@ -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)
{

View File

@ -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);