[gtk+/rendering-cleanup: 1/89] entry: replace gdk_draw_pixbuf() call with Cairo version



commit 8b7d4d1f70596588ee506955d774d0c727f6f9c6
Author: Benjamin Otte <otte redhat com>
Date:   Mon Jul 12 00:00:07 2010 +0200

    entry: replace gdk_draw_pixbuf() call with Cairo version

 gtk/gtkentry.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 046cc76..fc0cf13 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -3209,6 +3209,7 @@ draw_icon (GtkWidget            *widget,
   EntryIconInfo *icon_info = priv->icons[icon_pos];
   GdkPixbuf *pixbuf;
   gint x, y, width, height;
+  cairo_t *cr;
 
   if (!icon_info)
     return;
@@ -3266,9 +3267,10 @@ draw_icon (GtkWidget            *widget,
       pixbuf = temp_pixbuf;
     }
 
-  gdk_draw_pixbuf (icon_info->window, widget->style->black_gc, pixbuf,
-                   0, 0, x, y, -1, -1,
-                   GDK_RGB_DITHER_NORMAL, 0, 0);
+  cr = gdk_cairo_create (icon_info->window);
+  gdk_cairo_set_source_pixbuf (cr, pixbuf, x, y);
+  cairo_paint (cr);
+  cairo_destroy (cr);
 
   g_object_unref (pixbuf);
 }



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