Clarify behavior of buffer transformations

The new text describes how

- Mutter
- Plasma
- Sway 1.8
- Jay

behave.

Sway 1.9 flipped the behavior of 90 degree and 270 degree
set_buffer_transform requests. [mpv] also changed the behavior of its
vo_wayland_dmabuf backend which makes it only work correctly on sway
1.9.

[mpv]: https://github.com/mpv-player/mpv/pull/12509

It seems that the previous text was open to interpretation or at least
caused some amount of confusion.

Signed-off-by: Julian Orth <ju.orth@gmail.com>
This commit is contained in:
Julian Orth 2024-02-27 14:21:05 +01:00 committed by Simon Ser
parent af1dc3ef4b
commit 5eeaac6e11

View file

@ -1704,10 +1704,12 @@
<request name="set_buffer_transform" since="2"> <request name="set_buffer_transform" since="2">
<description summary="sets the buffer transformation"> <description summary="sets the buffer transformation">
This request sets an optional transformation on how the compositor This request sets the transformation that the client has already applied
interprets the contents of the buffer attached to the surface. The to the content of the buffer. The accepted values for the transform
accepted values for the transform parameter are the values for parameter are the values for wl_output.transform.
wl_output.transform.
The compositor applies the inverse of this transformation whenever it
uses the buffer contents.
Buffer transform is double-buffered state, see wl_surface.commit. Buffer transform is double-buffered state, see wl_surface.commit.
@ -1861,9 +1863,9 @@
Before receiving this event the preferred buffer transform for this Before receiving this event the preferred buffer transform for this
surface is normal. surface is normal.
It is intended that transform aware clients use this event to apply the Applying this transformation to the surface buffer contents and using
transform to their content and use wl_surface.set_buffer_transform to wl_surface.set_buffer_transform might allow the compositor to use the
indicate the transform they have rendered with. surface buffer more efficiently.
</description> </description>
<arg name="transform" type="uint" enum="wl_output.transform" <arg name="transform" type="uint" enum="wl_output.transform"
summary="preferred transform"/> summary="preferred transform"/>
@ -2726,10 +2728,9 @@
</enum> </enum>
<enum name="transform"> <enum name="transform">
<description summary="transform from framebuffer to output"> <description summary="transformation applied to buffer contents">
This describes the transform that a compositor will apply to a This describes transformations that clients and compositors apply to
surface to compensate for the rotation or mirroring of an buffer contents.
output device.
The flipped values correspond to an initial flip around a The flipped values correspond to an initial flip around a
vertical axis followed by rotation. vertical axis followed by rotation.
@ -2787,7 +2788,7 @@
<arg name="model" type="string" <arg name="model" type="string"
summary="textual description of the model"/> summary="textual description of the model"/>
<arg name="transform" type="int" enum="transform" <arg name="transform" type="int" enum="transform"
summary="transform that maps framebuffer to output"/> summary="additional transformation applied to buffer contents during presentation"/>
</event> </event>
<enum name="mode" bitfield="true"> <enum name="mode" bitfield="true">