Count timeline frames using the FPS instead of an integer interval

Bug 1495 - Timelines run 4% short

Previously the timelines were timed by calculating the interval
between each frame stored as an integer number of milliseconds so some
precision is lost. For example, requesting 60 frames per second gets
converted to 16 ms per frame which is actually 62.5 frames per
second. This makes the timeline shorter by 4%.

This patch merges the common code for timing from the timeout pools
and frame sources into an internal clutter-timeout-interval file. This
stores the interval directly as the FPS and counts the number of
frames that have been reached instead of the elapsed time.
This commit is contained in:
Neil Roberts
2009-03-09 17:12:27 +00:00
parent 2c1c836417
commit a93a93d007
10 changed files with 243 additions and 159 deletions

View File

@ -32,12 +32,12 @@
G_BEGIN_DECLS
guint clutter_frame_source_add (guint interval,
guint clutter_frame_source_add (guint fps,
GSourceFunc func,
gpointer data);
guint clutter_frame_source_add_full (gint priority,
guint interval,
guint fps,
GSourceFunc func,
gpointer data,
GDestroyNotify notify);