[clutter/clutter-1.18] tests: Use an internal setter for disabling vblank sync



commit b1eb412c2307c6eb31792ed1b387bdcf04fd027f
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu Dec 12 18:11:03 2013 +0000

    tests: Use an internal setter for disabling vblank sync
    
    Instead of using g_setenv().

 clutter/clutter-main.c       |    6 ++++++
 clutter/clutter-private.h    |    1 +
 clutter/clutter-test-utils.c |    8 ++++----
 3 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c
index 6363ad9..925a77a 100644
--- a/clutter/clutter-main.c
+++ b/clutter/clutter-main.c
@@ -3948,6 +3948,12 @@ clutter_check_windowing_backend (const char *backend_type)
   return FALSE;
 }
 
+void
+_clutter_set_sync_to_vblank (gboolean sync_to_vblank)
+{
+  clutter_sync_to_vblank = !!sync_to_vblank;
+}
+
 gboolean
 _clutter_get_sync_to_vblank (void)
 {
diff --git a/clutter/clutter-private.h b/clutter/clutter-private.h
index 6515492..c9d406a 100644
--- a/clutter/clutter-private.h
+++ b/clutter/clutter-private.h
@@ -231,6 +231,7 @@ void            _clutter_id_to_color            (guint         id,
 ClutterActor *  _clutter_get_actor_by_id        (ClutterStage *stage,
                                                  guint32       actor_id);
 
+void            _clutter_set_sync_to_vblank     (gboolean      sync_to_vblank);
 gboolean        _clutter_get_sync_to_vblank     (void);
 
 /* use this function as the accumulator if you have a signal with
diff --git a/clutter/clutter-test-utils.c b/clutter/clutter-test-utils.c
index 65df093..2a70436 100644
--- a/clutter/clutter-test-utils.c
+++ b/clutter/clutter-test-utils.c
@@ -10,6 +10,7 @@
 #include "clutter-event.h"
 #include "clutter-keysyms.h"
 #include "clutter-main.h"
+#include "clutter-private.h"
 #include "clutter-stage.h"
 
 typedef struct {
@@ -54,11 +55,10 @@ clutter_test_init (int    *argc,
     }
 #endif
 
-  /* by explicitly setting CLUTTER_VBLANK to "none" we disable the
-   * synchronisation, and run the master clock using a 60 fps timer
-   * instead.
+  /* we explicitly disable the synchronisation to the vertical refresh
+   * rate, and run the master clock using a 60 fps timer instead.
    */
-  g_setenv ("CLUTTER_VBLANK", "none", FALSE);
+  _clutter_set_sync_to_vblank (FALSE);
 
   g_test_init (argc, argv, NULL);
   g_test_bug_base ("https://bugzilla.gnome.org/show_bug.cgi?id=%s";);


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