[gtk+/rendering-cleanup: 5/89] image: replace gdk_draw_pixbuf() call with Cairo equivalent



commit 9cf1ebdaae5f60166992472ea5451b7efe982fa9
Author: Benjamin Otte <otte redhat com>
Date:   Mon Jul 12 14:25:53 2010 +0200

    image: replace gdk_draw_pixbuf() call with Cairo equivalent

 gtk/gtkimage.c |   16 +++++-----------
 1 files changed, 5 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index a234e4a..a9b4e75 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -2112,17 +2112,11 @@ gtk_image_expose (GtkWidget      *widget,
 
               if (pixbuf)
                 {
-                  gdk_draw_pixbuf (widget->window,
-				   widget->style->black_gc,
-				   pixbuf,
-				   image_bound.x - x,
-				   image_bound.y - y,
-				   image_bound.x,
-				   image_bound.y,
-				   image_bound.width,
-				   image_bound.height,
-				   GDK_RGB_DITHER_NORMAL,
-				   0, 0);
+                  cairo_t *cr = gdk_cairo_create (widget->window);
+                  gdk_cairo_set_source_pixbuf (cr, pixbuf, x, y);
+                  gdk_cairo_rectangle (cr, &image_bound);
+                  cairo_fill (cr);
+                  cairo_destroy (cr);
                 }
             }
           else



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