Integer pixel operations for gtk+?

Koen Kooi koen at dominion.kabel.utwente.nl
Tue Feb 13 22:36:04 CET 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rob Taylor schreef:
> Koen Kooi wrote:

>>>> Koen, TBH its pretty easy to figure out a performance test for this
>>>> patch; Write a test 
>> Ehm, and how would *I* do that? I don't code, remember? If for some reason someone feels
>> like being *productive*, here's a chance.
> 
> Ah, well, that would make things difficult. Lets just say now is never a
> bad time to start.. It should be relatively simple, I'm sure you have
> enough experience to manage it. Feel free to ping me on IRC if you're
> having problems.
> 
>>>> that loads in a test image with GdkPixbufLoader, and
>>>> then scales it to several different resolutions, repeating each scale
>>>> some number of times (say, 100), and exits when finished. Then just time
>>>> that test, 
>> The scale, not loading + scale, right?
> 
> Yep.

First try attached, it only manages to lock up my h2200. It's also in OE, so patches
against that are ok as well.

regards,

Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFF0i9DMkyGM64RGpERAnVvAJ9iJGbrS3xBkG4H5Z7a4/Ljvlwy5QCfQNK5
1+FhWLf14KqdKjT31lIOH/w=
=iGGI
-----END PGP SIGNATURE-----
-------------- next part --------------
#include <gtk/gtk.h>
#include <gdk-pixbuf/gdk-pixbuf.h>

static gdouble total_seconds = 0.0;


int
main (int argc, char **argv)
{
        GTimer *timer;

        gtk_init (&argc, &argv);


	GdkPixbuf *pixbuf, *ret;
	pixbuf = gdk_pixbuf_new_from_file("/usr/share/pixop-test/gtk-logo-rgb.gif", NULL);

	timer = g_timer_new ();
	g_timer_start (timer);

	int i;

	for (i = 1; i <= 100 ; i++) {
		ret = gdk_pixbuf_scale_simple (pixbuf, 800, 600, GDK_INTERP_BILINEAR);
		ret = gdk_pixbuf_scale_simple (pixbuf, 300, 400, GDK_INTERP_BILINEAR);
	}
	g_timer_stop (timer);

	total_seconds += g_timer_elapsed (timer, NULL);
        
        gtk_main ();

        g_print ("time spent scaling (in seconds): %lf\n",  total_seconds );

        return 0;
}


More information about the openmoko-devel mailing list