[planner: 14/61] eel-canvas-rect: Port gdk_draw_pixbuf to cairo
- From: Mart Raudsepp <mraudsepp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [planner: 14/61] eel-canvas-rect: Port gdk_draw_pixbuf to cairo
- Date: Sat, 12 Jun 2021 17:30:22 +0000 (UTC)
commit 89fb9dd0910cb01663efe3223be04633874f292b
Author: Mart Raudsepp <leio gentoo org>
Date: Sat Mar 7 00:16:50 2020 +0200
eel-canvas-rect: Port gdk_draw_pixbuf to cairo
src/eel-canvas-rect.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/src/eel-canvas-rect.c b/src/eel-canvas-rect.c
index 3692d351..0692d0a4 100644
--- a/src/eel-canvas-rect.c
+++ b/src/eel-canvas-rect.c
@@ -29,6 +29,7 @@
#include <string.h>
#include <glib.h>
+#include <cairo.h>
#include <libgnomecanvas/gnome-canvas-util.h>
/*
@@ -448,6 +449,7 @@ render_rect_alpha (EelCanvasRect *rect,
guchar *data;
int rowstride, i;
guchar r, g, b, a;
+ cairo_t *cr;
if (width <= 0 || height <= 0 ) {
return;
@@ -473,13 +475,10 @@ render_rect_alpha (EelCanvasRect *rect,
memcpy (data + i*rowstride, data, width*4);
}
- gdk_draw_pixbuf (drawable,
- NULL,
- pixbuf,
- 0, 0,
- x, y,
- width, height,
- GDK_RGB_DITHER_NONE, 0, 0);
+ cr = gdk_cairo_create (drawable);
+ gdk_cairo_set_source_pixbuf (cr, pixbuf, x, y);
+ cairo_paint (cr);
+ cairo_destroy (cr);
g_object_unref (pixbuf);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]