Beispiel #1
0
static void
idle_animation_destroy(void *data)
{
	struct weston_view_animation *animation = data;

	weston_view_animation_destroy(animation);
}
Beispiel #2
0
static void
weston_view_animation_frame(struct weston_animation *base,
			    struct weston_output *output, uint32_t msecs)
{
	struct weston_view_animation *animation =
		container_of(base,
			     struct weston_view_animation, animation);

	if (base->frame_counter <= 1)
		animation->spring.timestamp = msecs;

	weston_spring_update(&animation->spring, msecs);

	if (weston_spring_done(&animation->spring)) {
		weston_view_schedule_repaint(animation->view);
		weston_view_animation_destroy(animation);
		return;
	}

	if (animation->frame)
		animation->frame(animation);

	weston_view_geometry_dirty(animation->view);
	weston_view_schedule_repaint(animation->view);
}
Beispiel #3
0
static void
handle_animation_view_destroy(struct wl_listener *listener, void *data)
{
	struct weston_view_animation *animation =
		container_of(listener,
			     struct weston_view_animation, listener);

	weston_view_animation_destroy(animation);
}
Beispiel #4
0
static void
weston_view_animation_frame(struct weston_animation *base,
			    struct weston_output *output, uint32_t msecs)
{
	struct weston_view_animation *animation =
		container_of(base,
			     struct weston_view_animation, animation);
	struct weston_compositor *compositor =
		animation->view->surface->compositor;

	if (base->frame_counter <= 1)
		animation->spring.timestamp = msecs;

	weston_spring_update(&animation->spring, msecs);

	if (weston_spring_done(&animation->spring)) {
		weston_view_schedule_repaint(animation->view);
		weston_view_animation_destroy(animation);
		return;
	}

	if (animation->frame)
		animation->frame(animation);

	weston_view_geometry_dirty(animation->view);
	weston_view_schedule_repaint(animation->view);

	/* The view's output_mask will be zero if its position is
	 * offscreen. Animations should always run but as they are also
	 * run off the repaint cycle, if there's nothing to repaint
	 * the animation stops running. Therefore if we catch this situation
	 * and schedule a repaint on all outputs it will be avoided.
	 */
	if (animation->view->output_mask == 0)
		weston_compositor_schedule_repaint(compositor);
}