ivi-layout: apply opacity to weston_view correctly
authorNobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Sat, 26 Dec 2015 14:52:51 +0000 (23:52 +0900)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Wed, 3 Feb 2016 12:29:03 +0000 (14:29 +0200)
update_opacity is only called when a ivi-surface is visible. But the
previous code also checks event masks redundantly. However if the event
happens when ivi-surface is invisible, opacity is not calculated. This
patch removes this redundant check to fix potential bug.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
ivi-shell/ivi-layout.c

index 4ad7a5f..f7c4f27 100644 (file)
@@ -322,12 +322,9 @@ update_opacity(struct ivi_layout_layer *ivilayer,
        double layer_alpha = wl_fixed_to_double(ivilayer->prop.opacity);
        double surf_alpha  = wl_fixed_to_double(ivisurf->prop.opacity);
 
-       if ((ivilayer->event_mask & IVI_NOTIFICATION_OPACITY) ||
-           (ivisurf->event_mask  & IVI_NOTIFICATION_OPACITY)) {
-               tmpview = get_weston_view(ivisurf);
-               assert(tmpview != NULL);
-               tmpview->alpha = layer_alpha * surf_alpha;
-       }
+       tmpview = get_weston_view(ivisurf);
+       assert(tmpview != NULL);
+       tmpview->alpha = layer_alpha * surf_alpha;
 }
 
 static void