[PATCH 1/2] animation: zoom: don't start animation with alpha set to 0

Kristian Høgsberg hoegsberg at gmail.com
Wed Feb 27 13:08:30 PST 2013


On Sun, Feb 24, 2013 at 06:43:33AM +0100, Rune K. Svendsen wrote:
> From: "Rune K. Svendsen" <runesvend at gmail.com>
> 
> I was doing some research on why I thought enabling the zoom/fade
> animations added latency (a gap between releasing the launcher
> button and the window appearing), and I found out that it's because,
> for the first few frames, the alpha value is set to zero due to the
> spring value being zero for the first few frames. This effectively
> causes the first few frames to be invisible, and so, delays the
> animation by about 20-30 ms. Making sure the alpha value has a
> minimum value to begin with, makes opening new windows feel more
> responsive when the animation is enabled.

I'm not sure about these two.  I think we should try to tweak the
animation to be faster instead.  Starting at 0.3 alpha feels a little
bit like it pops into view and then fades the rest of the way to 1.0.

Kristian

> ---
>  src/animation.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/animation.c b/src/animation.c
> index 9e2ad4e..e86fda3 100644
> --- a/src/animation.c
> +++ b/src/animation.c
> @@ -214,6 +214,9 @@ zoom_frame(struct weston_surface_animation *animation)
>  				0.5f * es->geometry.height, 0);
>  
>  	es->alpha = animation->spring.current;
> +	//starting with alpha set to 0 will cause the first frames to be invisible.
> +	if (es->alpha < 0.3)
> +		es->alpha = 0.3;
>  	if (es->alpha > 1.0)
>  		es->alpha = 1.0;
>  }
> -- 
> 1.7.10.4
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list