[weston] ivi-layout: apply opacity to weston_view correctly

Submitted by Nobuhiko Tanibata on Dec. 26, 2015, 2:52 p.m.

Details

Message ID 1451141571-18588-1-git-send-email-nobuhiko_tanibata@xddp.denso.co.jp
State Accepted
Commit 90c2789e8d83a5b090cf4b91a6770a93f08028a0
Headers show
Series "ivi-layout: apply opacity to weston_view correctly" ( rev: 1 ) in Wayland (DEPRECATED)

Not browsing as part of any series.

Commit Message

Nobuhiko Tanibata Dec. 26, 2015, 2:52 p.m.
From: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>

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>

---
 ivi-shell/ivi-layout.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Patch hide | download patch | download mbox

diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
index b90a437..3de1405 100644
--- a/ivi-shell/ivi-layout.c
+++ b/ivi-shell/ivi-layout.c
@@ -325,12 +325,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

Comments

On Sat, 26 Dec 2015 23:52:51 +0900
Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp> wrote:

> From: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
> 
> 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>
> 
> ---
>  ivi-shell/ivi-layout.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
> index b90a437..3de1405 100644
> --- a/ivi-shell/ivi-layout.c
> +++ b/ivi-shell/ivi-layout.c
> @@ -325,12 +325,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

Hi,

looks fine by me, and is a very low-risk fix, so pushed even when we
are at beta now:
   0cc4e98..90c2789  master -> master


Thanks,
pq