*by = wy;
break;
case WL_OUTPUT_TRANSFORM_90:
- *bx = window->height - wy;
- *by = wx;
+ *bx = wy;
+ *by = window->width - wx;
break;
case WL_OUTPUT_TRANSFORM_180:
*bx = window->width - wx;
*by = window->height - wy;
break;
case WL_OUTPUT_TRANSFORM_270:
- *bx = wy;
- *by = window->width - wx;
+ *bx = window->height - wy;
+ *by = wx;
break;
case WL_OUTPUT_TRANSFORM_FLIPPED:
*bx = window->width - wx;
*by = wy;
break;
case WL_OUTPUT_TRANSFORM_FLIPPED_90:
- *bx = window->height - wy;
- *by = window->width - wx;
+ *bx = wy;
+ *by = wx;
break;
case WL_OUTPUT_TRANSFORM_FLIPPED_180:
*bx = wx;
*by = window->height - wy;
break;
case WL_OUTPUT_TRANSFORM_FLIPPED_270:
- *bx = wy;
- *by = wx;
+ *bx = window->height - wy;
+ *by = window->width - wx;
break;
}
off_x = tx;
break;
case WL_OUTPUT_TRANSFORM_90:
- off_y = tx;
- off_x = bwidth - ty;
+ off_y = bheight - tx;
+ off_x = ty;
break;
case WL_OUTPUT_TRANSFORM_180:
off_y = bheight - ty;
off_x = bwidth - tx;
break;
case WL_OUTPUT_TRANSFORM_270:
- off_y = bheight - tx;
- off_x = ty;
+ off_y = tx;
+ off_x = bwidth - ty;
break;
case WL_OUTPUT_TRANSFORM_FLIPPED:
off_y = ty;
off_x = bwidth - tx;
break;
case WL_OUTPUT_TRANSFORM_FLIPPED_90:
- off_y = bheight - tx;
- off_x = bwidth - ty;
+ off_y = tx;
+ off_x = ty;
break;
case WL_OUTPUT_TRANSFORM_FLIPPED_180:
off_y = bheight - ty;
off_x = tx;
break;
case WL_OUTPUT_TRANSFORM_FLIPPED_270:
- off_y = tx;
- off_x = ty;
+ off_y = bheight - tx;
+ off_x = bwidth - ty;
break;
}
wp_viewport_set_source(window->viewport,
" -h <height>\tSet window height to <height>\n"
" --help\tShow this help text\n\n");
+ fprintf(stderr, "This version has been fixed for "
+ "https://gitlab.freedesktop.org/wayland/weston/issues/99 .\n");
+
exit(error_code);
}
translate_y = 0;
break;
case WL_OUTPUT_TRANSFORM_90:
- angle = M_PI_2;
- translate_x = surface_height;
- translate_y = 0;
+ angle = M_PI + M_PI_2;
+ translate_x = 0;
+ translate_y = surface_width;
break;
case WL_OUTPUT_TRANSFORM_FLIPPED_90:
- angle = M_PI_2;
- translate_x = surface_height;
- translate_y = surface_width;
+ angle = M_PI + M_PI_2;
+ translate_x = 0;
+ translate_y = 0;
break;
case WL_OUTPUT_TRANSFORM_180:
angle = M_PI;
translate_y = surface_height;
break;
case WL_OUTPUT_TRANSFORM_270:
- angle = M_PI + M_PI_2;
- translate_x = 0;
- translate_y = surface_width;
+ angle = M_PI_2;
+ translate_x = surface_height;
+ translate_y = 0;
break;
case WL_OUTPUT_TRANSFORM_FLIPPED_270:
- angle = M_PI + M_PI_2;
- translate_x = 0;
- translate_y = 0;
+ angle = M_PI_2;
+ translate_x = surface_height;
+ translate_y = surface_width;
break;
}
}
static const struct { const char *name; uint32_t token; } transforms[] = {
- { "normal", WL_OUTPUT_TRANSFORM_NORMAL },
- { "90", WL_OUTPUT_TRANSFORM_90 },
- { "180", WL_OUTPUT_TRANSFORM_180 },
- { "270", WL_OUTPUT_TRANSFORM_270 },
- { "flipped", WL_OUTPUT_TRANSFORM_FLIPPED },
- { "flipped-90", WL_OUTPUT_TRANSFORM_FLIPPED_90 },
- { "flipped-180", WL_OUTPUT_TRANSFORM_FLIPPED_180 },
- { "flipped-270", WL_OUTPUT_TRANSFORM_FLIPPED_270 },
+ { "normal", WL_OUTPUT_TRANSFORM_NORMAL },
+ { "rotate-90", WL_OUTPUT_TRANSFORM_90 },
+ { "rotate-180", WL_OUTPUT_TRANSFORM_180 },
+ { "rotate-270", WL_OUTPUT_TRANSFORM_270 },
+ { "flipped", WL_OUTPUT_TRANSFORM_FLIPPED },
+ { "flipped-rotate-90", WL_OUTPUT_TRANSFORM_FLIPPED_90 },
+ { "flipped-rotate-180", WL_OUTPUT_TRANSFORM_FLIPPED_180 },
+ { "flipped-rotate-270", WL_OUTPUT_TRANSFORM_FLIPPED_270 },
};
WL_EXPORT int
break;
case WL_OUTPUT_TRANSFORM_90:
case WL_OUTPUT_TRANSFORM_FLIPPED_90:
- pixman_transform_rotate(transform, NULL, 0, pixman_fixed_1);
- pixman_transform_translate(transform, NULL, fh, 0);
+ pixman_transform_rotate(transform, NULL, 0, -pixman_fixed_1);
+ pixman_transform_translate(transform, NULL, 0, fw);
break;
case WL_OUTPUT_TRANSFORM_180:
case WL_OUTPUT_TRANSFORM_FLIPPED_180:
break;
case WL_OUTPUT_TRANSFORM_270:
case WL_OUTPUT_TRANSFORM_FLIPPED_270:
- pixman_transform_rotate(transform, NULL, 0, -pixman_fixed_1);
- pixman_transform_translate(transform, NULL, 0, fw);
+ pixman_transform_rotate(transform, NULL, 0, pixman_fixed_1);
+ pixman_transform_translate(transform, NULL, fh, 0);
break;
}
*by = sy;
break;
case WL_OUTPUT_TRANSFORM_90:
- *bx = height - sy;
- *by = sx;
+ *bx = sy;
+ *by = width - sx;
break;
case WL_OUTPUT_TRANSFORM_FLIPPED_90:
- *bx = height - sy;
- *by = width - sx;
+ *bx = sy;
+ *by = sx;
break;
case WL_OUTPUT_TRANSFORM_180:
*bx = width - sx;
*by = height - sy;
break;
case WL_OUTPUT_TRANSFORM_270:
- *bx = sy;
- *by = width - sx;
+ *bx = height - sy;
+ *by = sx;
break;
case WL_OUTPUT_TRANSFORM_FLIPPED_270:
- *bx = sy;
- *by = sx;
+ *bx = height - sy;
+ *by = width - sx;
break;
}
dest_rects[i].y2 = src_rects[i].y2;
break;
case WL_OUTPUT_TRANSFORM_90:
- dest_rects[i].x1 = height - src_rects[i].y2;
- dest_rects[i].y1 = src_rects[i].x1;
- dest_rects[i].x2 = height - src_rects[i].y1;
- dest_rects[i].y2 = src_rects[i].x2;
+ dest_rects[i].x1 = src_rects[i].y1;
+ dest_rects[i].y1 = width - src_rects[i].x2;
+ dest_rects[i].x2 = src_rects[i].y2;
+ dest_rects[i].y2 = width - src_rects[i].x1;
break;
case WL_OUTPUT_TRANSFORM_180:
dest_rects[i].x1 = width - src_rects[i].x2;
dest_rects[i].y2 = height - src_rects[i].y1;
break;
case WL_OUTPUT_TRANSFORM_270:
- dest_rects[i].x1 = src_rects[i].y1;
- dest_rects[i].y1 = width - src_rects[i].x2;
- dest_rects[i].x2 = src_rects[i].y2;
- dest_rects[i].y2 = width - src_rects[i].x1;
+ dest_rects[i].x1 = height - src_rects[i].y2;
+ dest_rects[i].y1 = src_rects[i].x1;
+ dest_rects[i].x2 = height - src_rects[i].y1;
+ dest_rects[i].y2 = src_rects[i].x2;
break;
case WL_OUTPUT_TRANSFORM_FLIPPED:
dest_rects[i].x1 = width - src_rects[i].x2;
dest_rects[i].y2 = src_rects[i].y2;
break;
case WL_OUTPUT_TRANSFORM_FLIPPED_90:
- dest_rects[i].x1 = height - src_rects[i].y2;
- dest_rects[i].y1 = width - src_rects[i].x2;
- dest_rects[i].x2 = height - src_rects[i].y1;
- dest_rects[i].y2 = width - src_rects[i].x1;
+ dest_rects[i].x1 = src_rects[i].y1;
+ dest_rects[i].y1 = src_rects[i].x1;
+ dest_rects[i].x2 = src_rects[i].y2;
+ dest_rects[i].y2 = src_rects[i].x2;
break;
case WL_OUTPUT_TRANSFORM_FLIPPED_180:
dest_rects[i].x1 = src_rects[i].x1;
dest_rects[i].y2 = height - src_rects[i].y1;
break;
case WL_OUTPUT_TRANSFORM_FLIPPED_270:
- dest_rects[i].x1 = src_rects[i].y1;
- dest_rects[i].y1 = src_rects[i].x1;
- dest_rects[i].x2 = src_rects[i].y2;
- dest_rects[i].y2 = src_rects[i].x2;
+ dest_rects[i].x1 = height - src_rects[i].y2;
+ dest_rects[i].y1 = width - src_rects[i].x2;
+ dest_rects[i].x2 = height - src_rects[i].y1;
+ dest_rects[i].y2 = width - src_rects[i].x1;
break;
}
}
break;
case WL_OUTPUT_TRANSFORM_90:
case WL_OUTPUT_TRANSFORM_FLIPPED_90:
- weston_matrix_rotate_xy(matrix, 0, 1);
+ weston_matrix_rotate_xy(matrix, 0, -1);
weston_matrix_translate(matrix,
- surface->height_from_buffer, 0, 0);
+ 0, surface->width_from_buffer, 0);
break;
case WL_OUTPUT_TRANSFORM_180:
case WL_OUTPUT_TRANSFORM_FLIPPED_180:
break;
case WL_OUTPUT_TRANSFORM_270:
case WL_OUTPUT_TRANSFORM_FLIPPED_270:
- weston_matrix_rotate_xy(matrix, 0, -1);
+ weston_matrix_rotate_xy(matrix, 0, 1);
weston_matrix_translate(matrix,
- 0, surface->width_from_buffer, 0);
+ surface->height_from_buffer, 0, 0);
break;
}
break;
case WL_OUTPUT_TRANSFORM_90:
case WL_OUTPUT_TRANSFORM_FLIPPED_90:
- weston_matrix_translate(&output->matrix, 0, -output->height, 0);
- weston_matrix_rotate_xy(&output->matrix, 0, 1);
+ weston_matrix_translate(&output->matrix, -output->width, 0, 0);
+ weston_matrix_rotate_xy(&output->matrix, 0, -1);
break;
case WL_OUTPUT_TRANSFORM_180:
case WL_OUTPUT_TRANSFORM_FLIPPED_180:
break;
case WL_OUTPUT_TRANSFORM_270:
case WL_OUTPUT_TRANSFORM_FLIPPED_270:
- weston_matrix_translate(&output->matrix, -output->width, 0, 0);
- weston_matrix_rotate_xy(&output->matrix, 0, -1);
+ weston_matrix_translate(&output->matrix, 0, -output->height, 0);
+ weston_matrix_rotate_xy(&output->matrix, 0, 1);
break;
}
\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
.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