summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross@linux.intel.com>2005-01-27 15:26:22 +0000
committerRoss Burton <ross@linux.intel.com>2005-01-27 15:26:22 +0000
commitb05e20b0f076f7bcb1c13baa41038686c25864c4 (patch)
treec8f73a93fb3995d9cf81359586f8d86c4e0515ca
parent1d4c5d65c5c99264825f8a100776fd45b839c569 (diff)
downloadfstests-b05e20b0f076f7bcb1c13baa41038686c25864c4.tar.gz
fstests-b05e20b0f076f7bcb1c13baa41038686c25864c4.tar.bz2
fstests-b05e20b0f076f7bcb1c13baa41038686c25864c4.zip
Small optimisation to the drawing loop and turn off double-buffering
-rw-r--r--tests/test-gdk.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/test-gdk.c b/tests/test-gdk.c
index 38d85b2..ff232b9 100644
--- a/tests/test-gdk.c
+++ b/tests/test-gdk.c
@@ -53,6 +53,8 @@ expose(GtkWidget *darea,
start_clock = GetTimeInMillis();
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, width, height);
+ rowstride = gdk_pixbuf_get_rowstride (pixbuf);
+ pixels = gdk_pixbuf_get_pixels (pixbuf);
for(y=0; y < height; y++)
for(x=0; x < width; x++)
@@ -61,9 +63,6 @@ expose(GtkWidget *darea,
guchar g = y;
guchar r = x - y;
- rowstride = gdk_pixbuf_get_rowstride (pixbuf);
- pixels = gdk_pixbuf_get_pixels (pixbuf);
-
p = pixels + y * rowstride + x * n_channels;
p[0] = b; p[1] = g; p[2] = r;
@@ -73,7 +72,7 @@ expose(GtkWidget *darea,
if (Verbose)
{
- printf("test-x: Surface ( %i X %i, %i KB ) Created in %lli ms\n",
+ printf("test-x: Surface ( %u X %u, %lu KB ) Created in %lli ms\n",
width, height, size / 1024, finish_clock - start_clock);
}
@@ -154,6 +153,8 @@ main(int argc, char **argv)
darea = gtk_drawing_area_new();
+
+ gtk_widget_set_double_buffered (darea, FALSE);
gtk_container_add(GTK_CONTAINER(window), darea);