[clutter] Remove the GTimer used by clutter_get_timestamp()



commit 8b2df7ced9e0be99cc9bc56678ad12ba614d75de
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Tue Nov 15 15:34:51 2011 +0000

    Remove the GTimer used by clutter_get_timestamp()
    
    Use g_get_monotonic_time() instead, which does the right thing.

 clutter/clutter-main.c    |   21 ++-------------------
 clutter/clutter-private.h |    3 ---
 2 files changed, 2 insertions(+), 22 deletions(-)
---
diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c
index ca46633..bc7f369 100644
--- a/clutter/clutter-main.c
+++ b/clutter/clutter-main.c
@@ -1393,11 +1393,6 @@ clutter_context_get_default_unlocked (void)
       ctx->settings = clutter_settings_get_default ();
       _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->last_repaint_id = 1;
     }
@@ -1431,21 +1426,9 @@ gulong
 clutter_get_timestamp (void)
 {
 #ifdef CLUTTER_ENABLE_DEBUG
-  ClutterMainContext *ctx;
-  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);
+  return (gulong) g_get_monotonic_time ();
 #else
-  return 0;
+  return 0L;
 #endif
 }
 
diff --git a/clutter/clutter-private.h b/clutter/clutter-private.h
index 30ea65f..1740c69 100644
--- a/clutter/clutter-private.h
+++ b/clutter/clutter-private.h
@@ -134,9 +134,6 @@ struct _ClutterMainContext
   /* the main event queue */
   GQueue *events_queue;
 
-  /* timer used to print the FPS count */
-  GTimer *timer;
-
   ClutterPickMode  pick_mode;
 
   /* mapping between reused integer ids and actors */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]