于 2012/4/25 19:09, [email protected] 写道:
From: Juan Zhao<[email protected]>

To ful-fill user experience, add the fading-in animation
when mapping a window.
v2: update that westom_surface_damage to repaint
     remove that transform part in fade struct

Signed-off-by: Juan Zhao<[email protected]>
---


  src/util.c |   85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  1 files changed, 85 insertions(+), 0 deletions(-)

diff --git a/src/util.c b/src/util.c
index c7511cf..9943820 100644
--- a/src/util.c
+++ b/src/util.c
@@ -96,6 +96,15 @@ struct weston_zoom {
        void *data;
  };

+struct weston_fade {
+       struct weston_surface *surface;
+       struct weston_animation animation;
+       struct weston_spring spring;
+       struct wl_listener listener;
+       void (*done)(struct weston_fade *fade, void *data);
+       void *data;
+};
+
  static void
  weston_zoom_destroy(struct weston_zoom *zoom)
  {
@@ -325,3 +334,79 @@ weston_environment_get_fd(const char *env)

        return fd;
  }
+/*fade in and fade out animation*/
+static void
+weston_fade_destroy(struct weston_fade *fade)
+{
+       wl_list_remove(&fade->animation.link);
+       wl_list_remove(&fade->listener.link);
+       fade->surface->geometry.dirty = 1;
should we set the surface->alpha to 255 explicitly here? It seems that weston_spring_done() may not guarantee that spring.current > 1.0 when done.
+       if (fade->done)
+               fade->done(fade, fade->data);
+       free(fade);
+}
+



_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to