performance/*: Do not use clutter_stage_get_default()

This commit is contained in:
Emmanuele Bassi 2011-11-09 13:52:03 +00:00
parent 7c180a0742
commit 5903fcc36d
7 changed files with 27 additions and 20 deletions

View File

@ -67,7 +67,6 @@ main (int argc, char **argv)
{ {
glong i; glong i;
gdouble angle; gdouble angle;
const ClutterColor black = { 0x00, 0x00, 0x00, 0xff };
ClutterColor color = { 0x00, 0x00, 0x00, 0xff }; ClutterColor color = { 0x00, 0x00, 0x00, 0xff };
ClutterActor *stage, *rect; ClutterActor *stage, *rect;
@ -84,9 +83,11 @@ main (int argc, char **argv)
return -1; return -1;
} }
stage = clutter_stage_get_default (); stage = clutter_stage_new ();
clutter_actor_set_size (stage, 512, 512); clutter_actor_set_size (stage, 512, 512);
clutter_stage_set_color (CLUTTER_STAGE (stage), &black); clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_Black);
clutter_stage_set_title (CLUTTER_STAGE (stage), "Picking Performance");
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
printf ("Picking performance test with " printf ("Picking performance test with "
"%d actors and %d events per frame\n", "%d actors and %d events per frame\n",
@ -123,7 +124,7 @@ main (int argc, char **argv)
clutter_actor_show (stage); clutter_actor_show (stage);
clutter_perf_fps_start (CLUTTER_STAGE (stage)); clutter_perf_fps_start (CLUTTER_STAGE (stage));
g_idle_add (queue_redraw, (gpointer)stage); clutter_threads_add_idle (queue_redraw, stage);
clutter_main (); clutter_main ();
clutter_perf_fps_report ("test-picking"); clutter_perf_fps_report ("test-picking");

View File

@ -53,7 +53,6 @@ gint
main (gint argc, main (gint argc,
gchar **argv) gchar **argv)
{ {
ClutterColor black={0,0,0,0xff};
ClutterActor *stage; ClutterActor *stage;
ClutterActor *group; ClutterActor *group;
ClutterState *layout_state; ClutterState *layout_state;
@ -63,11 +62,13 @@ main (gint argc,
if (CLUTTER_INIT_SUCCESS != clutter_init (&argc, &argv)) if (CLUTTER_INIT_SUCCESS != clutter_init (&argc, &argv))
g_error ("Failed to initialize Clutter"); g_error ("Failed to initialize Clutter");
stage = clutter_stage_get_default (); stage = clutter_stage_new ();
group = clutter_group_new (); group = clutter_group_new ();
layout_state = clutter_state_new (); layout_state = clutter_state_new ();
clutter_stage_set_color (CLUTTER_STAGE (stage), &black); clutter_stage_set_title (CLUTTER_STAGE (stage), "State Performance [hidden]");
clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_Black);
clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT); clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT);
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
for (i=0; i<TOTAL; i++) for (i=0; i<TOTAL; i++)
{ {

View File

@ -93,7 +93,6 @@ gint
main (gint argc, main (gint argc,
gchar **argv) gchar **argv)
{ {
ClutterColor black={0,0,0,0xff};
ClutterActor *stage; ClutterActor *stage;
ClutterState *layout_state; ClutterState *layout_state;
gint i; gint i;
@ -101,9 +100,10 @@ main (gint argc,
if (CLUTTER_INIT_SUCCESS != clutter_init (&argc, &argv)) if (CLUTTER_INIT_SUCCESS != clutter_init (&argc, &argv))
g_error ("Failed to initialize Clutter"); g_error ("Failed to initialize Clutter");
stage = clutter_stage_get_default (); stage = clutter_stage_new ();
layout_state = clutter_state_new (); layout_state = clutter_state_new ();
clutter_stage_set_color (CLUTTER_STAGE (stage), &black); clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_Black);
clutter_stage_set_title (CLUTTER_STAGE (stage), "State Performance [interactive]");
clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT); clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT);
g_signal_connect (stage, "button-press-event", g_signal_connect (stage, "button-press-event",

View File

@ -60,7 +60,6 @@ gint
main (gint argc, main (gint argc,
gchar **argv) gchar **argv)
{ {
ClutterColor black={0,0,0,0xff};
ClutterActor *stage; ClutterActor *stage;
ClutterState *layout_state; ClutterState *layout_state;
gint i; gint i;
@ -69,10 +68,12 @@ main (gint argc,
if (CLUTTER_INIT_SUCCESS != clutter_init (&argc, &argv)) if (CLUTTER_INIT_SUCCESS != clutter_init (&argc, &argv))
g_error ("Failed to initialize Clutter"); g_error ("Failed to initialize Clutter");
stage = clutter_stage_get_default (); stage = clutter_stage_new ();
layout_state = clutter_state_new (); layout_state = clutter_state_new ();
clutter_stage_set_color (CLUTTER_STAGE (stage), &black); clutter_stage_set_title (CLUTTER_STAGE (stage), "State Performance [mini]");
clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_Black);
clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT); clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT);
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
for (i=0; i<TOTAL; i++) for (i=0; i<TOTAL; i++)
{ {

View File

@ -65,7 +65,6 @@ gint
main (gint argc, main (gint argc,
gchar **argv) gchar **argv)
{ {
ClutterColor black={0,0,0,0xff};
ClutterActor *stage; ClutterActor *stage;
ClutterState *layout_state; ClutterState *layout_state;
gint i; gint i;
@ -74,10 +73,12 @@ main (gint argc,
if (CLUTTER_INIT_SUCCESS != clutter_init (&argc, &argv)) if (CLUTTER_INIT_SUCCESS != clutter_init (&argc, &argv))
g_error ("Failed to initialize Clutter"); g_error ("Failed to initialize Clutter");
stage = clutter_stage_get_default (); stage = clutter_stage_new ();
layout_state = clutter_state_new (); layout_state = clutter_state_new ();
clutter_stage_set_color (CLUTTER_STAGE (stage), &black); clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_Black);
clutter_stage_set_title (CLUTTER_STAGE (stage), "State Performance [pick]");
clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT); clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT);
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
for (i=0; i<TOTAL; i++) for (i=0; i<TOTAL; i++)
{ {

View File

@ -65,7 +65,6 @@ gint
main (gint argc, main (gint argc,
gchar **argv) gchar **argv)
{ {
ClutterColor black={0,0,0,0xff};
ClutterActor *stage; ClutterActor *stage;
ClutterState *layout_state; ClutterState *layout_state;
gint i; gint i;
@ -74,10 +73,12 @@ main (gint argc,
if (CLUTTER_INIT_SUCCESS != clutter_init (&argc, &argv)) if (CLUTTER_INIT_SUCCESS != clutter_init (&argc, &argv))
g_error ("Failed to initialize Clutter"); g_error ("Failed to initialize Clutter");
stage = clutter_stage_get_default (); stage = clutter_stage_new ();
layout_state = clutter_state_new (); layout_state = clutter_state_new ();
clutter_stage_set_color (CLUTTER_STAGE (stage), &black); clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_Black);
clutter_stage_set_title (CLUTTER_STAGE (stage), "State Performance");
clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT); clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT);
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
for (i=0; i<TOTAL; i++) for (i=0; i<TOTAL; i++)
{ {

View File

@ -106,9 +106,11 @@ main (int argc, char *argv[])
g_print ("Monospace %dpx, string length = %d\n", font_size, n_chars); g_print ("Monospace %dpx, string length = %d\n", font_size, n_chars);
stage = clutter_stage_get_default (); stage = clutter_stage_new ();
clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT); clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT);
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
clutter_stage_set_title (CLUTTER_STAGE (stage), "Text Performance");
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
label = create_label (); label = create_label ();
w = clutter_actor_get_width (label); w = clutter_actor_get_width (label);