From 3278d5079ad2d86a97bb495e3c75f91494ebf690 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Wed, 14 Feb 2007 07:19:19 +0000 Subject: pixop-test: adds new enhanced version written by Rob Taylor --- packages/gtk+/pixops-test.bb | 2 +- packages/gtk+/pixops-test/pixops-test.c | 51 +++++++++++++++++++++++++++------ 2 files changed, 43 insertions(+), 10 deletions(-) diff --git a/packages/gtk+/pixops-test.bb b/packages/gtk+/pixops-test.bb index b65f700a16..79bc33a04f 100644 --- a/packages/gtk+/pixops-test.bb +++ b/packages/gtk+/pixops-test.bb @@ -1,7 +1,7 @@ DESCRIPTION = "Productive gtk+ devel prodder" DEPENDS = "gtk+" -PR = "r1" +PR = "r2" inherit pkgconfig diff --git a/packages/gtk+/pixops-test/pixops-test.c b/packages/gtk+/pixops-test/pixops-test.c index 33a11263de..f8906dfc42 100644 --- a/packages/gtk+/pixops-test/pixops-test.c +++ b/packages/gtk+/pixops-test/pixops-test.c @@ -1,35 +1,68 @@ #include #include +#include static gdouble total_seconds = 0.0; +/* randomly colour each pixel */ +static void +fill_pixbuf (GdkPixbuf *buf) +{ + int width, height, rowstride, n_channels; + int x,y,n; + guchar *pixels, *p; + + g_assert (gdk_pixbuf_get_bits_per_sample (buf) == 8); + + n_channels = gdk_pixbuf_get_n_channels (buf); + width = gdk_pixbuf_get_width (buf); + height = gdk_pixbuf_get_height (buf); + rowstride = gdk_pixbuf_get_rowstride (buf); + pixels = gdk_pixbuf_get_pixels (buf); + + for (x=0; x