[clutter/deprecate-default-stage: 1/14] conform/*: Do not use clutter_stage_get_default()
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/deprecate-default-stage: 1/14] conform/*: Do not use clutter_stage_get_default()
- Date: Thu, 10 Nov 2011 15:52:10 +0000 (UTC)
commit deba576dd1ad5ca55c713dcc808e91adf9d2f1df
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Tue Nov 8 17:04:44 2011 +0000
conform/*: Do not use clutter_stage_get_default()
Use the correct stage creation/destruction API.
tests/conform/test-actor-invariants.c | 44 +++++++++++------
tests/conform/test-anchors.c | 4 +-
tests/conform/test-cally-text.c | 8 ++--
tests/conform/test-clutter-cairo-texture.c | 4 +-
tests/conform/test-clutter-texture.c | 4 +-
tests/conform/test-cogl-backface-culling.c | 5 +-
tests/conform/test-cogl-blend-strings.c | 5 +-
tests/conform/test-cogl-depth-test.c | 5 +-
tests/conform/test-cogl-just-vertex-shader.c | 7 ++-
tests/conform/test-cogl-materials.c | 5 +-
tests/conform/test-cogl-multitexture.c | 4 +-
tests/conform/test-cogl-npot-texture.c | 20 +++++---
tests/conform/test-cogl-offscreen.c | 8 +--
tests/conform/test-cogl-path.c | 5 +-
tests/conform/test-cogl-pipeline-user-matrix.c | 4 +-
tests/conform/test-cogl-pixel-buffer.c | 8 +--
tests/conform/test-cogl-premult.c | 5 +-
tests/conform/test-cogl-primitive.c | 5 +-
tests/conform/test-cogl-readpixels.c | 8 +--
tests/conform/test-cogl-sub-texture.c | 8 +--
tests/conform/test-cogl-texture-3d.c | 6 +-
tests/conform/test-cogl-texture-get-set-data.c | 4 +-
tests/conform/test-cogl-texture-mipmaps.c | 5 +-
tests/conform/test-cogl-texture-pixmap-x11.c | 52 ++++++++++----------
tests/conform/test-cogl-texture-rectangle.c | 4 +-
tests/conform/test-cogl-vertex-buffer-contiguous.c | 5 +-
tests/conform/test-cogl-vertex-buffer-interleved.c | 5 +-
tests/conform/test-cogl-vertex-buffer-mutability.c | 5 +-
tests/conform/test-cogl-viewport.c | 8 +--
tests/conform/test-cogl-wrap-modes.c | 4 +-
tests/conform/test-conform-main.c | 1 +
tests/conform/test-offscreen-redirect.c | 4 +-
tests/conform/test-paint-opacity.c | 14 ++---
tests/conform/test-pick.c | 5 +-
tests/conform/test-score.c | 2 +-
tests/conform/test-shader-effect.c | 4 +-
tests/conform/test-text-cache.c | 4 +-
tests/conform/test-texture-fbo.c | 20 ++------
38 files changed, 167 insertions(+), 151 deletions(-)
---
diff --git a/tests/conform/test-actor-invariants.c b/tests/conform/test-actor-invariants.c
index 5c3e2d0..0ecdb73 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 8592a06..238c390 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 ef17055..32d7afb 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 a6b73c8..4c87fcb 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 df0162c..c13db22 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 bcef760..5f139bf 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 852e722..a2a6837 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 335e558..4e2a625 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 d0cceeb..df9fcc0 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 0abf564..10039fc 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 71c21f4..ed88484 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 274ba03..3b21ba5 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 a7f6741..72d63f1 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 1daa57f..0a4f1be 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 afbeaaf..15a6504 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 09faa57..88d26b0 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 c0a874d..284c8d4 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 649ab81..4ee1efe 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 f0f2389..646b24c 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 6cbafbf..8fadc69 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 82b34ba..c3ff3b4 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 26ba058..4bbf380 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 d62b542..37b4b0a 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 36f86d4..b04e6bc 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_get_default ();
+ state.frame_count = 0;
+ state.stage = clutter_stage_new ();
- 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);
- if (g_test_verbose ())
- g_print ("OK\n");
-
-#else /* CLUTTER_WINDOWING_X11 */
+ clutter_actor_destroy (state.stage);
+ if (g_test_verbose ())
+ g_print ("OK\n");
+ }
+ else
+#endif
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 2839ea1..15d991d 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 dbc0697..bace61c 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 d8cd7cc..e7c9559 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 023df61..08d6377 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 778bae0..b3226cd 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 0a5eaea..499b66e 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 3373e94..7a187b9 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 0952fa3..62d834e 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 3dd48e9..2bd2970 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 845d39d..affef28 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 65384f1..2554cfd 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 916edf7..a21db61 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 fc41b02..82884df 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 9aa696d..4ef7b8d 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");
}
-
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]