[gtk+/gtk-2-22] pixbuf-engine: Draw mask with Cairo
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-22] pixbuf-engine: Draw mask with Cairo
- Date: Sat, 7 Aug 2010 13:55:49 +0000 (UTC)
commit 88b7857bc8b02025af151da6b0a5e833d28b8344
Author: Benjamin Otte <otte redhat com>
Date: Thu Jul 15 15:44:24 2010 +0200
pixbuf-engine: Draw mask with Cairo
No more gdk_pixbuf_render_threshold_alpha()
modules/engines/pixbuf/pixbuf-render.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/modules/engines/pixbuf/pixbuf-render.c b/modules/engines/pixbuf/pixbuf-render.c
index d074f64..c05832d 100644
--- a/modules/engines/pixbuf/pixbuf-render.c
+++ b/modules/engines/pixbuf/pixbuf-render.c
@@ -479,16 +479,20 @@ pixbuf_render (GdkPixbuf *src,
{
cairo_t *cr;
- cr = gdk_cairo_create (window);
if (mask)
{
- gdk_pixbuf_render_threshold_alpha (tmp_pixbuf, mask,
- x_offset, y_offset,
- rect.x, rect.y,
- rect.width, rect.height,
- 128);
+ cr = gdk_cairo_create (mask);
+
+ 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);
}
+ cr = gdk_cairo_create (window);
gdk_cairo_set_source_pixbuf (cr,
tmp_pixbuf,
-x_offset + rect.x,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]