[gtk+] textview: replace gdk_draw_pixbuf() call with Cairo version



commit 373128ce29f71fca2643db8d7f666a5a4d7f30eb
Author: Benjamin Otte <otte redhat com>
Date:   Mon Jul 12 01:40:30 2010 +0200

    textview: replace gdk_draw_pixbuf() call with Cairo version

 gtk/gtktextdisplay.c |   17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtktextdisplay.c b/gtk/gtktextdisplay.c
index f6f0344..59de07d 100644
--- a/gtk/gtktextdisplay.c
+++ b/gtk/gtktextdisplay.c
@@ -317,16 +317,13 @@ gtk_text_renderer_draw_shape (PangoRenderer   *renderer,
       if (gdk_rectangle_intersect (&pixbuf_rect, &text_renderer->clip_rect,
 				   &draw_rect))
 	{
-	  gdk_draw_pixbuf (text_renderer->drawable,
-			   fg_gc,
-			   pixbuf,
-			   draw_rect.x - pixbuf_rect.x,
-			   draw_rect.y - pixbuf_rect.y,
-			   draw_rect.x, draw_rect.y,
-			   draw_rect.width,
-			   draw_rect.height,
-			   GDK_RGB_DITHER_NORMAL,
-			   0, 0);
+          cairo_t *cr = gdk_cairo_create (text_renderer->drawable);
+
+          gdk_cairo_set_source_pixbuf (cr, pixbuf, pixbuf_rect.x, pixbuf_rect.y);
+          gdk_cairo_rectangle (cr, &draw_rect);
+          cairo_fill (cr);
+
+          cairo_destroy (cr);
 	}
     }
   else if (GTK_IS_WIDGET (attr->data))



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