Make weston_output_transform_coordinate more sane
The output is renamed "output" from "x11_output" and the input coordinates
are changed to wl_fixed_t from int. This way it is useable in
compositor-wayland as well as compositor-x11 and evdev.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
diff --git a/src/compositor.c b/src/compositor.c
index adc219a..7b87a9f 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -3098,7 +3098,7 @@
WL_EXPORT void
weston_output_transform_coordinate(struct weston_output *output,
- int device_x, int device_y,
+ wl_fixed_t device_x, wl_fixed_t device_y,
wl_fixed_t *x, wl_fixed_t *y)
{
wl_fixed_t tx, ty;
@@ -3110,36 +3110,36 @@
switch(output->transform) {
case WL_OUTPUT_TRANSFORM_NORMAL:
default:
- tx = wl_fixed_from_int(device_x);
- ty = wl_fixed_from_int(device_y);
+ tx = device_x;
+ ty = device_y;
break;
case WL_OUTPUT_TRANSFORM_90:
- tx = wl_fixed_from_int(device_y);
- ty = height - wl_fixed_from_int(device_x);
+ tx = device_y;
+ ty = height - device_x;
break;
case WL_OUTPUT_TRANSFORM_180:
- tx = width - wl_fixed_from_int(device_x);
- ty = height - wl_fixed_from_int(device_y);
+ tx = width - device_x;
+ ty = height - device_y;
break;
case WL_OUTPUT_TRANSFORM_270:
- tx = width - wl_fixed_from_int(device_y);
- ty = wl_fixed_from_int(device_x);
+ tx = width - device_y;
+ ty = device_x;
break;
case WL_OUTPUT_TRANSFORM_FLIPPED:
- tx = width - wl_fixed_from_int(device_x);
- ty = wl_fixed_from_int(device_y);
+ tx = width - device_x;
+ ty = device_y;
break;
case WL_OUTPUT_TRANSFORM_FLIPPED_90:
- tx = width - wl_fixed_from_int(device_y);
- ty = height - wl_fixed_from_int(device_x);
+ tx = width - device_y;
+ ty = height - device_x;
break;
case WL_OUTPUT_TRANSFORM_FLIPPED_180:
- tx = wl_fixed_from_int(device_x);
- ty = height - wl_fixed_from_int(device_y);
+ tx = device_x;
+ ty = height - device_y;
break;
case WL_OUTPUT_TRANSFORM_FLIPPED_270:
- tx = wl_fixed_from_int(device_y);
- ty = wl_fixed_from_int(device_x);
+ tx = device_y;
+ ty = device_x;
break;
}