diff options
author | Arturo Espinosa <unammx@src.gnome.org> | 1999-10-28 00:34:59 +0000 |
---|---|---|
committer | Arturo Espinosa <unammx@src.gnome.org> | 1999-10-28 00:34:59 +0000 |
commit | 53ffebed1953f888c0aaedbc9564f7c6a3cf8805 (patch) | |
tree | 315f056cb9a7f867201af59eee6debbb5fd69615 /gdk/gdkpixbuf-render.c | |
parent | 0eb096334e73642bb9b274289b7916ea00298d3a (diff) | |
download | gtk+-53ffebed1953f888c0aaedbc9564f7c6a3cf8805.tar.gz |
Sync to laptop - Federico
Diffstat (limited to 'gdk/gdkpixbuf-render.c')
-rw-r--r-- | gdk/gdkpixbuf-render.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/gdk/gdkpixbuf-render.c b/gdk/gdkpixbuf-render.c index 674da391ba..3f02f69362 100644 --- a/gdk/gdkpixbuf-render.c +++ b/gdk/gdkpixbuf-render.c @@ -132,6 +132,7 @@ gdk_pixbuf_render_to_drawable (GdkPixbuf *pixbuf, GdkDrawable *drawable, ArtPixBuf *apb; ArtIRect dest_rect, req_rect, area_rect; GdkBitmap *bitmap; + GdkGC *gc; g_return_if_fail (pixbuf != NULL); apb = pixbuf->art_pixbuf; @@ -144,6 +145,23 @@ gdk_pixbuf_render_to_drawable (GdkPixbuf *pixbuf, GdkDrawable *drawable, g_return_if_fail (src_x >= 0 && src_x + width <= apb->width); g_return_if_fail (src_y >= 0 && src_y + height <= apb->height); + gc = gdk_gc_new (drawable); + + if (apb->has_alpha) { + /* Right now we only support GDK_PIXBUF_ALPHA_BILEVEL, so we + * unconditionally create the clipping mask. + */ + + bitmap = gdk_pixmap_new (NULL, width, height, 1); + gdk_pixbuf_render_threshold_alpha (pixbuf, bitmap, + src_x, src_y, + 0, 0, + width, height, + alpha_threshold); + + gdk_gc_set_clip_mask (gc, bitmap); + gdk_gc_set_clip_origin (gc, dest_x, dest_y); + } + - bitmap = gdk_pixmap_new (NULL, width, height, 1); } |