Remove the GTimer used by clutter_get_timestamp()

Use g_get_monotonic_time() instead, which does the right thing.
This commit is contained in:
Emmanuele Bassi 2011-11-15 15:34:51 +00:00
parent f63891f030
commit 8b2df7ced9
2 changed files with 2 additions and 22 deletions

View File

@ -1393,11 +1393,6 @@ clutter_context_get_default_unlocked (void)
ctx->settings = clutter_settings_get_default (); ctx->settings = clutter_settings_get_default ();
_clutter_settings_set_backend (ctx->settings, ctx->backend); _clutter_settings_set_backend (ctx->settings, ctx->backend);
#ifdef CLUTTER_ENABLE_DEBUG
ctx->timer = g_timer_new ();
g_timer_start (ctx->timer);
#endif
ctx->motion_events_per_actor = TRUE; ctx->motion_events_per_actor = TRUE;
ctx->last_repaint_id = 1; ctx->last_repaint_id = 1;
} }
@ -1431,21 +1426,9 @@ gulong
clutter_get_timestamp (void) clutter_get_timestamp (void)
{ {
#ifdef CLUTTER_ENABLE_DEBUG #ifdef CLUTTER_ENABLE_DEBUG
ClutterMainContext *ctx; return (gulong) g_get_monotonic_time ();
gdouble seconds;
_clutter_context_lock ();
ctx = clutter_context_get_default_unlocked ();
/* FIXME: may need a custom timer for embedded setups */
seconds = g_timer_elapsed (ctx->timer, NULL);
_clutter_context_unlock ();
return (gulong)(seconds / 1.0e-6);
#else #else
return 0; return 0L;
#endif #endif
} }

View File

@ -134,9 +134,6 @@ struct _ClutterMainContext
/* the main event queue */ /* the main event queue */
GQueue *events_queue; GQueue *events_queue;
/* timer used to print the FPS count */
GTimer *timer;
ClutterPickMode pick_mode; ClutterPickMode pick_mode;
/* mapping between reused integer ids and actors */ /* mapping between reused integer ids and actors */