mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
conform/*: Do not use clutter_stage_get_default()
Use the correct stage creation/destruction API.
This commit is contained in:
parent
89644ae048
commit
deba576dd1
@ -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));
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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: ");
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -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: ");
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user