[dia] [image] don't use GDK_INTERP_TILES for very small images



commit 2e51e1b0067a7cb90403fa57e27cd2c757f353e3
Author: Hans Breuer <hans breuer org>
Date:   Fri Oct 12 12:31:52 2012 +0200

    [image] don't use GDK_INTERP_TILES for very small images
    
    don't waste interpolation time if it wont be seen anyway

 lib/dia_image.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/lib/dia_image.c b/lib/dia_image.c
index ae20386..9596de2 100644
--- a/lib/dia_image.c
+++ b/lib/dia_image.c
@@ -222,8 +222,9 @@ dia_image_get_scaled_pixbuf(DiaImage *image, int width, int height)
 	image->scaled_width != width || image->scaled_height != height) {
       if (image->scaled)
 	g_object_unref(image->scaled);
-      image->scaled = gdk_pixbuf_scale_simple(image->image, width, height, 
-					      GDK_INTERP_TILES);
+      image->scaled = gdk_pixbuf_scale_simple(image->image, width, height,
+	/* dont waste interpolation time if it wont be seen anyway */
+	(width * height > 256) ? GDK_INTERP_TILES : GDK_INTERP_NEAREST);
       image->scaled_width = width;
       image->scaled_height = height;
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]