mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 00:20:42 -05:00
ensure next iteration
Added an internal clutter function, _clutter_master_clock_ensure_next_iteration that ensures another iteration of the master clock, can be called from repaint functions as well as other threads.
This commit is contained in:
parent
e2c4a2a9f8
commit
211bf79854
@ -68,6 +68,7 @@ struct _ClutterMasterClock
|
|||||||
GSource *source;
|
GSource *source;
|
||||||
|
|
||||||
guint updated_stages : 1;
|
guint updated_stages : 1;
|
||||||
|
guint ensure_next_iteration : 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _ClutterMasterClockClass
|
struct _ClutterMasterClockClass
|
||||||
@ -125,6 +126,12 @@ master_clock_is_running (ClutterMasterClock *master_clock)
|
|||||||
_clutter_stage_needs_update (l->data))
|
_clutter_stage_needs_update (l->data))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
if (master_clock->ensure_next_iteration)
|
||||||
|
{
|
||||||
|
master_clock->ensure_next_iteration = FALSE;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -322,6 +329,7 @@ clutter_master_clock_init (ClutterMasterClock *self)
|
|||||||
self->source = source;
|
self->source = source;
|
||||||
|
|
||||||
self->updated_stages = TRUE;
|
self->updated_stages = TRUE;
|
||||||
|
self->ensure_next_iteration = FALSE;
|
||||||
|
|
||||||
g_source_set_priority (source, CLUTTER_PRIORITY_REDRAW);
|
g_source_set_priority (source, CLUTTER_PRIORITY_REDRAW);
|
||||||
g_source_set_can_recurse (source, FALSE);
|
g_source_set_can_recurse (source, FALSE);
|
||||||
@ -428,3 +436,18 @@ _clutter_master_clock_advance (ClutterMasterClock *master_clock)
|
|||||||
clutter_timeline_do_tick (l->data, &master_clock->cur_tick);
|
clutter_timeline_do_tick (l->data, &master_clock->cur_tick);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* _clutter_master_clock_ensure_next_iteration:
|
||||||
|
* @master_clock: a #ClutterMasterClock
|
||||||
|
*
|
||||||
|
* Ensures that the master clock will run at least one iteration
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
_clutter_master_clock_ensure_next_iteration (ClutterMasterClock *master_clock)
|
||||||
|
{
|
||||||
|
g_return_if_fail (CLUTTER_IS_MASTER_CLOCK (master_clock));
|
||||||
|
|
||||||
|
master_clock->ensure_next_iteration = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@ void _clutter_master_clock_remove_timeline (ClutterMasterClock *m
|
|||||||
ClutterTimeline *timeline);
|
ClutterTimeline *timeline);
|
||||||
void _clutter_master_clock_advance (ClutterMasterClock *master_clock);
|
void _clutter_master_clock_advance (ClutterMasterClock *master_clock);
|
||||||
void _clutter_master_clock_start_running (ClutterMasterClock *master_clock);
|
void _clutter_master_clock_start_running (ClutterMasterClock *master_clock);
|
||||||
|
void _clutter_master_clock_ensure_next_iteration (ClutterMasterClock *master_clock);
|
||||||
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
Loading…
Reference in New Issue
Block a user