summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugen Friedrich <efriedrich@de.adit-jv.com>2020-09-10 22:46:03 +0200
committerEugen Friedrich <efriedrich@de.adit-jv.com>2020-09-10 22:46:03 +0200
commitcfdb7a7402a12600daedddb46da2e360359cc05b (patch)
tree9b1286e06d5a8b8b371cc48f7e2d2e79647bc64f
parent9bc63f152c48c5078bca8353c8d8f30293603257 (diff)
parentf70247cb327379e3cd1bd4cf79ee9b4dcfbfed8a (diff)
downloadwayland-ivi-extension-cfdb7a7402a12600daedddb46da2e360359cc05b.tar.gz
Merge remote-tracking branch 'upstream/pull/116'
* upstream/pull/116 ivi-controller: Avoid unnecessary scaling of the view transformation matrix Reviewed-by: Eugen Friedrich <efriedrich@de.adit-jv.com>
-rw-r--r--weston-ivi-shell/src/ivi-controller.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/weston-ivi-shell/src/ivi-controller.c b/weston-ivi-shell/src/ivi-controller.c
index 69f0cda..cabd31b 100644
--- a/weston-ivi-shell/src/ivi-controller.c
+++ b/weston-ivi-shell/src/ivi-controller.c
@@ -838,10 +838,14 @@ calc_trans_matrix(struct weston_geometry *source_rect,
source_center_y = source_rect->y + source_rect->height * 0.5f;
weston_matrix_translate(m, -source_center_x, -source_center_y, 0.0f);
- scale_x = ((float)dest_rect->width) / source_rect->width;
- scale_y = ((float)dest_rect->height) / source_rect->height;
+ if ((dest_rect->width != source_rect->width) ||
+ (dest_rect->height != source_rect->height))
+ {
+ scale_x = ((float)dest_rect->width) / source_rect->width;
+ scale_y = ((float)dest_rect->height) / source_rect->height;
- weston_matrix_scale(m, scale_x, scale_y, 1.0f);
+ weston_matrix_scale(m, scale_x, scale_y, 1.0f);
+ }
translate_x = dest_rect->width * 0.5f + dest_rect->x;
translate_y = dest_rect->height * 0.5f + dest_rect->y;