From 9206bd7627e64a26784a4d6e3d66056f14db12e8 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 25 Jan 2012 23:09:38 +0000 Subject: [PATCH] tests/*: Use symbolic constants for sources and events And make sure to use clutter_threads_add_* instead of the bare g_*_add(). --- tests/conform/test-anchors.c | 4 ++-- tests/conform/test-clutter-cairo-texture.c | 4 ++-- tests/conform/test-cogl-backface-culling.c | 4 ++-- tests/conform/test-cogl-blend-strings.c | 4 ++-- tests/conform/test-cogl-depth-test.c | 4 ++-- tests/conform/test-cogl-materials.c | 4 ++-- tests/conform/test-cogl-multitexture.c | 4 ++-- tests/conform/test-cogl-npot-texture.c | 4 ++-- tests/conform/test-cogl-offscreen.c | 4 ++-- tests/conform/test-offscreen-redirect.c | 4 ++-- tests/conform/test-pick.c | 7 +++--- tests/conform/test-texture-fbo.c | 4 ++-- tests/conform/test-timeline-rewind.c | 12 +++++----- tests/interactive/test-cogl-point-sprites.c | 7 +++--- tests/interactive/test-cogl-shader-arbfp.c | 20 ++++++++--------- tests/interactive/test-cogl-shader-glsl.c | 35 +++++++++++++++-------------- tests/interactive/test-depth.c | 10 ++++----- tests/interactive/test-pixmap.c | 12 +++++----- tests/interactive/test-shader.c | 6 ++--- tests/micro-bench/test-text-perf.c | 4 ++-- tests/micro-bench/test-text.c | 4 ++-- tests/performance/test-common.h | 4 ++-- tests/performance/test-text-perf.c | 5 +++-- 23 files changed, 88 insertions(+), 82 deletions(-) diff --git a/tests/conform/test-anchors.c b/tests/conform/test-anchors.c index 238c390..9cb129e 100644 --- a/tests/conform/test-anchors.c +++ b/tests/conform/test-anchors.c @@ -668,7 +668,7 @@ idle_cb (gpointer data) clutter_main_quit (); - return FALSE; + return G_SOURCE_REMOVE; } void @@ -691,7 +691,7 @@ actor_anchors (void) /* Run the tests in a low priority idle function so that we can be sure the stage is correctly setup */ - g_idle_add_full (G_PRIORITY_LOW, idle_cb, &state, NULL); + clutter_threads_add_idle_full (G_PRIORITY_LOW, idle_cb, &state, NULL); clutter_actor_show (stage); diff --git a/tests/conform/test-clutter-cairo-texture.c b/tests/conform/test-clutter-cairo-texture.c index 4c87fcb..d066c2e 100644 --- a/tests/conform/test-clutter-cairo-texture.c +++ b/tests/conform/test-clutter-cairo-texture.c @@ -157,7 +157,7 @@ idle_cb (gpointer data) break; } - return TRUE; + return G_SOURCE_CONTINUE; } void @@ -180,7 +180,7 @@ test_clutter_cairo_texture (TestConformSimpleFixture *fixture, /* We force continuous redrawing of the stage, since we need to skip * the first few frames, and we wont be doing anything else that * will trigger redrawing. */ - idle_source = g_idle_add (idle_cb, &state); + idle_source = clutter_threads_add_idle (idle_cb, &state); paint_handler = g_signal_connect_after (state.stage, "paint", G_CALLBACK (paint_cb), &state); diff --git a/tests/conform/test-cogl-backface-culling.c b/tests/conform/test-cogl-backface-culling.c index 5f139bf..8ae6423 100644 --- a/tests/conform/test-cogl-backface-culling.c +++ b/tests/conform/test-cogl-backface-culling.c @@ -253,7 +253,7 @@ queue_redraw (gpointer stage) { clutter_actor_queue_redraw (CLUTTER_ACTOR (stage)); - return TRUE; + return G_SOURCE_CONTINUE; } static CoglHandle @@ -319,7 +319,7 @@ test_cogl_backface_culling (TestConformSimpleFixture *fixture, /* We force continuous redrawing of the stage, since we need to skip * the first few frames, and we wont be doing anything else that * will trigger redrawing. */ - idle_source = g_idle_add (queue_redraw, stage); + idle_source = clutter_threads_add_idle (queue_redraw, stage); g_signal_connect (group, "paint", G_CALLBACK (on_paint), &state); diff --git a/tests/conform/test-cogl-blend-strings.c b/tests/conform/test-cogl-blend-strings.c index a2a6837..f330869 100644 --- a/tests/conform/test-cogl-blend-strings.c +++ b/tests/conform/test-cogl-blend-strings.c @@ -393,7 +393,7 @@ queue_redraw (gpointer stage) { clutter_actor_queue_redraw (CLUTTER_ACTOR (stage)); - return TRUE; + return G_SOURCE_CONTINUE; } void @@ -416,7 +416,7 @@ test_cogl_blend_strings (TestConformSimpleFixture *fixture, /* We force continuous redrawing incase someone comments out the * clutter_main_quit and wants visual feedback for the test since we * wont be doing anything else that will trigger redrawing. */ - idle_source = g_idle_add (queue_redraw, stage); + idle_source = clutter_threads_add_idle (queue_redraw, stage); g_signal_connect (group, "paint", G_CALLBACK (on_paint), &state); diff --git a/tests/conform/test-cogl-depth-test.c b/tests/conform/test-cogl-depth-test.c index 4e2a625..1cc4060 100644 --- a/tests/conform/test-cogl-depth-test.c +++ b/tests/conform/test-cogl-depth-test.c @@ -296,7 +296,7 @@ queue_redraw (gpointer stage) { clutter_actor_queue_redraw (CLUTTER_ACTOR (stage)); - return TRUE; + return G_SOURCE_CONTINUE; } void @@ -319,7 +319,7 @@ test_cogl_depth_test (TestConformSimpleFixture *fixture, /* We force continuous redrawing incase someone comments out the * clutter_main_quit and wants visual feedback for the test since we * wont be doing anything else that will trigger redrawing. */ - idle_source = g_idle_add (queue_redraw, stage); + idle_source = clutter_threads_add_idle (queue_redraw, stage); g_signal_connect (group, "paint", G_CALLBACK (on_paint), &state); diff --git a/tests/conform/test-cogl-materials.c b/tests/conform/test-cogl-materials.c index 413849d..47aa445 100644 --- a/tests/conform/test-cogl-materials.c +++ b/tests/conform/test-cogl-materials.c @@ -319,7 +319,7 @@ queue_redraw (gpointer stage) { clutter_actor_queue_redraw (CLUTTER_ACTOR (stage)); - return TRUE; + return G_SOURCE_CONTINUE; } void @@ -344,7 +344,7 @@ test_cogl_materials (TestConformSimpleFixture *fixture, /* We force continuous redrawing of the stage, since we need to skip * the first few frames, and we wont be doing anything else that * will trigger redrawing. */ - idle_source = g_idle_add (queue_redraw, stage); + idle_source = clutter_threads_add_idle (queue_redraw, stage); g_signal_connect (group, "paint", G_CALLBACK (on_paint), &state); diff --git a/tests/conform/test-cogl-multitexture.c b/tests/conform/test-cogl-multitexture.c index ed88484..93ddd45 100644 --- a/tests/conform/test-cogl-multitexture.c +++ b/tests/conform/test-cogl-multitexture.c @@ -169,7 +169,7 @@ queue_redraw (gpointer stage) { clutter_actor_queue_redraw (CLUTTER_ACTOR (stage)); - return TRUE; + return G_SOURCE_CONTINUE; } void @@ -191,7 +191,7 @@ test_cogl_multitexture (TestConformSimpleFixture *fixture, /* We force continuous redrawing incase someone comments out the * clutter_main_quit and wants visual feedback for the test since we * wont be doing anything else that will trigger redrawing. */ - idle_source = g_idle_add (queue_redraw, stage); + idle_source = clutter_threads_add_idle (queue_redraw, stage); g_signal_connect (group, "paint", G_CALLBACK (on_paint), &state); diff --git a/tests/conform/test-cogl-npot-texture.c b/tests/conform/test-cogl-npot-texture.c index 3b21ba5..1f0d0f6 100644 --- a/tests/conform/test-cogl-npot-texture.c +++ b/tests/conform/test-cogl-npot-texture.c @@ -122,7 +122,7 @@ queue_redraw (gpointer stage) { clutter_actor_queue_redraw (CLUTTER_ACTOR (stage)); - return TRUE; + return G_SOURCE_CONTINUE; } static CoglHandle @@ -221,7 +221,7 @@ test_cogl_npot_texture (TestConformSimpleFixture *fixture, /* We force continuous redrawing of the stage, since we need to skip * the first few frames, and we wont be doing anything else that * will trigger redrawing. */ - idle_source = g_idle_add (queue_redraw, stage); + idle_source = clutter_threads_add_idle (queue_redraw, stage); g_signal_connect (group, "paint", G_CALLBACK (on_paint), &state); diff --git a/tests/conform/test-cogl-offscreen.c b/tests/conform/test-cogl-offscreen.c index 72d63f1..cef46c1 100644 --- a/tests/conform/test-cogl-offscreen.c +++ b/tests/conform/test-cogl-offscreen.c @@ -132,7 +132,7 @@ queue_redraw (gpointer stage) { clutter_actor_queue_redraw (CLUTTER_ACTOR (stage)); - return TRUE; + return G_SOURCE_CONTINUE; } void @@ -148,7 +148,7 @@ test_cogl_offscreen (TestConformSimpleFixture *fixture, /* We force continuous redrawing of the stage, since we need to skip * the first few frames, and we wont be doing anything else that * will trigger redrawing. */ - idle_source = g_idle_add (queue_redraw, stage); + idle_source = clutter_threads_add_idle (queue_redraw, stage); g_signal_connect_after (stage, "paint", G_CALLBACK (on_paint), NULL); clutter_actor_show (stage); diff --git a/tests/conform/test-offscreen-redirect.c b/tests/conform/test-offscreen-redirect.c index 62d834e..23759f8 100644 --- a/tests/conform/test-offscreen-redirect.c +++ b/tests/conform/test-offscreen-redirect.c @@ -290,7 +290,7 @@ timeout_cb (gpointer user_data) clutter_main_quit (); - return FALSE; + return G_SOURCE_REMOVE; } void @@ -333,7 +333,7 @@ test_offscreen_redirect (TestConformSimpleFixture *fixture, /* Start the test after a short delay to allow the stage to render its initial frames without affecting the results */ - g_timeout_add_full (G_PRIORITY_LOW, 250, timeout_cb, &data, NULL); + clutter_threads_add_timeout_full (G_PRIORITY_LOW, 250, timeout_cb, &data, NULL); clutter_main (); diff --git a/tests/conform/test-pick.c b/tests/conform/test-pick.c index 946033a..f293031 100644 --- a/tests/conform/test-pick.c +++ b/tests/conform/test-pick.c @@ -90,8 +90,9 @@ shift_effect_init (ShiftEffect *self) } static gboolean -on_timeout (State *state) +on_timeout (gpointer data) { + State *state = data; int test_num = 0; int y, x; ClutterActor *over_actor = NULL; @@ -235,7 +236,7 @@ on_timeout (State *state) clutter_main_quit (); - return FALSE; + return G_SOURCE_REMOVE; } void @@ -273,7 +274,7 @@ actor_picking (void) clutter_actor_show (state.stage); - g_idle_add ((GSourceFunc) on_timeout, &state); + clutter_threads_add_idle (on_timeout, &state); clutter_main (); diff --git a/tests/conform/test-texture-fbo.c b/tests/conform/test-texture-fbo.c index 4ef7b8d..fba0f68 100644 --- a/tests/conform/test-texture-fbo.c +++ b/tests/conform/test-texture-fbo.c @@ -165,7 +165,7 @@ queue_redraw (gpointer stage) { clutter_actor_queue_redraw (CLUTTER_ACTOR (stage)); - return TRUE; + return G_SOURCE_CONTINUE; } void @@ -227,7 +227,7 @@ test_texture_fbo (TestConformSimpleFixture *fixture, /* We force continuous redrawing of the stage, since we need to skip * the first few frames, and we wont be doing anything else that * will trigger redrawing. */ - g_idle_add (queue_redraw, state.stage); + clutter_threads_add_idle (queue_redraw, state.stage); g_signal_connect_after (state.stage, "paint", G_CALLBACK (on_paint), &state); clutter_actor_show_all (state.stage); diff --git a/tests/conform/test-timeline-rewind.c b/tests/conform/test-timeline-rewind.c index f9dbf91..0263649 100644 --- a/tests/conform/test-timeline-rewind.c +++ b/tests/conform/test-timeline-rewind.c @@ -14,8 +14,10 @@ typedef struct _TestState } TestState; static gboolean -watchdog_timeout (TestState *state) +watchdog_timeout (gpointer data) { + TestState *state = data; + g_test_message ("Watchdog timer kicking in"); g_test_message ("rewind_count=%i", state->rewind_count); if (state->rewind_count <= 3) @@ -30,7 +32,7 @@ watchdog_timeout (TestState *state) clutter_main_quit (); } - return FALSE; + return G_SOURCE_REMOVE; } static void @@ -77,9 +79,9 @@ timeline_rewind (void) &state); g_test_message ("Installing a watchdog timeout " "to determine if this test hangs"); - g_timeout_add (TEST_WATCHDOG_KICK_IN_SECONDS*1000, - (GSourceFunc)watchdog_timeout, - &state); + clutter_threads_add_timeout (TEST_WATCHDOG_KICK_IN_SECONDS * 1000, + watchdog_timeout, + &state); state.rewind_count = 0; clutter_timeline_start (state.timeline); diff --git a/tests/interactive/test-cogl-point-sprites.c b/tests/interactive/test-cogl-point-sprites.c index 6a18ce3..f779dcc 100644 --- a/tests/interactive/test-cogl-point-sprites.c +++ b/tests/interactive/test-cogl-point-sprites.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -213,7 +214,7 @@ idle_cb (gpointer data) { clutter_actor_queue_redraw (data); - return TRUE; + return G_SOURCE_CONTINUE; } G_MODULE_EXPORT int @@ -226,7 +227,7 @@ test_cogl_point_sprites_main (int argc, char *argv[]) int i; if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS) - return 1; + return EXIT_FAILURE; data.material = cogl_material_new (); data.last_spark_time = g_timer_new (); @@ -267,7 +268,7 @@ test_cogl_point_sprites_main (int argc, char *argv[]) clutter_actor_show (stage); - g_idle_add (idle_cb, stage); + clutter_threads_add_idle (idle_cb, stage); clutter_main (); diff --git a/tests/interactive/test-cogl-shader-arbfp.c b/tests/interactive/test-cogl-shader-arbfp.c index 62dbc70..5daca68 100644 --- a/tests/interactive/test-cogl-shader-arbfp.c +++ b/tests/interactive/test-cogl-shader-arbfp.c @@ -309,13 +309,13 @@ button_release_cb (ClutterActor *actor, set_shader_num (new_no); - return FALSE; + return CLUTTER_EVENT_STOP; } static gboolean key_release_cb (ClutterActor *actor, ClutterEvent *event, - void *user_data) + gpointer user_data) { guint keysym = clutter_event_get_key_symbol (event); ClutterModifierType mods = clutter_event_get_state (event); @@ -324,11 +324,11 @@ key_release_cb (ClutterActor *actor, ((mods & CLUTTER_SHIFT_MASK) && keysym == CLUTTER_KEY_q)) clutter_main_quit (); - return FALSE; + return CLUTTER_EVENT_STOP; } static gboolean -timeout_cb (void *user_data) +timeout_cb (gpointer user_data) { shader_no++; if (shader_no > (G_N_ELEMENTS (shaders) - 1)) @@ -336,15 +336,15 @@ timeout_cb (void *user_data) set_shader_num (shader_no); - return TRUE; + return G_SOURCE_CONTINUE; } static gboolean -idle_cb (void *data) +idle_cb (gpointer data) { clutter_actor_queue_redraw (data); - return TRUE; + return G_SOURCE_CONTINUE; } static gboolean @@ -394,11 +394,11 @@ test_cogl_shader_arbfp_main (int argc, char *argv[]) g_signal_connect (stage, "delete-event", G_CALLBACK (destroy_window_cb), NULL); - timeout_id = g_timeout_add (1000, timeout_cb, NULL); + timeout_id = clutter_threads_add_timeout (1000, timeout_cb, NULL); - g_idle_add (idle_cb, stage); + clutter_threads_add_idle (idle_cb, stage); - clutter_actor_show_all (stage); + clutter_actor_show (stage); clutter_main (); diff --git a/tests/interactive/test-cogl-shader-glsl.c b/tests/interactive/test-cogl-shader-glsl.c index 0cc00e8..406d970 100644 --- a/tests/interactive/test-cogl-shader-glsl.c +++ b/tests/interactive/test-cogl-shader-glsl.c @@ -180,10 +180,10 @@ static int shader_no = 0; static void paint_cb (ClutterActor *actor) { - int stage_width = clutter_actor_get_width (actor); - int stage_height = clutter_actor_get_height (actor); - int image_width = cogl_texture_get_width (redhand); - int image_height = cogl_texture_get_height (redhand); + float stage_width = clutter_actor_get_width (actor); + float stage_height = clutter_actor_get_height (actor); + float image_width = cogl_texture_get_width (redhand); + float image_height = cogl_texture_get_height (redhand); cogl_set_source (material); cogl_rectangle (stage_width/2.0f - image_width/2.0f, @@ -237,7 +237,7 @@ set_shader_num (int new_no) static gboolean button_release_cb (ClutterActor *actor, ClutterEvent *event, - void *data) + gpointer data) { int new_no; @@ -264,13 +264,13 @@ button_release_cb (ClutterActor *actor, set_shader_num (new_no); - return FALSE; + return CLUTTER_EVENT_STOP; } static gboolean key_release_cb (ClutterActor *actor, ClutterEvent *event, - void *user_data) + gpointer user_data) { guint keysym = clutter_event_get_key_symbol (event); ClutterModifierType mods = clutter_event_get_state (event); @@ -279,11 +279,11 @@ key_release_cb (ClutterActor *actor, ((mods & CLUTTER_SHIFT_MASK) && keysym == CLUTTER_KEY_q)) clutter_main_quit (); - return FALSE; + return CLUTTER_EVENT_STOP; } static gboolean -timeout_cb (void *user_data) +timeout_cb (gpointer user_data) { shader_no++; if (shader_no > (G_N_ELEMENTS (shaders) - 1)) @@ -291,24 +291,25 @@ timeout_cb (void *user_data) set_shader_num (shader_no); - return TRUE; + return G_SOURCE_CONTINUE; } static gboolean -idle_cb (void *data) +idle_cb (gpointer data) { clutter_actor_queue_redraw (data); - return TRUE; + return G_SOURCE_CONTINUE; } static gboolean destroy_window_cb (ClutterStage *stage, ClutterEvent *event, - void *user_data) + gpointer user_data) { clutter_main_quit (); - return TRUE; + + return CLUTTER_EVENT_STOP; } G_MODULE_EXPORT int @@ -351,11 +352,11 @@ test_cogl_shader_glsl_main (int argc, char *argv[]) g_signal_connect (stage, "delete-event", G_CALLBACK (destroy_window_cb), NULL); - timeout_id = g_timeout_add (1000, timeout_cb, NULL); + timeout_id = clutter_threads_add_timeout (1000, timeout_cb, NULL); - g_idle_add (idle_cb, stage); + clutter_threads_add_idle (idle_cb, stage); - clutter_actor_show_all (stage); + clutter_actor_show (stage); clutter_main (); diff --git a/tests/interactive/test-depth.c b/tests/interactive/test-depth.c index 94b367a..b196575 100644 --- a/tests/interactive/test-depth.c +++ b/tests/interactive/test-depth.c @@ -16,14 +16,14 @@ static ClutterActor *raise_actor[2]; static gboolean raise_no = 0; static gboolean -raise_top (gpointer ignored) +raise_top (gpointer ignored G_GNUC_UNUSED) { ClutterActor *parent = clutter_actor_get_parent (raise_actor[raise_no]); clutter_actor_set_child_above_sibling (parent, raise_actor[raise_no], NULL); raise_no = !raise_no; - return TRUE; + return G_SOURCE_CONTINUE; } static ClutterActor * @@ -106,7 +106,6 @@ janus_group (const gchar *front_text, return group; } - G_MODULE_EXPORT gint test_depth_main (int argc, char *argv[]) { @@ -118,7 +117,7 @@ test_depth_main (int argc, char *argv[]) GError *error; if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS) - return 1; + return EXIT_FAILURE; stage = clutter_stage_new (); clutter_stage_set_title (CLUTTER_STAGE (stage), "Depth Test"); @@ -153,7 +152,6 @@ test_depth_main (int argc, char *argv[]) clutter_container_add (CLUTTER_CONTAINER (group), hand, rect, NULL); clutter_container_add_actor (CLUTTER_CONTAINER (stage), label); - /* 3 seconds, at 60 fps */ timeline = clutter_timeline_new (3000); g_signal_connect (timeline, "completed", G_CALLBACK (timeline_completed), @@ -200,7 +198,7 @@ test_depth_main (int argc, char *argv[]) raise_actor[0] = rect; raise_actor[1] = hand; - g_timeout_add (2000, raise_top, NULL); + clutter_threads_add_timeout (2000, raise_top, NULL); clutter_main (); diff --git a/tests/interactive/test-pixmap.c b/tests/interactive/test-pixmap.c index 3712764..7df1751 100644 --- a/tests/interactive/test-pixmap.c +++ b/tests/interactive/test-pixmap.c @@ -89,9 +89,11 @@ stage_key_release_cb (ClutterActor *actor, } static gboolean -draw_arc (Pixmap pixmap) +draw_arc (data) { + Pixmap pixmap = GPOINTER_TO_UINT (data); Display *dpy = clutter_x11_get_default_display (); + static GC gc = None; static int x = 100, y = 100; @@ -116,7 +118,7 @@ draw_arc (Pixmap pixmap) x -= 5; y -= 5; - return TRUE; + return G_SOURCE_CONTINUE; } static gboolean @@ -124,9 +126,9 @@ stage_button_press_cb (ClutterActor *actor, ClutterEvent *event, gpointer data) { - draw_arc ((Pixmap)data); + draw_arc (GPOINTER_TO_UINT (data)); - return FALSE; + return CLUTTER_EVENT_STOP; } Pixmap @@ -311,7 +313,7 @@ test_pixmap_main (int argc, char **argv) if (!disable_animation) clutter_timeline_start (timeline); - g_timeout_add_seconds (1, (GSourceFunc)draw_arc, GUINT_TO_POINTER (pixmap)); + clutter_threads_add_timeout (1000, draw_arc, GUINT_TO_POINTER (pixmap)); clutter_main (); diff --git a/tests/interactive/test-shader.c b/tests/interactive/test-shader.c index 14eb69f..d86565a 100644 --- a/tests/interactive/test-shader.c +++ b/tests/interactive/test-shader.c @@ -277,7 +277,7 @@ button_release_cb (ClutterActor *actor, set_shader_num (actor, new_no); - return FALSE; + return CLUTTER_EVENT_STOP; } #ifdef COGL_HAS_GLES2 @@ -291,7 +291,7 @@ timeout_cb (gpointer data) set_shader_num (CLUTTER_ACTOR (data), new_no); - return TRUE; + return G_SOURCE_CONTINUE; } #endif /* COGL_HAS_GLES2 */ @@ -399,7 +399,7 @@ test_shader_main (gint argc, gchar *argv[]) #ifdef COGL_HAS_GLES2 /* On an embedded platform it is difficult to right click so we will cycle through the shaders automatically */ - g_timeout_add_seconds (3, timeout_cb, actor); + clutter_threads_add_timeout (3000, timeout_cb, actor); #endif /* Show everying ( and map window ) */ diff --git a/tests/micro-bench/test-text-perf.c b/tests/micro-bench/test-text-perf.c index 5e70ba7..710c83e 100644 --- a/tests/micro-bench/test-text-perf.c +++ b/tests/micro-bench/test-text-perf.c @@ -40,7 +40,7 @@ queue_redraw (gpointer stage) { clutter_actor_queue_redraw (CLUTTER_ACTOR (stage)); - return TRUE; + return G_SOURCE_CONTINUE; } static gunichar @@ -179,7 +179,7 @@ main (int argc, char *argv[]) clutter_actor_show_all (stage); - g_idle_add (queue_redraw, stage); + clutter_threads_add_idle (queue_redraw, stage); clutter_main (); diff --git a/tests/micro-bench/test-text.c b/tests/micro-bench/test-text.c index 18cd775..d79bfd6 100644 --- a/tests/micro-bench/test-text.c +++ b/tests/micro-bench/test-text.c @@ -36,7 +36,7 @@ queue_redraw (gpointer stage) { clutter_actor_queue_redraw (CLUTTER_ACTOR (stage)); - return TRUE; + return G_SOURCE_CONTINUE; } int @@ -60,7 +60,7 @@ main (int argc, char *argv[]) clutter_actor_set_size (group, STAGE_WIDTH, STAGE_WIDTH); clutter_container_add_actor (CLUTTER_CONTAINER (stage), group); - g_idle_add (queue_redraw, stage); + clutter_threads_add_idle (queue_redraw, stage); g_signal_connect (group, "paint", G_CALLBACK (on_paint), NULL); diff --git a/tests/performance/test-common.h b/tests/performance/test-common.h index caabdaf..b0bed10 100644 --- a/tests/performance/test-common.h +++ b/tests/performance/test-common.h @@ -34,7 +34,7 @@ void clutter_perf_fps_start (ClutterStage *stage) void clutter_perf_fake_mouse (ClutterStage *stage) { - g_timeout_add (1000/60, perf_fake_mouse_cb, stage); + clutter_threads_add_timeout (1000/60, perf_fake_mouse_cb, stage); } void clutter_perf_fps_report (const gchar *id) @@ -126,5 +126,5 @@ static gboolean perf_fake_mouse_cb (gpointer stage) yd = CLAMP(yd, -1.3, 1.3); } clutter_event_free (event); - return TRUE; + return G_SOURCE_CONTINUE; } diff --git a/tests/performance/test-text-perf.c b/tests/performance/test-text-perf.c index 93f1bd3..bf08a48 100644 --- a/tests/performance/test-text-perf.c +++ b/tests/performance/test-text-perf.c @@ -15,7 +15,8 @@ static gboolean queue_redraw (gpointer stage) { clutter_actor_queue_redraw (CLUTTER_ACTOR (stage)); - return TRUE; + + return G_SOURCE_CONTINUE; } static gunichar @@ -158,7 +159,7 @@ main (int argc, char *argv[]) clutter_actor_show_all (stage); clutter_perf_fps_start (CLUTTER_STAGE (stage)); - g_idle_add (queue_redraw, stage); + clutter_threads_add_idle (queue_redraw, stage); clutter_main (); clutter_perf_fps_report ("test-text-perf"); -- 2.7.4