From 3865f08781c9c30a2deb8dc1448d0d95923ad430 Mon Sep 17 00:00:00 2001 From: Diego Escalante Urrelo Date: Fri, 20 Aug 2010 01:46:27 -0500 Subject: lib/widgets: use cairo for drawing widgets Drop deprecated gdk_* drawing functions. Bug #627450 --- lib/widgets/ephy-spinner.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'lib/widgets/ephy-spinner.c') diff --git a/lib/widgets/ephy-spinner.c b/lib/widgets/ephy-spinner.c index 077249443..cec0deaf4 100644 --- a/lib/widgets/ephy-spinner.c +++ b/lib/widgets/ephy-spinner.c @@ -625,8 +625,7 @@ ephy_spinner_expose (GtkWidget *widget, EphySpinnerImages *images; GtkAllocation allocation; GdkPixbuf *pixbuf; - GdkWindow *window; - GdkGC *gc; + cairo_t *cr; int x_offset, y_offset, width, height; GdkRectangle pix_area, dest; @@ -675,15 +674,12 @@ ephy_spinner_expose (GtkWidget *widget, return FALSE; } - window = gtk_widget_get_window (widget); - gc = gdk_gc_new (window); - gdk_draw_pixbuf (window, gc, pixbuf, - dest.x - x_offset - allocation.x, - dest.y - y_offset - allocation.y, - dest.x, dest.y, - dest.width, dest.height, - GDK_RGB_DITHER_MAX, 0, 0); - g_object_unref (gc); + cr = gdk_cairo_create (gtk_widget_get_window (widget)); + + gdk_cairo_set_source_pixbuf (cr, pixbuf, dest.x, dest.y); + cairo_paint (cr); + + cairo_destroy (cr); return FALSE; } -- cgit v1.2.3