mirror of
https://github.com/brl/mutter.git
synced 2025-02-16 13:24:09 +00:00
clutter/timeline: Add helpers to remove/add timeline to some frame clock
Either the master clock or assigned frame clock. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
This commit is contained in:
parent
a0d87662f7
commit
f31a7acab5
@ -512,6 +512,42 @@ clutter_timeline_get_property (GObject *object,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
add_timeline (ClutterTimeline *timeline)
|
||||||
|
{
|
||||||
|
ClutterTimelinePrivate *priv = timeline->priv;
|
||||||
|
|
||||||
|
if (priv->frame_clock)
|
||||||
|
{
|
||||||
|
clutter_frame_clock_add_timeline (priv->frame_clock, timeline);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ClutterMasterClock *master_clock;
|
||||||
|
|
||||||
|
master_clock = _clutter_master_clock_get_default ();
|
||||||
|
_clutter_master_clock_add_timeline (master_clock, timeline);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
remove_timeline (ClutterTimeline *timeline)
|
||||||
|
{
|
||||||
|
ClutterTimelinePrivate *priv = timeline->priv;
|
||||||
|
|
||||||
|
if (priv->frame_clock)
|
||||||
|
{
|
||||||
|
clutter_frame_clock_remove_timeline (priv->frame_clock, timeline);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ClutterMasterClock *master_clock;
|
||||||
|
|
||||||
|
master_clock = _clutter_master_clock_get_default ();
|
||||||
|
_clutter_master_clock_remove_timeline (master_clock, timeline);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
clutter_timeline_finalize (GObject *object)
|
clutter_timeline_finalize (GObject *object)
|
||||||
{
|
{
|
||||||
@ -522,19 +558,7 @@ clutter_timeline_finalize (GObject *object)
|
|||||||
g_hash_table_destroy (priv->markers_by_name);
|
g_hash_table_destroy (priv->markers_by_name);
|
||||||
|
|
||||||
if (priv->is_playing)
|
if (priv->is_playing)
|
||||||
{
|
remove_timeline (self);
|
||||||
if (priv->frame_clock)
|
|
||||||
{
|
|
||||||
clutter_frame_clock_remove_timeline (priv->frame_clock, self);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ClutterMasterClock *master_clock;
|
|
||||||
|
|
||||||
master_clock = _clutter_master_clock_get_default ();
|
|
||||||
_clutter_master_clock_remove_timeline (master_clock, self);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
g_clear_object (&priv->frame_clock);
|
g_clear_object (&priv->frame_clock);
|
||||||
|
|
||||||
@ -971,24 +995,12 @@ set_is_playing (ClutterTimeline *timeline,
|
|||||||
{
|
{
|
||||||
priv->waiting_first_tick = TRUE;
|
priv->waiting_first_tick = TRUE;
|
||||||
priv->current_repeat = 0;
|
priv->current_repeat = 0;
|
||||||
}
|
|
||||||
|
|
||||||
if (priv->frame_clock)
|
add_timeline (timeline);
|
||||||
{
|
|
||||||
if (priv->is_playing)
|
|
||||||
clutter_frame_clock_add_timeline (priv->frame_clock, timeline);
|
|
||||||
else
|
|
||||||
clutter_frame_clock_remove_timeline (priv->frame_clock, timeline);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ClutterMasterClock *master_clock;
|
remove_timeline (timeline);
|
||||||
|
|
||||||
master_clock = _clutter_master_clock_get_default ();
|
|
||||||
if (priv->is_playing)
|
|
||||||
_clutter_master_clock_add_timeline (master_clock, timeline);
|
|
||||||
else
|
|
||||||
_clutter_master_clock_remove_timeline (master_clock, timeline);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user