Redefine output rotations

It was discovered in issue #99 that the implementations of the 90 and 270
degree rotations were actually the inverse of what the Wayland specification
spelled out. This patch fixes the libweston implementation to follow the
specification.

As a result, the behaviour of the the weston.ini transform key also changes. To
force all users to re-think their configuration, the transform key values are
also changed. Since Weston and libweston change their behaviour, the handling
of clients' buffer transform changes too.

All the functions had their 90/270 cases simply swapped, probably due to
confusion of whether WL_OUTPUT_TRANSFORM_* refers to rotating the monitor or
the content.

Hint: a key to understanding weston_matrix_rotate_xy(m, c, s) is that the
rotation matrix is formed as

  c -s
  s  c

that is, it's column-major. This fooled me at first.

Fixing window.c fixes weston-terminal and weston-transformed.

In simple-damage, window_get_transformed_ball() is fixed to follow the proper
transform definitions, but the fix to the viewport path in redraw() is purely
mechanical.  The viewport path looks broken to me in the presence of any
transform, but it is not this patch's job to fix it.

Screen-share fix just repeats the general code fix pattern, I did not even try
to understand that bit.

https://gitlab.freedesktop.org/wayland/weston/issues/99

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
Pekka Paalanen
2020-02-06 15:27:54 +02:00
committed by Daniel Stone
parent 0df4477924
commit 8060d826b7
8 changed files with 88 additions and 84 deletions
+3 -2
View File
@@ -119,8 +119,9 @@ can generate detailed mode lines.
\fBtransform\fR=\fItransform\fR
Transform for the output, which can be rotated in 90-degree steps
and possibly flipped. Possible values are
.BR normal ", " 90 ", " 180 ", " 270 ", "
.BR flipped ", " flipped-90 ", " flipped-180 ", and " flipped-270 .
.BR normal ", " rotate-90 ", " rotate-180 ", " rotate-270 ", "
.BR flipped ", " flipped-rotate-90 ", " flipped-rotate-180 ", and "
.BR flipped-rotate-270 .
.TP
\fBpixman-shadow\fR=\fIboolean\fR
If using the Pixman-renderer, use shadow framebuffers. Defaults to
+10 -10
View File
@@ -504,19 +504,19 @@ for examples of modes-formats supported by DRM backend.
.RE
.TP 7
.BI "transform=" normal
The transformation applied to screen output (string). The transform key can
be one of the following 8 strings:
How you have rotated your monitor from its normal orientation (string).
The transform key can be one of the following 8 strings:
.PP
.RS 10
.nf
.BR "normal " "Normal output."
.BR "90 " "90 degrees clockwise."
.BR "180 " "Upside down."
.BR "270 " "90 degrees counter clockwise."
.BR "flipped " "Horizontally flipped"
.BR "flipped-90 " "Flipped and 90 degrees clockwise"
.BR "flipped-180 " "Flipped upside down"
.BR "flipped-270 " "Flipped and 90 degrees counter clockwise"
.BR "normal " "Normal output."
.BR "rotate-90 " "90 degrees clockwise."
.BR "rotate-180 " "Upside down."
.BR "rotate-270 " "90 degrees counter clockwise."
.BR "flipped " "Horizontally flipped"
.BR "flipped-rotate-90 " "Flipped and 90 degrees clockwise"
.BR "flipped-rotate-180 " "Flipped and upside down"
.BR "flipped-rotate-270 " "Flipped and 90 degrees counter clockwise"
.fi
.RE
.TP 7