diff options
Diffstat (limited to 'gdk/gdkpixbuf-render.c')
-rw-r--r-- | gdk/gdkpixbuf-render.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/gdk/gdkpixbuf-render.c b/gdk/gdkpixbuf-render.c index 4361c75be..d4a417bcb 100644 --- a/gdk/gdkpixbuf-render.c +++ b/gdk/gdkpixbuf-render.c @@ -25,6 +25,7 @@ #include "gdkinternals.h" /* _gdk_draw_pixbuf() */ #include "gdk-pixbuf-private.h" #include "gdkpixbuf.h" +#include "gdkscreen.h" @@ -309,10 +310,11 @@ gdk_pixbuf_render_pixmap_and_mask_for_colormap (GdkPixbuf *pixbuf, { GdkGC *gc; - *pixmap_return = gdk_pixmap_new (NULL, gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf), - gdk_colormap_get_visual (colormap)->depth); - gdk_drawable_set_colormap (GDK_DRAWABLE (*pixmap_return), - colormap); + *pixmap_return = gdk_pixmap_new (gdk_screen_get_root_window (colormap->screen), + gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf), + gdk_screen_get_rgb_visual (colormap->screen)->depth); + + gdk_drawable_set_colormap (GDK_DRAWABLE (*pixmap_return), colormap); gc = gdk_gc_new (*pixmap_return); gdk_pixbuf_render_to_drawable (pixbuf, *pixmap_return, gc, 0, 0, 0, 0, @@ -326,8 +328,9 @@ gdk_pixbuf_render_pixmap_and_mask_for_colormap (GdkPixbuf *pixbuf, { if (gdk_pixbuf_get_has_alpha (pixbuf)) { - *mask_return = gdk_pixmap_new (NULL, gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf), 1); - + *mask_return = gdk_pixmap_new (gdk_screen_get_root_window (colormap->screen), + gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf), 1); + gdk_pixbuf_render_threshold_alpha (pixbuf, *mask_return, 0, 0, 0, 0, gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf), |