[PATCH weston 2/4] Add weston_animation_exists().
Scott Moreau
oreaus at gmail.com
Thu Jun 7 15:02:10 PDT 2012
On Thu, Jun 7, 2012 at 3:15 PM, Kristian Høgsberg <hoegsberg at gmail.com>wrote:
> On Thu, Jun 07, 2012 at 09:12:30AM -0600, Scott Moreau wrote:
> > ---
> > src/compositor.c | 8 +++++++-
> > src/compositor.h | 2 ++
> > 2 files changed, 9 insertions(+), 1 deletions(-)
> >
> > diff --git a/src/compositor.c b/src/compositor.c
> > index 9110d4c..7f51424 100644
> > --- a/src/compositor.c
> > +++ b/src/compositor.c
> > @@ -980,6 +980,12 @@ fade_frame(struct weston_animation *animation,
> > }
> > }
> >
> > +WL_EXPORT int
> > +weston_animation_exists(struct weston_animation *animation)
>
> Call it weston_animation_running() instead?
>
Yes, I think this would be much better.
>
> > +{
> > + return wl_list_empty(&animation->link) ? 0 : 1;
> > +}
> > +
> > WL_EXPORT void
> > weston_animation_run(struct weston_compositor *compositor,
> > struct weston_output *output,
> > @@ -1204,7 +1210,7 @@ weston_compositor_fade(struct weston_compositor
> *compositor, float tint)
> > }
> >
> > weston_surface_damage(compositor->fade.surface);
> > - if (wl_list_empty(&compositor->fade.animation.link))
> > + if (!weston_animation_exists(&compositor->fade.animation))
> > weston_animation_run(compositor, NULL,
> > &compositor->fade.animation);
> > }
> > diff --git a/src/compositor.h b/src/compositor.h
> > index 30cb7bb..69bbbc4 100644
> > --- a/src/compositor.h
> > +++ b/src/compositor.h
> > @@ -534,6 +534,8 @@ weston_compositor_activity(struct weston_compositor
> *compositor);
> > void
> > weston_compositor_update_drag_surfaces(struct weston_compositor
> *compositor);
> >
> > +int
> > +weston_animation_exists(struct weston_animation *animation);
> > void
> > weston_animation_run(struct weston_compositor *compositor,
> > struct weston_output *output,
> > --
> > 1.7.7.6
> >
> > _______________________________________________
> > wayland-devel mailing list
> > wayland-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20120607/bef41139/attachment.htm>
More information about the wayland-devel
mailing list