diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2010-08-19 16:28:28 +0200 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2010-08-19 16:35:27 +0200 |
commit | 9c9c619ae2d4e9dbdc9be175679abad3a174ca32 (patch) | |
tree | 3b845611917472fae037e0250ea230ed44cb52a0 | |
parent | 7ed8e2d7b90489f41ad674aa4758728dce62fa77 (diff) | |
download | nautilus-9c9c619ae2d4e9dbdc9be175679abad3a174ca32.tar.gz |
[test] remove eel-pixbuf-scale test
-rw-r--r-- | test/Makefile.am | 2 | ||||
-rw-r--r-- | test/test-eel-pixbuf-scale.c | 84 |
2 files changed, 0 insertions, 86 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index c19400f32..1a78320d6 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -21,7 +21,6 @@ noinst_PROGRAMS =\ test-eel-background \ test-eel-editable-label \ test-eel-image-scrolled \ - test-eel-pixbuf-scale \ $(NULL) test_nautilus_copy_SOURCES = test-copy.c test.c @@ -32,7 +31,6 @@ test_nautilus_directory_async_SOURCES = test-nautilus-directory-async.c test_eel_background_SOURCES = test-eel-background.c test_eel_image_scrolled_SOURCES = test-eel-image-scrolled.c test.c test.h -test_eel_pixbuf_scale_SOURCES = test-eel-pixbuf-scale.c test.c test.h EXTRA_DIST = \ test.h \ diff --git a/test/test-eel-pixbuf-scale.c b/test/test-eel-pixbuf-scale.c deleted file mode 100644 index f03e1b919..000000000 --- a/test/test-eel-pixbuf-scale.c +++ /dev/null @@ -1,84 +0,0 @@ -#include "test.h" - -#include <eel/eel-gdk-pixbuf-extensions.h> - -#include <sys/time.h> -#include <stdlib.h> - - -#define N_SCALES 100 - -#define DEST_WIDTH 32 -#define DEST_HEIGHT 32 - -int -main (int argc, char* argv[]) -{ - GdkPixbuf *pixbuf, *scaled; - GError *error; - struct timeval t1, t2; - int i; - - test_init (&argc, &argv); - - if (argc != 2) { - printf ("Usage: test <image filename>\n"); - exit (1); - } - - error = NULL; - pixbuf = gdk_pixbuf_new_from_file (argv[1], &error); - - if (pixbuf == NULL) { - printf ("error loading pixbuf: %s\n", error->message); - exit (1); - } - - printf ("scale factors: %f, %f\n", - (double)gdk_pixbuf_get_width(pixbuf)/DEST_WIDTH, - (double)gdk_pixbuf_get_height(pixbuf)/DEST_HEIGHT); - - gettimeofday(&t1, NULL); - for (i = 0; i < N_SCALES; i++) { - scaled = eel_gdk_pixbuf_scale_down (pixbuf, DEST_WIDTH, DEST_HEIGHT); - g_object_unref (scaled); - } - gettimeofday(&t2, NULL); - g_print ("Time for eel_gdk_pixbuf_scale_down: %ld msecs\n", - (t2.tv_sec - t1.tv_sec) * 1000 + (t2.tv_usec - t1.tv_usec) / 1000); - - - - gettimeofday(&t1, NULL); - for (i = 0; i < N_SCALES; i++) { - scaled = gdk_pixbuf_scale_simple (pixbuf, DEST_WIDTH, DEST_HEIGHT, GDK_INTERP_NEAREST); - g_object_unref (scaled); - } - gettimeofday(&t2, NULL); - g_print ("Time for INTERP_NEAREST: %ld msecs\n", - (t2.tv_sec - t1.tv_sec) * 1000 + (t2.tv_usec - t1.tv_usec) / 1000); - - - gettimeofday(&t1, NULL); - for (i = 0; i < N_SCALES; i++) { - scaled = gdk_pixbuf_scale_simple (pixbuf, DEST_WIDTH, DEST_HEIGHT, GDK_INTERP_BILINEAR); - g_object_unref (scaled); - } - gettimeofday(&t2, NULL); - g_print ("Time for INTERP_BILINEAR: %ld msecs\n", - (t2.tv_sec - t1.tv_sec) * 1000 + (t2.tv_usec - t1.tv_usec) / 1000); - - scaled = eel_gdk_pixbuf_scale_down (pixbuf, DEST_WIDTH, DEST_HEIGHT); - gdk_pixbuf_save (scaled, "eel_scaled.png", "png", NULL, NULL); - g_object_unref (scaled); - - scaled = gdk_pixbuf_scale_simple (pixbuf, DEST_WIDTH, DEST_HEIGHT, GDK_INTERP_NEAREST); - gdk_pixbuf_save (scaled, "nearest_scaled.png", "png", NULL, NULL); - g_object_unref (scaled); - - scaled = gdk_pixbuf_scale_simple (pixbuf, DEST_WIDTH, DEST_HEIGHT, GDK_INTERP_BILINEAR); - gdk_pixbuf_save (scaled, "bilinear_scaled.png", "png", NULL, NULL); - g_object_unref (scaled); - - return 0; -} |