[test-text-perf] Small fix-ups

- Fix a typo in a for loop in create_label which left 'i'
  uninitialised and caused a crash if you're unlucky.

- Set the CLUTTER_VBLANK=none environment variable.

- Don't quit on a keypress.

- Trailing whitespace tidy up.
This commit is contained in:
Neil Roberts 2009-05-21 17:43:41 +01:00
parent 8724a16452
commit a1b0160da7

View File

@ -40,7 +40,7 @@ gboolean idle (gpointer data)
} }
static ClutterActor * static ClutterActor *
create_label() create_label ()
{ {
ClutterColor label_color = { 0xff, 0xff, 0xff, 0xff }; ClutterColor label_color = { 0xff, 0xff, 0xff, 0xff };
ClutterActor *label; ClutterActor *label;
@ -51,7 +51,7 @@ create_label()
font_name = g_strdup_printf ("Monospace %dpx", font_size); font_name = g_strdup_printf ("Monospace %dpx", font_size);
str = g_string_new (NULL); str = g_string_new (NULL);
for (i < 0; i < n_chars; i++) for (i = 0; i < n_chars; i++)
g_string_append_c (str, 'A' + (i % 26)); g_string_append_c (str, 'A' + (i % 26));
label = clutter_text_new_with_text (font_name, str->str); label = clutter_text_new_with_text (font_name, str->str);
@ -72,6 +72,8 @@ main (int argc, char *argv[])
int w, h; int w, h;
int row, col; int row, col;
g_setenv ("CLUTTER_VBLANK", "none", FALSE);
clutter_init (&argc, &argv); clutter_init (&argc, &argv);
if (argc != 3) if (argc != 3)
@ -112,12 +114,9 @@ main (int argc, char *argv[])
clutter_actor_show_all (stage); clutter_actor_show_all (stage);
g_signal_connect (stage, "key-press-event",
G_CALLBACK (clutter_main_quit), NULL);
g_idle_add (idle, (gpointer) stage); g_idle_add (idle, (gpointer) stage);
clutter_main(); clutter_main ();
return 0; return 0;
} }