summaryrefslogtreecommitdiff
path: root/src/rpi-renderer.c
diff options
context:
space:
mode:
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>2015-03-10 12:52:14 +0200
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2015-03-11 12:26:06 +0200
commitc143df1abdd54cf5f6aba55b916560f012846b28 (patch)
tree0efccd4ff078c4c0f46d33fa3ba7b7a58f65c9e5 /src/rpi-renderer.c
parent87535e24c24ddfac2c08ee2416c23cd071b6a0f9 (diff)
downloadweston-c143df1abdd54cf5f6aba55b916560f012846b28.tar.gz
rpi-renderer: minimal fix to zoom coordinates
The patch "zoom: Use pixels instead of GL coordinates" changed the meaning of weston_output_zoom::trans_x,trans_y from GL coordinate system to global coordinates. This patch is a minimal untested change to the rpi-renderer to try and follow up on that change. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-By: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Diffstat (limited to 'src/rpi-renderer.c')
-rw-r--r--src/rpi-renderer.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/rpi-renderer.c b/src/rpi-renderer.c
index 94d04240..b6cf125c 100644
--- a/src/rpi-renderer.c
+++ b/src/rpi-renderer.c
@@ -1325,10 +1325,11 @@ output_compute_matrix(struct weston_output *base)
{
struct rpir_output *output = to_rpir_output(base);
struct weston_matrix *matrix = &output->matrix;
+#ifdef SURFACE_TRANSFORM
const float half_w = 0.5f * base->width;
const float half_h = 0.5f * base->height;
+#endif
float mag;
- float dx, dy;
weston_matrix_init(matrix);
weston_matrix_translate(matrix, -base->x, -base->y, 0.0f);
@@ -1370,13 +1371,10 @@ output_compute_matrix(struct weston_output *base)
#endif
if (base->zoom.active) {
- /* The base->zoom stuff is in GL coordinate system */
mag = 1.0f / (1.0f - base->zoom.spring_z.current);
- dx = -(base->zoom.trans_x + 1.0f) * half_w;
- dy = -(base->zoom.trans_y + 1.0f) * half_h;
- weston_matrix_translate(matrix, dx, dy, 0.0f);
+ weston_matrix_translate(matrix, base->zoom.trans_x,
+ base->zoom.trans_y, 0.0f);
weston_matrix_scale(matrix, mag, mag, 1.0f);
- weston_matrix_translate(matrix, half_w, half_h, 0.0f);
}
}