minor improvements.

2007-05-31  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/test-preview-area.c: minor improvements.

svn path=/trunk/; revision=22688
This commit is contained in:
Sven Neumann 2007-05-31 13:30:35 +00:00 committed by Sven Neumann
parent 905e80d497
commit cbe5056dc7
2 changed files with 24 additions and 14 deletions

View file

@ -1,3 +1,7 @@
2007-05-31 Sven Neumann <sven@gimp.org>
* libgimpwidgets/test-preview-area.c: minor improvements.
2007-05-31 Sven Neumann <sven@gimp.org>
* libgimpwidgets/Makefile.am: build test-preview-area to avoid bit

View file

@ -46,7 +46,6 @@ test_run (GtkWidget *area,
{
guchar buf[WIDTH * HEIGHT * 8];
gint i, j;
gint offset, offset2, offset3;
gint num_iters = NUM_ITERS;
guchar val;
gdouble start_time, total_time;
@ -59,8 +58,9 @@ test_run (GtkWidget *area,
gtk_widget_realize (area);
g_print ("\nPerformance tests for GimpPreviewArea (%s, %d iterations):\n\n",
visible ? "visible" : "hidden", num_iters);
g_print ("\nPerformance tests for GimpPreviewArea "
"(%d x %d, %s, %d iterations):\n\n",
WIDTH, HEIGHT, visible ? "visible" : "hidden", num_iters);
val = 0;
for (j = 0; j < WIDTH * HEIGHT * 8; j++)
@ -75,7 +75,8 @@ test_run (GtkWidget *area,
to settle. */
for (i = 0; i < NUM_ITERS; i++)
{
offset = (rand () % (WIDTH * HEIGHT * 4)) & -4;
gint offset = (rand () % (WIDTH * HEIGHT * 4)) & -4;
gimp_preview_area_draw (GIMP_PREVIEW_AREA (area),
0, 0, WIDTH, HEIGHT,
GIMP_RGB_IMAGE,
@ -97,7 +98,8 @@ test_run (GtkWidget *area,
for (i = 0; i < num_iters; i++)
{
offset = (rand () % (WIDTH * HEIGHT * 4)) & -4;
gint offset = (rand () % (WIDTH * HEIGHT * 4)) & -4;
gimp_preview_area_draw (GIMP_PREVIEW_AREA (area),
0, 0, WIDTH, HEIGHT,
enum_value->value,
@ -110,7 +112,7 @@ test_run (GtkWidget *area,
gdk_flush ();
total_time = g_timer_elapsed (timer, NULL) - start_time;
g_print ("%-16s "
g_print ("%-20s "
"draw : %5.2fs, %8.1f fps, %8.2f megapixels/s\n",
enum_value->value_name,
total_time,
@ -122,8 +124,9 @@ test_run (GtkWidget *area,
for (i = 0; i < num_iters; i++)
{
offset = (rand () % (WIDTH * HEIGHT * 4)) & -4;
offset2 = (rand () % (WIDTH * HEIGHT * 4)) & -4;
gint offset = (rand () % (WIDTH * HEIGHT * 4)) & -4;
gint offset2 = (rand () % (WIDTH * HEIGHT * 4)) & -4;
gimp_preview_area_blend (GIMP_PREVIEW_AREA (area),
0, 0, WIDTH, HEIGHT,
enum_value->value,
@ -139,7 +142,7 @@ test_run (GtkWidget *area,
gdk_flush ();
total_time = g_timer_elapsed (timer, NULL) - start_time;
g_print ("%-16s "
g_print ("%-20s "
"blend : %5.2fs, %8.1f fps, %8.2f megapixels/s\n",
enum_value->value_name,
total_time,
@ -151,9 +154,10 @@ test_run (GtkWidget *area,
for (i = 0; i < num_iters; i++)
{
offset = (rand () % (WIDTH * HEIGHT * 4)) & -4;
offset2 = (rand () % (WIDTH * HEIGHT * 4)) & -4;
offset3 = (rand () % (WIDTH * HEIGHT * 4)) & -4;
gint offset = (rand () % (WIDTH * HEIGHT * 4)) & -4;
gint offset2 = (rand () % (WIDTH * HEIGHT * 4)) & -4;
gint offset3 = (rand () % (WIDTH * HEIGHT * 4)) & -4;
gimp_preview_area_mask (GIMP_PREVIEW_AREA (area),
0, 0, WIDTH, HEIGHT,
enum_value->value,
@ -170,7 +174,7 @@ test_run (GtkWidget *area,
gdk_flush ();
total_time = g_timer_elapsed (timer, NULL) - start_time;
g_print ("%-16s "
g_print ("%-20s "
"mask : %5.2fs, %8.1f fps, %8.2f megapixels/s\n",
enum_value->value_name,
total_time,
@ -196,7 +200,7 @@ test_run (GtkWidget *area,
gdk_flush ();
total_time = g_timer_elapsed (timer, NULL) - start_time;
g_print ("%-16s "
g_print ("%-20s "
"fill : %5.2fs, %8.1f fps, %8.2f megapixels/s\n",
"Color fill",
total_time,
@ -213,6 +217,8 @@ test_preview_area (void)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_accept_focus (GTK_WINDOW (window), FALSE);
area = gimp_preview_area_new ();
gtk_container_add (GTK_CONTAINER (window), area);
gtk_widget_show (area);