diff --git a/tests/conform/test-actor-invariants.c b/tests/conform/test-actor-invariants.c index 5c3e2d034..0ecdb73f8 100644 --- a/tests/conform/test-actor-invariants.c +++ b/tests/conform/test-actor-invariants.c @@ -44,7 +44,7 @@ test_realized (TestConformSimpleFixture *fixture, ClutterActor *actor; ClutterActor *stage; - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); actor = clutter_rectangle_new (); @@ -60,7 +60,7 @@ test_realized (TestConformSimpleFixture *fixture, g_assert (!(CLUTTER_ACTOR_IS_MAPPED (actor))); g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (actor))); - clutter_actor_destroy (actor); + clutter_actor_destroy (stage); } void @@ -70,7 +70,7 @@ test_mapped (TestConformSimpleFixture *fixture, ClutterActor *actor; ClutterActor *stage; - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); clutter_actor_show (stage); actor = clutter_rectangle_new (); @@ -85,8 +85,7 @@ test_mapped (TestConformSimpleFixture *fixture, g_assert (CLUTTER_ACTOR_IS_MAPPED (actor)); g_assert (CLUTTER_ACTOR_IS_VISIBLE (actor)); - clutter_actor_destroy (actor); - clutter_actor_hide (stage); + clutter_actor_destroy (stage); } void @@ -96,7 +95,7 @@ test_realize_not_recursive (TestConformSimpleFixture *fixture, ClutterActor *actor, *group; ClutterActor *stage; - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); clutter_actor_show (stage); group = clutter_group_new (); @@ -126,8 +125,7 @@ test_realize_not_recursive (TestConformSimpleFixture *fixture, g_assert (!(CLUTTER_ACTOR_IS_MAPPED (actor))); g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (actor))); - clutter_actor_destroy (group); - clutter_actor_hide (stage); + clutter_actor_destroy (stage); } void @@ -137,7 +135,7 @@ test_map_recursive (TestConformSimpleFixture *fixture, ClutterActor *actor, *group; ClutterActor *stage; - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); clutter_actor_show (stage); group = clutter_group_new (); @@ -177,8 +175,7 @@ test_map_recursive (TestConformSimpleFixture *fixture, g_assert (CLUTTER_ACTOR_IS_VISIBLE (group)); g_assert (CLUTTER_ACTOR_IS_VISIBLE (actor)); - clutter_actor_destroy (group); - clutter_actor_hide (stage); + clutter_actor_destroy (stage); } void @@ -189,7 +186,7 @@ test_show_on_set_parent (TestConformSimpleFixture *fixture, gboolean show_on_set_parent; ClutterActor *stage; - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); group = clutter_group_new (); @@ -227,6 +224,7 @@ test_show_on_set_parent (TestConformSimpleFixture *fixture, clutter_actor_destroy (actor); clutter_actor_destroy (group); + clutter_actor_destroy (stage); } void @@ -238,7 +236,7 @@ test_clone_no_map (TestConformSimpleFixture *fixture, ClutterActor *actor; ClutterActor *clone; - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); clutter_actor_show (stage); group = clutter_group_new (); @@ -262,8 +260,7 @@ test_clone_no_map (TestConformSimpleFixture *fixture, clutter_actor_destroy (CLUTTER_ACTOR (clone)); clutter_actor_destroy (CLUTTER_ACTOR (group)); - - clutter_actor_hide (stage); + clutter_actor_destroy (stage); } void @@ -331,3 +328,20 @@ test_contains (TestConformSimpleFixture *fixture, ==, expected_results[x * 10 + y]); } + +void +default_stage (TestConformSimpleFixture *fixture, + gconstpointer data) +{ + ClutterActor *stage, *def_stage; + + stage = clutter_stage_new (); + def_stage = clutter_stage_get_default (); + + if (clutter_feature_available (CLUTTER_FEATURE_STAGE_MULTIPLE)) + g_assert (stage != def_stage); + else + g_assert (stage == def_stage); + + g_assert (CLUTTER_ACTOR_IS_REALIZED (def_stage)); +} diff --git a/tests/conform/test-anchors.c b/tests/conform/test-anchors.c index 8592a0640..238c39008 100644 --- a/tests/conform/test-anchors.c +++ b/tests/conform/test-anchors.c @@ -677,7 +677,7 @@ actor_anchors (void) TestState state; ClutterActor *stage; - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); state.rect = clutter_rectangle_new (); clutter_container_add (CLUTTER_CONTAINER (stage), state.rect, NULL); @@ -699,6 +699,6 @@ actor_anchors (void) g_idle_remove_by_data (&state); - clutter_actor_destroy (state.rect); + clutter_actor_destroy (stage); } diff --git a/tests/conform/test-cally-text.c b/tests/conform/test-cally-text.c index ef17055b0..32d7afb70 100644 --- a/tests/conform/test-cally-text.c +++ b/tests/conform/test-cally-text.c @@ -279,7 +279,7 @@ cally_text (void) memset (&data, 0, sizeof (data)); - data.stage = clutter_stage_get_default (); + data.stage = clutter_stage_new (); data.default_attributes = default_attributes; data.run_attributes = build_attribute_set ("fg-color", "0,0,0", NULL); @@ -294,9 +294,8 @@ cally_text (void) data.extents_height = 17; clutter_actor_set_position (data.label, 20, 100); - memset (&data1, 0, sizeof (data1)); - data1.stage = clutter_stage_get_default (); + data1.stage = data.stage; data1.default_attributes = default_attributes; data1.run_attributes = build_attribute_set ("bg-color", "0,65535,0", "fg-color", "65535,65535,0", @@ -314,11 +313,12 @@ cally_text (void) clutter_actor_set_position (data1.label, 20, 200); data.next = &data1; - clutter_actor_show (data.stage); clutter_threads_add_idle ((GSourceFunc) do_tests, &data); clutter_main (); + clutter_actor_destroy (data.stage); + if (g_test_verbose ()) g_print ("\nOverall result: "); diff --git a/tests/conform/test-clutter-cairo-texture.c b/tests/conform/test-clutter-cairo-texture.c index a6b73c83b..4c87fcb93 100644 --- a/tests/conform/test-clutter-cairo-texture.c +++ b/tests/conform/test-clutter-cairo-texture.c @@ -169,7 +169,7 @@ test_clutter_cairo_texture (TestConformSimpleFixture *fixture, unsigned int paint_handler; state.frame = 0; - state.stage = clutter_stage_get_default (); + state.stage = clutter_stage_new (); state.progress = TEST_BEFORE_DRAW_FIRST_FRAME; state.ct = clutter_cairo_texture_new (BLOCK_SIZE * 2, BLOCK_SIZE); @@ -192,5 +192,7 @@ test_clutter_cairo_texture (TestConformSimpleFixture *fixture, if (g_test_verbose ()) g_print ("OK\n"); + + clutter_actor_destroy (state.stage); } diff --git a/tests/conform/test-clutter-texture.c b/tests/conform/test-clutter-texture.c index df0162c02..c13db2254 100644 --- a/tests/conform/test-clutter-texture.c +++ b/tests/conform/test-clutter-texture.c @@ -33,7 +33,7 @@ test_texture_pick_with_alpha (TestConformSimpleFixture *fixture, gconstpointer data) { ClutterTexture *tex = CLUTTER_TEXTURE (clutter_texture_new ()); - ClutterStage *stage = CLUTTER_STAGE (clutter_stage_get_default ()); + ClutterStage *stage = CLUTTER_STAGE (clutter_stage_new ()); ClutterActor *actor; clutter_texture_set_cogl_texture (tex, make_texture ()); @@ -81,7 +81,7 @@ test_texture_pick_with_alpha (TestConformSimpleFixture *fixture, g_print ("actor @ (10, 10) = %p\n", actor); g_assert (actor == CLUTTER_ACTOR (tex)); - clutter_actor_destroy (CLUTTER_ACTOR (tex)); + clutter_actor_destroy (CLUTTER_ACTOR (stage)); if (g_test_verbose ()) g_print ("OK\n"); diff --git a/tests/conform/test-cogl-backface-culling.c b/tests/conform/test-cogl-backface-culling.c index bcef760a8..5f139bfd1 100644 --- a/tests/conform/test-cogl-backface-culling.c +++ b/tests/conform/test-cogl-backface-culling.c @@ -298,7 +298,7 @@ test_cogl_backface_culling (TestConformSimpleFixture *fixture, ClutterActor *group; guint idle_source; - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); clutter_actor_get_size (stage, &stage_width, &stage_height); state.offscreen = COGL_INVALID_HANDLE; @@ -333,7 +333,8 @@ test_cogl_backface_culling (TestConformSimpleFixture *fixture, cogl_handle_unref (state.offscreen_tex); cogl_handle_unref (state.texture); + clutter_actor_destroy (stage); + if (g_test_verbose ()) g_print ("OK\n"); } - diff --git a/tests/conform/test-cogl-blend-strings.c b/tests/conform/test-cogl-blend-strings.c index 852e722ed..a2a683769 100644 --- a/tests/conform/test-cogl-blend-strings.c +++ b/tests/conform/test-cogl-blend-strings.c @@ -405,7 +405,7 @@ test_cogl_blend_strings (TestConformSimpleFixture *fixture, ClutterActor *group; guint idle_source; - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); clutter_actor_get_geometry (stage, &state.stage_geom); @@ -426,7 +426,8 @@ test_cogl_blend_strings (TestConformSimpleFixture *fixture, g_source_remove (idle_source); + clutter_actor_destroy (stage); + if (g_test_verbose ()) g_print ("OK\n"); } - diff --git a/tests/conform/test-cogl-depth-test.c b/tests/conform/test-cogl-depth-test.c index 335e55820..4e2a62531 100644 --- a/tests/conform/test-cogl-depth-test.c +++ b/tests/conform/test-cogl-depth-test.c @@ -308,7 +308,7 @@ test_cogl_depth_test (TestConformSimpleFixture *fixture, ClutterActor *group; guint idle_source; - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); clutter_actor_get_geometry (stage, &state.stage_geom); @@ -329,7 +329,8 @@ test_cogl_depth_test (TestConformSimpleFixture *fixture, g_source_remove (idle_source); + clutter_actor_destroy (stage); + if (g_test_verbose ()) g_print ("OK\n"); } - diff --git a/tests/conform/test-cogl-just-vertex-shader.c b/tests/conform/test-cogl-just-vertex-shader.c index d0cceebba..df9fcc012 100644 --- a/tests/conform/test-cogl-just-vertex-shader.c +++ b/tests/conform/test-cogl-just-vertex-shader.c @@ -112,11 +112,11 @@ test_cogl_just_vertex_shader (TestConformSimpleFixture *fixture, ClutterActor *stage; guint paint_handler; - stage = clutter_stage_get_default (); - /* If shaders aren't supported then we can't run the test */ if (cogl_features_available (COGL_FEATURE_SHADERS_GLSL)) { + stage = clutter_stage_new (); + clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); paint_handler = g_signal_connect_after (stage, "paint", @@ -128,10 +128,11 @@ test_cogl_just_vertex_shader (TestConformSimpleFixture *fixture, g_signal_handler_disconnect (stage, paint_handler); + clutter_actor_destroy (stage); + if (g_test_verbose ()) g_print ("OK\n"); } else if (g_test_verbose ()) g_print ("Skipping\n"); } - diff --git a/tests/conform/test-cogl-materials.c b/tests/conform/test-cogl-materials.c index 0abf5641e..10039fcf3 100644 --- a/tests/conform/test-cogl-materials.c +++ b/tests/conform/test-cogl-materials.c @@ -325,7 +325,7 @@ test_cogl_materials (TestConformSimpleFixture *fixture, test_conform_get_gl_functions (&gl_functions); - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); clutter_actor_get_geometry (stage, &state.stage_geom); @@ -346,7 +346,8 @@ test_cogl_materials (TestConformSimpleFixture *fixture, g_source_remove (idle_source); + clutter_actor_destroy (stage); + if (g_test_verbose ()) g_print ("OK\n"); } - diff --git a/tests/conform/test-cogl-multitexture.c b/tests/conform/test-cogl-multitexture.c index 71c21f46b..ed88484ac 100644 --- a/tests/conform/test-cogl-multitexture.c +++ b/tests/conform/test-cogl-multitexture.c @@ -181,7 +181,7 @@ test_cogl_multitexture (TestConformSimpleFixture *fixture, ClutterActor *group; guint idle_source; - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); @@ -201,6 +201,8 @@ test_cogl_multitexture (TestConformSimpleFixture *fixture, g_source_remove (idle_source); + clutter_actor_destroy (stage); + if (g_test_verbose ()) g_print ("OK\n"); } diff --git a/tests/conform/test-cogl-npot-texture.c b/tests/conform/test-cogl-npot-texture.c index 274ba03b3..3b21ba51d 100644 --- a/tests/conform/test-cogl-npot-texture.c +++ b/tests/conform/test-cogl-npot-texture.c @@ -32,15 +32,18 @@ static const ClutterColor corner_colors[PARTS * PARTS] = typedef struct _TestState { + ClutterActor *stage; guint frame; CoglHandle texture; } TestState; static gboolean -validate_part (int xnum, int ynum, const ClutterColor *color) +validate_part (ClutterActor *stage, + int xnum, + int ynum, + const ClutterColor *color) { guchar *pixels, *p; - ClutterActor *stage = clutter_stage_get_default (); gboolean ret = TRUE; /* Read the appropriate part but skip out a few pixels around the @@ -75,10 +78,10 @@ validate_result (TestState *state) { /* Validate that all four corners of the texture are drawn in the right color */ - g_assert (validate_part (0, 0, corner_colors + 0)); - g_assert (validate_part (1, 0, corner_colors + 1)); - g_assert (validate_part (0, 1, corner_colors + 2)); - g_assert (validate_part (1, 1, corner_colors + 3)); + g_assert (validate_part (state->stage, 0, 0, corner_colors + 0)); + g_assert (validate_part (state->stage, 1, 0, corner_colors + 1)); + g_assert (validate_part (state->stage, 0, 1, corner_colors + 2)); + g_assert (validate_part (state->stage, 1, 1, corner_colors + 3)); /* Comment this out if you want visual feedback of what this test * paints. @@ -208,7 +211,7 @@ test_cogl_npot_texture (TestConformSimpleFixture *fixture, state.texture = make_texture (); - stage = clutter_stage_get_default (); + state.stage = stage = clutter_stage_new (); clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); @@ -230,7 +233,8 @@ test_cogl_npot_texture (TestConformSimpleFixture *fixture, cogl_handle_unref (state.texture); + clutter_actor_destroy (state.stage); + if (g_test_verbose ()) g_print ("OK\n"); } - diff --git a/tests/conform/test-cogl-offscreen.c b/tests/conform/test-cogl-offscreen.c index a7f67416c..72d63f195 100644 --- a/tests/conform/test-cogl-offscreen.c +++ b/tests/conform/test-cogl-offscreen.c @@ -142,7 +142,7 @@ test_cogl_offscreen (TestConformSimpleFixture *fixture, guint idle_source; ClutterActor *stage; - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); /* We force continuous redrawing of the stage, since we need to skip @@ -156,12 +156,8 @@ test_cogl_offscreen (TestConformSimpleFixture *fixture, g_source_remove (idle_source); - /* Remove all of the actors from the stage */ - clutter_container_foreach (CLUTTER_CONTAINER (stage), - (ClutterCallback) clutter_actor_destroy, - NULL); + clutter_actor_destroy (stage); if (g_test_verbose ()) g_print ("OK\n"); } - diff --git a/tests/conform/test-cogl-path.c b/tests/conform/test-cogl-path.c index 1daa57f5b..0a4f1be78 100644 --- a/tests/conform/test-cogl-path.c +++ b/tests/conform/test-cogl-path.c @@ -212,7 +212,7 @@ test_cogl_path (TestConformSimpleFixture *fixture, unsigned int paint_handler; state.frame = 0; - state.stage = clutter_stage_get_default (); + state.stage = clutter_stage_new (); clutter_stage_set_color (CLUTTER_STAGE (state.stage), &stage_color); /* We force continuous redrawing of the stage, since we need to skip @@ -228,7 +228,8 @@ test_cogl_path (TestConformSimpleFixture *fixture, g_signal_handler_disconnect (state.stage, paint_handler); g_source_remove (idle_source); + clutter_actor_destroy (state.stage); + if (g_test_verbose ()) g_print ("OK\n"); } - diff --git a/tests/conform/test-cogl-pipeline-user-matrix.c b/tests/conform/test-cogl-pipeline-user-matrix.c index afbeaaf00..15a650407 100644 --- a/tests/conform/test-cogl-pipeline-user-matrix.c +++ b/tests/conform/test-cogl-pipeline-user-matrix.c @@ -119,7 +119,7 @@ test_cogl_pipeline_user_matrix (TestConformSimpleFixture *fixture, guint idle_source; guint paint_handler; - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); @@ -139,6 +139,8 @@ test_cogl_pipeline_user_matrix (TestConformSimpleFixture *fixture, g_source_remove (idle_source); g_signal_handler_disconnect (stage, paint_handler); + clutter_actor_destroy (stage); + if (g_test_verbose ()) g_print ("OK\n"); } diff --git a/tests/conform/test-cogl-pixel-buffer.c b/tests/conform/test-cogl-pixel-buffer.c index 09faa578f..88d26b0ca 100644 --- a/tests/conform/test-cogl-pixel-buffer.c +++ b/tests/conform/test-cogl-pixel-buffer.c @@ -286,7 +286,7 @@ test_cogl_pixel_array (TestConformSimpleFixture *fixture, state.frame = 0; - state.stage = clutter_stage_get_default (); + state.stage = clutter_stage_new (); create_map_tile (&tiles[TILE_MAP]); #if 0 @@ -319,12 +319,8 @@ test_cogl_pixel_array (TestConformSimpleFixture *fixture, cogl_handle_unref (state.tiles[i].texture); } - /* Remove all of the actors from the stage */ - clutter_container_foreach (CLUTTER_CONTAINER (state.stage), - (ClutterCallback) clutter_actor_destroy, - NULL); + clutter_actor_destroy (state.stage); if (g_test_verbose ()) g_print ("OK\n"); } - diff --git a/tests/conform/test-cogl-premult.c b/tests/conform/test-cogl-premult.c index c0a874d92..284c8d478 100644 --- a/tests/conform/test-cogl-premult.c +++ b/tests/conform/test-cogl-premult.c @@ -340,7 +340,7 @@ test_cogl_premult (TestConformSimpleFixture *fixture, cogl_material_set_layer_combine (state.passthrough_material, 0, "RGBA = REPLACE (TEXTURE)", NULL); - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); clutter_actor_get_geometry (stage, &state.stage_geom); @@ -361,7 +361,8 @@ test_cogl_premult (TestConformSimpleFixture *fixture, g_source_remove (idle_source); + clutter_actor_destroy (stage); + if (g_test_verbose ()) g_print ("OK\n"); } - diff --git a/tests/conform/test-cogl-primitive.c b/tests/conform/test-cogl-primitive.c index 649ab81c3..4ee1efe46 100644 --- a/tests/conform/test-cogl-primitive.c +++ b/tests/conform/test-cogl-primitive.c @@ -211,7 +211,7 @@ test_cogl_primitive (TestConformSimpleFixture *fixture, ClutterActor *stage; guint paint_handler; - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); @@ -224,7 +224,8 @@ test_cogl_primitive (TestConformSimpleFixture *fixture, g_signal_handler_disconnect (stage, paint_handler); + clutter_actor_destroy (stage); + if (g_test_verbose ()) g_print ("OK\n"); } - diff --git a/tests/conform/test-cogl-readpixels.c b/tests/conform/test-cogl-readpixels.c index f0f23898a..646b24cbe 100644 --- a/tests/conform/test-cogl-readpixels.c +++ b/tests/conform/test-cogl-readpixels.c @@ -153,7 +153,7 @@ test_cogl_readpixels (TestConformSimpleFixture *fixture, guint idle_source; ClutterActor *stage; - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); /* We force continuous redrawing of the stage, since we need to skip @@ -167,12 +167,8 @@ test_cogl_readpixels (TestConformSimpleFixture *fixture, g_source_remove (idle_source); - /* Remove all of the actors from the stage */ - clutter_container_foreach (CLUTTER_CONTAINER (stage), - (ClutterCallback) clutter_actor_destroy, - NULL); + clutter_actor_destroy (stage); if (g_test_verbose ()) g_print ("OK\n"); } - diff --git a/tests/conform/test-cogl-sub-texture.c b/tests/conform/test-cogl-sub-texture.c index 6cbafbf67..8fadc6994 100644 --- a/tests/conform/test-cogl-sub-texture.c +++ b/tests/conform/test-cogl-sub-texture.c @@ -339,7 +339,7 @@ test_cogl_sub_texture (TestConformSimpleFixture *fixture, state.frame = 0; - state.stage = clutter_stage_get_default (); + state.stage = clutter_stage_new (); state.tex = create_source (); clutter_stage_set_color (CLUTTER_STAGE (state.stage), &stage_color); @@ -361,12 +361,8 @@ test_cogl_sub_texture (TestConformSimpleFixture *fixture, cogl_handle_unref (state.tex); - /* Remove all of the actors from the stage */ - clutter_container_foreach (CLUTTER_CONTAINER (state.stage), - (ClutterCallback) clutter_actor_destroy, - NULL); + clutter_actor_destroy (state.stage); if (g_test_verbose ()) g_print ("OK\n"); } - diff --git a/tests/conform/test-cogl-texture-3d.c b/tests/conform/test-cogl-texture-3d.c index 82b34ba08..c3ff3b45b 100644 --- a/tests/conform/test-cogl-texture-3d.c +++ b/tests/conform/test-cogl-texture-3d.c @@ -204,12 +204,11 @@ test_cogl_texture_3d (TestConformSimpleFixture *fixture, ClutterActor *stage; guint paint_handler; - stage = clutter_stage_get_default (); - /* Check whether GL supports the rectangle extension. If not we'll just assume the test passes */ if (cogl_features_available (COGL_FEATURE_TEXTURE_3D)) { + stage = clutter_stage_new (); clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); paint_handler = g_signal_connect_after (stage, "paint", @@ -221,10 +220,11 @@ test_cogl_texture_3d (TestConformSimpleFixture *fixture, g_signal_handler_disconnect (stage, paint_handler); + clutter_actor_destroy (stage); + if (g_test_verbose ()) g_print ("OK\n"); } else if (g_test_verbose ()) g_print ("Skipping\n"); } - diff --git a/tests/conform/test-cogl-texture-get-set-data.c b/tests/conform/test-cogl-texture-get-set-data.c index 26ba05858..4bbf3802d 100644 --- a/tests/conform/test-cogl-texture-get-set-data.c +++ b/tests/conform/test-cogl-texture-get-set-data.c @@ -150,7 +150,7 @@ test_cogl_texture_get_set_data (TestConformSimpleFixture *fixture, /* We create a stage even though we don't usually need it so that if the draw-and-read texture fallback is needed then it will have something to draw to */ - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); paint_handler = g_signal_connect_after (stage, "paint", G_CALLBACK (paint_cb), NULL); @@ -161,6 +161,8 @@ test_cogl_texture_get_set_data (TestConformSimpleFixture *fixture, g_signal_handler_disconnect (stage, paint_handler); + clutter_actor_destroy (stage); + if (g_test_verbose ()) g_print ("OK\n"); } diff --git a/tests/conform/test-cogl-texture-mipmaps.c b/tests/conform/test-cogl-texture-mipmaps.c index d62b542d3..37b4b0a6c 100644 --- a/tests/conform/test-cogl-texture-mipmaps.c +++ b/tests/conform/test-cogl-texture-mipmaps.c @@ -111,8 +111,7 @@ test_cogl_texture_mipmaps (TestConformSimpleFixture *fixture, ClutterActor *group; guint idle_source; - stage = clutter_stage_get_default (); - + stage = clutter_stage_new (); clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); group = clutter_group_new (); @@ -131,6 +130,8 @@ test_cogl_texture_mipmaps (TestConformSimpleFixture *fixture, g_source_remove (idle_source); + clutter_actor_destroy (stage); + if (g_test_verbose ()) g_print ("OK\n"); } diff --git a/tests/conform/test-cogl-texture-pixmap-x11.c b/tests/conform/test-cogl-texture-pixmap-x11.c index 36f86d458..b04e6bc40 100644 --- a/tests/conform/test-cogl-texture-pixmap-x11.c +++ b/tests/conform/test-cogl-texture-pixmap-x11.c @@ -202,44 +202,44 @@ test_cogl_texture_pixmap_x11 (TestConformSimpleFixture *fixture, gconstpointer data) { #ifdef CLUTTER_WINDOWING_X11 + if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11)) + { + TestState state; + guint idle_handler; + guint paint_handler; - TestState state; - guint idle_handler; - guint paint_handler; + state.frame_count = 0; + state.stage = clutter_stage_new (); - state.frame_count = 0; - state.stage = clutter_stage_get_default (); + state.display = clutter_x11_get_default_display (); - state.display = clutter_x11_get_default_display (); + state.pixmap = create_pixmap (&state); + state.tfp = cogl_texture_pixmap_x11_new (state.pixmap, TRUE); - state.pixmap = create_pixmap (&state); - state.tfp = cogl_texture_pixmap_x11_new (state.pixmap, TRUE); + clutter_stage_set_color (CLUTTER_STAGE (state.stage), &stage_color); - clutter_stage_set_color (CLUTTER_STAGE (state.stage), &stage_color); + paint_handler = g_signal_connect_after (state.stage, "paint", + G_CALLBACK (on_paint), &state); - paint_handler = g_signal_connect_after (state.stage, "paint", - G_CALLBACK (on_paint), &state); + idle_handler = g_idle_add (queue_redraw, state.stage); - idle_handler = g_idle_add (queue_redraw, state.stage); + clutter_actor_show_all (state.stage); - clutter_actor_show_all (state.stage); + clutter_main (); - clutter_main (); + g_signal_handler_disconnect (state.stage, paint_handler); - g_signal_handler_disconnect (state.stage, paint_handler); + g_source_remove (idle_handler); - g_source_remove (idle_handler); + XFreePixmap (state.display, state.pixmap); - XFreePixmap (state.display, state.pixmap); + clutter_actor_destroy (state.stage); + if (g_test_verbose ()) + g_print ("OK\n"); + } + else +#endif if (g_test_verbose ()) - g_print ("OK\n"); - -#else /* CLUTTER_WINDOWING_X11 */ - - if (g_test_verbose ()) - g_print ("Skipping\n"); - -#endif /* CLUTTER_WINDOWING_X11 */ + g_print ("Skipping\n"); } - diff --git a/tests/conform/test-cogl-texture-rectangle.c b/tests/conform/test-cogl-texture-rectangle.c index 2839ea10c..15d991d5e 100644 --- a/tests/conform/test-cogl-texture-rectangle.c +++ b/tests/conform/test-cogl-texture-rectangle.c @@ -248,7 +248,7 @@ test_cogl_texture_rectangle (TestConformSimpleFixture *fixture, guint idle_source; guint paint_handler; - state.stage = clutter_stage_get_default (); + state.stage = clutter_stage_new (); test_conform_get_gl_functions (&gl_functions); @@ -273,6 +273,8 @@ test_cogl_texture_rectangle (TestConformSimpleFixture *fixture, g_source_remove (idle_source); g_signal_handler_disconnect (state.stage, paint_handler); + clutter_actor_destroy (state.stage); + if (g_test_verbose ()) g_print ("OK\n"); } diff --git a/tests/conform/test-cogl-vertex-buffer-contiguous.c b/tests/conform/test-cogl-vertex-buffer-contiguous.c index dbc069753..bace61c1b 100644 --- a/tests/conform/test-cogl-vertex-buffer-contiguous.c +++ b/tests/conform/test-cogl-vertex-buffer-contiguous.c @@ -167,7 +167,7 @@ test_cogl_vertex_buffer_contiguous (TestConformSimpleFixture *fixture, 0x00, 0xff, 0x00, 0xff }; - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_clr); clutter_actor_get_geometry (stage, &state.stage_geom); @@ -251,7 +251,8 @@ test_cogl_vertex_buffer_contiguous (TestConformSimpleFixture *fixture, g_source_remove (idle_source); + clutter_actor_destroy (stage); + if (g_test_verbose ()) g_print ("OK\n"); } - diff --git a/tests/conform/test-cogl-vertex-buffer-interleved.c b/tests/conform/test-cogl-vertex-buffer-interleved.c index d8cd7cc19..e7c955942 100644 --- a/tests/conform/test-cogl-vertex-buffer-interleved.c +++ b/tests/conform/test-cogl-vertex-buffer-interleved.c @@ -92,7 +92,7 @@ test_cogl_vertex_buffer_interleved (TestConformSimpleFixture *fixture, ClutterActor *group; guint idle_source; - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_clr); clutter_actor_get_geometry (stage, &state.stage_geom); @@ -156,7 +156,8 @@ test_cogl_vertex_buffer_interleved (TestConformSimpleFixture *fixture, g_source_remove (idle_source); + clutter_actor_destroy (stage); + if (g_test_verbose ()) g_print ("OK\n"); } - diff --git a/tests/conform/test-cogl-vertex-buffer-mutability.c b/tests/conform/test-cogl-vertex-buffer-mutability.c index 023df6173..08d6377e4 100644 --- a/tests/conform/test-cogl-vertex-buffer-mutability.c +++ b/tests/conform/test-cogl-vertex-buffer-mutability.c @@ -135,7 +135,7 @@ test_cogl_vertex_buffer_mutability (TestConformSimpleFixture *fixture, ClutterActor *group; guint idle_source; - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_clr); clutter_actor_get_geometry (stage, &state.stage_geom); @@ -192,7 +192,8 @@ test_cogl_vertex_buffer_mutability (TestConformSimpleFixture *fixture, g_source_remove (idle_source); + clutter_actor_destroy (stage); + if (g_test_verbose ()) g_print ("OK\n"); } - diff --git a/tests/conform/test-cogl-viewport.c b/tests/conform/test-cogl-viewport.c index 778bae011..b3226cd25 100644 --- a/tests/conform/test-cogl-viewport.c +++ b/tests/conform/test-cogl-viewport.c @@ -391,7 +391,7 @@ test_cogl_viewport (TestConformSimpleFixture *fixture, guint idle_source; ClutterActor *stage; - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); /* We force continuous redrawing of the stage, since we need to skip @@ -405,12 +405,8 @@ test_cogl_viewport (TestConformSimpleFixture *fixture, g_source_remove (idle_source); - /* Remove all of the actors from the stage */ - clutter_container_foreach (CLUTTER_CONTAINER (stage), - (ClutterCallback) clutter_actor_destroy, - NULL); + clutter_actor_destroy (stage); if (g_test_verbose ()) g_print ("OK\n"); } - diff --git a/tests/conform/test-cogl-wrap-modes.c b/tests/conform/test-cogl-wrap-modes.c index 0a5eaea26..499b66e90 100644 --- a/tests/conform/test-cogl-wrap-modes.c +++ b/tests/conform/test-cogl-wrap-modes.c @@ -293,7 +293,7 @@ test_cogl_wrap_modes (TestConformSimpleFixture *fixture, guint idle_source; guint paint_handler; - state.stage = clutter_stage_get_default (); + state.stage = clutter_stage_new (); clutter_stage_set_color (CLUTTER_STAGE (state.stage), &stage_color); @@ -312,6 +312,8 @@ test_cogl_wrap_modes (TestConformSimpleFixture *fixture, g_source_remove (idle_source); g_signal_handler_disconnect (state.stage, paint_handler); + clutter_actor_destroy (state.stage); + if (g_test_verbose ()) g_print ("OK\n"); } diff --git a/tests/conform/test-conform-main.c b/tests/conform/test-conform-main.c index 3373e9481..7a187b92c 100644 --- a/tests/conform/test-conform-main.c +++ b/tests/conform/test-conform-main.c @@ -145,6 +145,7 @@ main (int argc, char **argv) TEST_CONFORM_SIMPLE ("/invariants", test_show_on_set_parent); TEST_CONFORM_SIMPLE ("/invariants", test_clone_no_map); TEST_CONFORM_SIMPLE ("/invariants", test_contains); + TEST_CONFORM_SIMPLE ("/invariants", default_stage); TEST_CONFORM_SIMPLE ("/opacity", test_label_opacity); TEST_CONFORM_SIMPLE ("/opacity", test_rectangle_opacity); diff --git a/tests/conform/test-offscreen-redirect.c b/tests/conform/test-offscreen-redirect.c index 0952fa315..62d834e93 100644 --- a/tests/conform/test-offscreen-redirect.c +++ b/tests/conform/test-offscreen-redirect.c @@ -301,7 +301,7 @@ test_offscreen_redirect (TestConformSimpleFixture *fixture, { Data data; - data.stage = clutter_stage_get_default (); + data.stage = clutter_stage_new (); data.parent_container = clutter_group_new (); @@ -337,6 +337,8 @@ test_offscreen_redirect (TestConformSimpleFixture *fixture, clutter_main (); + clutter_actor_destroy (data.stage); + if (g_test_verbose ()) g_print ("OK\n"); } diff --git a/tests/conform/test-paint-opacity.c b/tests/conform/test-paint-opacity.c index 3dd48e912..2bd2970b5 100644 --- a/tests/conform/test-paint-opacity.c +++ b/tests/conform/test-paint-opacity.c @@ -12,7 +12,7 @@ test_label_opacity (TestConformSimpleFixture *fixture, ClutterColor label_color = { 255, 0, 0, 128 }; ClutterColor color_check = { 0, }; - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); label = clutter_text_new_with_text ("Sans 18px", "Label, 50% opacity"); clutter_text_set_color (CLUTTER_TEXT (label), &label_color); @@ -39,7 +39,7 @@ test_label_opacity (TestConformSimpleFixture *fixture, clutter_actor_set_opacity (label, 128); g_assert (clutter_actor_get_paint_opacity (label) == 128); - clutter_actor_destroy (label); + clutter_actor_destroy (stage); } void @@ -51,7 +51,7 @@ test_rectangle_opacity (TestConformSimpleFixture *fixture, ClutterColor rect_color = { 0, 0, 255, 255 }; ClutterColor color_check = { 0, }; - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); rect = clutter_rectangle_new_with_color (&rect_color); clutter_actor_set_size (rect, 128, 128); @@ -73,7 +73,7 @@ test_rectangle_opacity (TestConformSimpleFixture *fixture, g_print ("rect 100%%.get_paint_opacity()\n"); g_assert (clutter_actor_get_paint_opacity (rect) == 255); - clutter_actor_destroy (rect); + clutter_actor_destroy (stage); } void @@ -86,7 +86,7 @@ test_paint_opacity (TestConformSimpleFixture *fixture, ClutterColor rect_color = { 0, 0, 255, 255 }; ClutterColor color_check = { 0, }; - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); group1 = clutter_group_new (); clutter_actor_set_opacity (group1, 128); @@ -138,7 +138,5 @@ test_paint_opacity (TestConformSimpleFixture *fixture, g_print ("rect 100%%.get_paint_opacity()\n"); g_assert (clutter_actor_get_paint_opacity (rect) == 128); - clutter_actor_destroy (rect); - clutter_actor_destroy (group2); - clutter_actor_destroy (group1); + clutter_actor_destroy (stage); } diff --git a/tests/conform/test-pick.c b/tests/conform/test-pick.c index 845d39dec..affef2866 100644 --- a/tests/conform/test-pick.c +++ b/tests/conform/test-pick.c @@ -240,7 +240,7 @@ actor_picking (void) state.pass = TRUE; - state.stage = clutter_stage_get_default (); + state.stage = clutter_stage_new (); state.actor_width = STAGE_WIDTH / ACTORS_X; state.actor_height = STAGE_HEIGHT / ACTORS_Y; @@ -271,9 +271,10 @@ actor_picking (void) clutter_main (); - if (g_test_verbose ()) g_print ("end result: %s\n", state.pass ? "pass" : "FAIL"); g_assert (state.pass); + + clutter_actor_destroy (state.stage); } diff --git a/tests/conform/test-score.c b/tests/conform/test-score.c index 65384f10c..2554cfdd7 100644 --- a/tests/conform/test-score.c +++ b/tests/conform/test-score.c @@ -54,7 +54,7 @@ test_score (TestConformSimpleFixture *fixture, ClutterTimeline *timeline_5; GSList *timelines; - /* this is necessary to make the master clock spin */ + /* FIXME - this is necessary to make the master clock spin */ (void) clutter_stage_get_default (); timeline_1 = clutter_timeline_new (100); diff --git a/tests/conform/test-shader-effect.c b/tests/conform/test-shader-effect.c index 916edf757..a21db610f 100644 --- a/tests/conform/test-shader-effect.c +++ b/tests/conform/test-shader-effect.c @@ -239,7 +239,7 @@ test_shader_effect (TestConformSimpleFixture *fixture, ClutterActor *stage; ClutterActor *rect; - stage = clutter_stage_get_default (); + stage = clutter_stage_new (); rect = make_actor (foo_old_shader_effect_get_type ()); clutter_container_add_actor (CLUTTER_CONTAINER (stage), rect); @@ -262,6 +262,8 @@ test_shader_effect (TestConformSimpleFixture *fixture, clutter_main (); + clutter_actor_destroy (stage); + if (g_test_verbose ()) g_print ("OK\n"); } diff --git a/tests/conform/test-text-cache.c b/tests/conform/test-text-cache.c index fc41b0200..82884df1c 100644 --- a/tests/conform/test-text-cache.c +++ b/tests/conform/test-text-cache.c @@ -263,7 +263,7 @@ text_cache (void) memset (&data, 0, sizeof (data)); - data.stage = clutter_stage_get_default (); + data.stage = clutter_stage_new (); data.label = clutter_text_new_with_text (TEST_FONT, ""); @@ -279,6 +279,8 @@ text_cache (void) clutter_main (); + clutter_actor_destroy (data.stage); + if (g_test_verbose ()) g_print ("\nOverall result: "); diff --git a/tests/conform/test-texture-fbo.c b/tests/conform/test-texture-fbo.c index 9aa696db5..4ef7b8d4c 100644 --- a/tests/conform/test-texture-fbo.c +++ b/tests/conform/test-texture-fbo.c @@ -173,14 +173,12 @@ test_texture_fbo (TestConformSimpleFixture *fixture, gconstpointer data) { TestState state; - guint idle_source; - gulong paint_handler; ClutterActor *actor; int ypos = 0; state.frame = 0; - state.stage = clutter_stage_get_default (); + state.stage = clutter_stage_new (); clutter_stage_set_color (CLUTTER_STAGE (state.stage), &stage_color); @@ -229,25 +227,15 @@ 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. */ - idle_source = g_idle_add (queue_redraw, state.stage); - - paint_handler = g_signal_connect_after (state.stage, "paint", - G_CALLBACK (on_paint), &state); + g_idle_add (queue_redraw, state.stage); + g_signal_connect_after (state.stage, "paint", G_CALLBACK (on_paint), &state); clutter_actor_show_all (state.stage); clutter_main (); - g_signal_handler_disconnect (state.stage, paint_handler); - - g_source_remove (idle_source); - - /* Remove all of the actors from the stage */ - clutter_container_foreach (CLUTTER_CONTAINER (state.stage), - (ClutterCallback) clutter_actor_destroy, - NULL); + clutter_actor_destroy (state.stage); if (g_test_verbose ()) g_print ("OK\n"); } -