aboutsummaryrefslogtreecommitdiffstats
path: root/libgnomecanvas/gnome-canvas-pixbuf.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-11-09 21:41:52 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:41:26 +0800
commita7788ff36828762193cf64b72909bb23ef0fe4d0 (patch)
tree82b2683e0ee2555e55d158742396319a6c722a04 /libgnomecanvas/gnome-canvas-pixbuf.c
parenta19689605aa9ab9fcb1ac59c60e7c2236ea64457 (diff)
downloadgsoc2013-evolution-a7788ff36828762193cf64b72909bb23ef0fe4d0.tar.gz
gsoc2013-evolution-a7788ff36828762193cf64b72909bb23ef0fe4d0.tar.zst
gsoc2013-evolution-a7788ff36828762193cf64b72909bb23ef0fe4d0.zip
Adapt GnomeCanvas to latest gtk+-3.0 API.
Diffstat (limited to 'libgnomecanvas/gnome-canvas-pixbuf.c')
-rw-r--r--libgnomecanvas/gnome-canvas-pixbuf.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/libgnomecanvas/gnome-canvas-pixbuf.c b/libgnomecanvas/gnome-canvas-pixbuf.c
index ea331c6ee8..6fc3e44fd9 100644
--- a/libgnomecanvas/gnome-canvas-pixbuf.c
+++ b/libgnomecanvas/gnome-canvas-pixbuf.c
@@ -50,7 +50,7 @@ static void gnome_canvas_pixbuf_get_property (GObject *object,
GParamSpec *pspec);
static void gnome_canvas_pixbuf_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags);
-static void gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
+static void gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, cairo_t *cr,
gint x, gint y, gint width, gint height);
static GnomeCanvasItem *gnome_canvas_pixbuf_point (GnomeCanvasItem *item,
gdouble x,
@@ -264,13 +264,12 @@ gnome_canvas_pixbuf_update (GnomeCanvasItem *item,
/* Draw handler for the pixbuf canvas item */
static void
-gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
+gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, cairo_t *cr,
gint x, gint y, gint width, gint height)
{
GnomeCanvasPixbuf *gcp;
GnomeCanvasPixbufPrivate *priv;
cairo_matrix_t matrix;
- cairo_t *cr;
gcp = GNOME_CANVAS_PIXBUF (item);
priv = gcp->priv;
@@ -278,18 +277,14 @@ gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
if (!priv->pixbuf)
return;
- cr = gdk_cairo_create (drawable);
gnome_canvas_item_i2c_matrix (item, &matrix);
- if (cairo_matrix_invert (&matrix)) {
- cairo_destroy (cr);
- return;
- }
+
+ cairo_save (cr);
cairo_transform (cr, &matrix);
gdk_cairo_set_source_pixbuf (cr, priv->pixbuf, 0, 0);
cairo_paint (cr);
-
- cairo_destroy (cr);
+ cairo_restore (cr);
}