shaped-texture: Swap 90 and 270 degree transforms in pipeline matrix

With `META_MONITOR_TRANSFORM` values matching their `WL_OUTPUT_TRANSFORM`
counterparts, the definition from the Wayland spec applies: the
`META_MONITOR_TRANSFORM` value tells us how the output was rotated
and that the buffer was drawn by the client to compensate for that.

The matrix describes the transformation from surface- to buffer-
coordinates, so the operation we need here is the same one that
the client applied (not from buffer- to surface-coordinates, i.e.
the inverse).

While on it fix `FLIPPED_90` and `FLIPPED_270` to use the correct
axes: flip on the x-axis, rotation on the z-axis.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2459>
This commit is contained in:
Robert Mader 2022-06-14 19:01:27 +02:00 committed by Marge Bot
parent 2ade26ebf8
commit d644a40cf5

View File

@ -341,7 +341,7 @@ get_base_pipeline (MetaShapedTexture *stex,
switch (stex->transform) switch (stex->transform)
{ {
case META_MONITOR_TRANSFORM_90: case META_MONITOR_TRANSFORM_90:
graphene_euler_init_with_order (&euler, 0.0, 0.0, 90.0, graphene_euler_init_with_order (&euler, 0.0, 0.0, 270.0,
GRAPHENE_EULER_ORDER_SYXZ); GRAPHENE_EULER_ORDER_SYXZ);
break; break;
case META_MONITOR_TRANSFORM_180: case META_MONITOR_TRANSFORM_180:
@ -349,7 +349,7 @@ get_base_pipeline (MetaShapedTexture *stex,
GRAPHENE_EULER_ORDER_SYXZ); GRAPHENE_EULER_ORDER_SYXZ);
break; break;
case META_MONITOR_TRANSFORM_270: case META_MONITOR_TRANSFORM_270:
graphene_euler_init_with_order (&euler, 0.0, 0.0, 270.0, graphene_euler_init_with_order (&euler, 0.0, 0.0, 90.0,
GRAPHENE_EULER_ORDER_SYXZ); GRAPHENE_EULER_ORDER_SYXZ);
break; break;
case META_MONITOR_TRANSFORM_FLIPPED: case META_MONITOR_TRANSFORM_FLIPPED:
@ -357,7 +357,7 @@ get_base_pipeline (MetaShapedTexture *stex,
GRAPHENE_EULER_ORDER_SYXZ); GRAPHENE_EULER_ORDER_SYXZ);
break; break;
case META_MONITOR_TRANSFORM_FLIPPED_90: case META_MONITOR_TRANSFORM_FLIPPED_90:
graphene_euler_init_with_order (&euler, 180.0, 0.0, 90.0, graphene_euler_init_with_order (&euler, 0.0, 180.0, 90.0,
GRAPHENE_EULER_ORDER_SYXZ); GRAPHENE_EULER_ORDER_SYXZ);
break; break;
case META_MONITOR_TRANSFORM_FLIPPED_180: case META_MONITOR_TRANSFORM_FLIPPED_180:
@ -365,7 +365,7 @@ get_base_pipeline (MetaShapedTexture *stex,
GRAPHENE_EULER_ORDER_SYXZ); GRAPHENE_EULER_ORDER_SYXZ);
break; break;
case META_MONITOR_TRANSFORM_FLIPPED_270: case META_MONITOR_TRANSFORM_FLIPPED_270:
graphene_euler_init_with_order (&euler, 180.0, 0.0, 270.0, graphene_euler_init_with_order (&euler, 0.0, 180.0, 270.0,
GRAPHENE_EULER_ORDER_SYXZ); GRAPHENE_EULER_ORDER_SYXZ);
break; break;
case META_MONITOR_TRANSFORM_NORMAL: case META_MONITOR_TRANSFORM_NORMAL: