mirror of
https://github.com/brl/mutter.git
synced 2024-12-28 05:42:14 +00:00
timeline: Add an internal function for advancing a timeline
There are cases when we want to advance a timeline from another time source. We cannot use _clutter_timeline_do_tick() directly, as that assumes that the timeline is already playing, so we'll need to create a wrapper that toggles the playing flag around it.
This commit is contained in:
parent
270894342e
commit
edfe618174
@ -44,6 +44,9 @@ void _clutter_master_clock_remove_timeline (Clutter
|
||||
void _clutter_master_clock_start_running (ClutterMasterClock *master_clock);
|
||||
void _clutter_master_clock_ensure_next_iteration (ClutterMasterClock *master_clock);
|
||||
|
||||
void _clutter_timeline_advance (ClutterTimeline *timeline,
|
||||
gint64 tick_time);
|
||||
gint64 _clutter_timeline_get_delta (ClutterTimeline *timeline);
|
||||
void _clutter_timeline_do_tick (ClutterTimeline *timeline,
|
||||
gint64 tick_time);
|
||||
|
||||
|
@ -875,6 +875,8 @@ emit_frame_signal (ClutterTimeline *timeline)
|
||||
/* see bug https://bugzilla.gnome.org/show_bug.cgi?id=654066 */
|
||||
gint elapsed = (gint) priv->elapsed_time;
|
||||
|
||||
CLUTTER_NOTE (SCHEDULER, "Emitting ::new-frame signal on timeline[%p]", timeline);
|
||||
|
||||
g_signal_emit (timeline, timeline_signals[NEW_FRAME], 0, elapsed);
|
||||
}
|
||||
|
||||
@ -923,7 +925,7 @@ clutter_timeline_do_frame (ClutterTimeline *timeline)
|
||||
|
||||
g_object_ref (timeline);
|
||||
|
||||
CLUTTER_NOTE (SCHEDULER, "Timeline [%p] activated (cur: %ld)\n",
|
||||
CLUTTER_NOTE (SCHEDULER, "Timeline [%p] activated (elapsed time: %ld)\n",
|
||||
timeline,
|
||||
(long) priv->elapsed_time);
|
||||
|
||||
@ -1577,7 +1579,25 @@ clutter_timeline_get_delta (ClutterTimeline *timeline)
|
||||
return timeline->priv->msecs_delta;
|
||||
}
|
||||
|
||||
/*
|
||||
void
|
||||
_clutter_timeline_advance (ClutterTimeline *timeline,
|
||||
gint64 tick_time)
|
||||
{
|
||||
ClutterTimelinePrivate *priv = timeline->priv;
|
||||
|
||||
g_object_ref (timeline);
|
||||
|
||||
priv->msecs_delta = tick_time;
|
||||
priv->is_playing = TRUE;
|
||||
|
||||
clutter_timeline_do_frame (timeline);
|
||||
|
||||
priv->is_playing = FALSE;
|
||||
|
||||
g_object_unref (timeline);
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* clutter_timeline_do_tick
|
||||
* @timeline: a #ClutterTimeline
|
||||
* @tick_time: time of advance
|
||||
@ -1593,8 +1613,6 @@ _clutter_timeline_do_tick (ClutterTimeline *timeline,
|
||||
{
|
||||
ClutterTimelinePrivate *priv;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_TIMELINE (timeline));
|
||||
|
||||
priv = timeline->priv;
|
||||
|
||||
/* Check the is_playing variable before performing the timeline tick.
|
||||
|
Loading…
Reference in New Issue
Block a user