[gtk+] border-image: Don't use NEAREST filtering



commit 4f8283055ed4ae24f7774cfb40af2259c2c639fe
Author: Benjamin Otte <otte redhat com>
Date:   Wed Jun 8 01:58:46 2011 +0200

    border-image: Don't use NEAREST filtering
    
    use EXTEND_PAD instead to avoid borders.

 gtk/gtkborderimage.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkborderimage.c b/gtk/gtkborderimage.c
index cf9da9c..bc9e3a6 100644
--- a/gtk/gtkborderimage.c
+++ b/gtk/gtkborderimage.c
@@ -203,16 +203,17 @@ render_corner (cairo_t         *cr,
 
   cairo_save (cr);
 
+  cairo_rectangle (cr, corner_x, corner_y, corner_width, corner_height);
+
   cairo_translate (cr, corner_x, corner_y);
   cairo_scale (cr,
                corner_width / image_width,
                corner_height / image_height);
+
   cairo_set_source_surface (cr, surface, 0, 0);
+  cairo_pattern_set_extend (cairo_get_source (cr), CAIRO_EXTEND_PAD);
 
-  /* use the nearest filter for scaling, to avoid color blending */
-  cairo_pattern_set_filter (cairo_get_source (cr), CAIRO_FILTER_NEAREST);
-
-  cairo_paint (cr);
+  cairo_fill (cr);
 
   cairo_restore (cr);
 }
@@ -405,11 +406,10 @@ render_border (cairo_t              *cr,
   cairo_translate (cr,
                    target_x, target_y);
 
-  /* use the nearest filter for scaling, to avoid color blending */
-  cairo_pattern_set_filter (pattern, CAIRO_FILTER_NEAREST);
-  
   if (repeat_pattern)
     cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
+  else
+    cairo_pattern_set_extend (pattern, CAIRO_EXTEND_PAD);
 
   cairo_scale (cr,
                target_width / surface_width,



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