diff --git a/demos/testpixbuf-scale.c b/demos/testpixbuf-scale.c index d512513f6d..6d335e1cc0 100644 --- a/demos/testpixbuf-scale.c +++ b/demos/testpixbuf-scale.c @@ -35,6 +35,7 @@ gboolean expose_cb (GtkWidget *widget, GdkEventExpose *event, gpointer data) { GdkPixbuf *dest; + cairo_t *cr; gdk_window_set_back_pixmap (widget->window, NULL, FALSE); @@ -48,11 +49,13 @@ expose_cb (GtkWidget *widget, GdkEventExpose *event, gpointer data) interp_type, overall_alpha, event->area.x, event->area.y, 16, 0xaaaaaa, 0x555555); - gdk_draw_pixbuf (widget->window, widget->style->fg_gc[GTK_STATE_NORMAL], dest, - 0, 0, event->area.x, event->area.y, - event->area.width, event->area.height, - GDK_RGB_DITHER_NORMAL, event->area.x, event->area.y); - + cr = gdk_cairo_create (event->window); + + gdk_cairo_set_source_pixbuf (cr, dest, 0, 0); + gdk_cairo_rectangle (cr, &event->area); + cairo_fill (cr); + + cairo_destroy (cr); g_object_unref (dest); return TRUE; diff --git a/demos/testpixbuf.c b/demos/testpixbuf.c index 64357c11a5..2c4ee01d44 100644 --- a/demos/testpixbuf.c +++ b/demos/testpixbuf.c @@ -322,6 +322,7 @@ expose_func (GtkWidget *drawing_area, GdkEventExpose *event, gpointer data) if (gdk_pixbuf_get_has_alpha (pixbuf)) { GdkPixbuf *dest; + cairo_t *cr; gdk_window_set_back_pixmap (drawing_area->window, NULL, FALSE); @@ -335,11 +336,13 @@ expose_func (GtkWidget *drawing_area, GdkEventExpose *event, gpointer data) GDK_INTERP_BILINEAR, 255, event->area.x, event->area.y, 16, 0xaaaaaa, 0x555555); - gdk_draw_pixbuf (drawing_area->window, drawing_area->style->fg_gc[GTK_STATE_NORMAL], dest, - 0, 0, event->area.x, event->area.y, - event->area.width, event->area.height, - GDK_RGB_DITHER_NORMAL, event->area.x, event->area.y); - + cr = gdk_cairo_create (drawing_area->window); + + gdk_cairo_set_source_pixbuf (cr, dest, 0, 0); + gdk_cairo_rectangle (cr, &event->area); + cairo_fill (cr); + + cairo_destroy (cr); g_object_unref (dest); } else { gdk_draw_rgb_image (drawing_area->window,