]> Pileus Git - ~andy/gtk/commitdiff
pixbuf-engine: replace call to gdk_draw_pixbuf() with Cairo equivalent
authorBenjamin Otte <otte@redhat.com>
Mon, 12 Jul 2010 13:44:32 +0000 (15:44 +0200)
committerBenjamin Otte <otte@redhat.com>
Mon, 26 Jul 2010 14:42:47 +0000 (16:42 +0200)
modules/engines/pixbuf/pixbuf-render.c

index 7b5bb12d20dfd35742abbc695410af085222b13b..d074f64c912f61320dd762fe733386873696bc78 100644 (file)
@@ -477,6 +477,9 @@ pixbuf_render (GdkPixbuf    *src,
 
   if (tmp_pixbuf)
     {
+      cairo_t *cr;
+      
+      cr = gdk_cairo_create (window);
       if (mask)
        {
          gdk_pixbuf_render_threshold_alpha (tmp_pixbuf, mask,
@@ -485,13 +488,15 @@ pixbuf_render (GdkPixbuf    *src,
                                             rect.width, rect.height,
                                             128);
        }
-      
-      gdk_draw_pixbuf (window, NULL, tmp_pixbuf,
-                      x_offset, y_offset,
-                      rect.x, rect.y,
-                      rect.width, rect.height,
-                      GDK_RGB_DITHER_NORMAL,
-                      0, 0);
+
+      gdk_cairo_set_source_pixbuf (cr, 
+                                   tmp_pixbuf,
+                                   -x_offset + rect.x, 
+                                   -y_offset + rect.y);
+      gdk_cairo_rectangle (cr, &rect);
+      cairo_fill (cr);
+
+      cairo_destroy (cr);
       g_object_unref (tmp_pixbuf);
     }
 }