diff options
author | Rajendraprasad K J <KarammelJayakumar.Rajendraprasad@in.bosch.com> | 2020-03-26 13:36:10 +0100 |
---|---|---|
committer | Rajendraprasad K J <KarammelJayakumar.Rajendraprasad@in.bosch.com> | 2020-03-26 13:36:10 +0100 |
commit | f70247cb327379e3cd1bd4cf79ee9b4dcfbfed8a (patch) | |
tree | 987dd66649ff8aedc886444bbd35fed7e924b97d | |
parent | 8815ae5fcd11f3cfa53f8a7bda134e771143f3c3 (diff) | |
download | wayland-ivi-extension-f70247cb327379e3cd1bd4cf79ee9b4dcfbfed8a.tar.gz |
ivi-controller: Avoid unnecessary scaling of the view transformation matrix
The opaque region of a weston view is updated only if the alpha value is 1
and the transform matrix is of type WESTON_MATRIX_TRANSFORM_TRANSLATE.
Here opaque region is never updated, as we are performing scaling operations
to the view transform matrix(even when the scaling factor is 1), thus
changing the matrix type to WESTON_MATRIX_TRANSFORM_SCALE.
As a result, views are never opaque and won't be able to place it in
HW planes(forced to use renderer).
Perform scaling of the view transformation matrix only when the scaling
factor is non-zero.
Signed-off-by: Rajendraprasad K J <KarammelJayakumar.Rajendraprasad@in.bosch.com>
-rw-r--r-- | weston-ivi-shell/src/ivi-controller.c | 10 |
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 87ebd2e..d6f8ae5 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; |