]> Pileus Git - ~andy/gtk/commitdiff
Keep the mask around until after we draw ... since the GC changes aren't
authorOwen Taylor <otaylor@redhat.com>
Tue, 30 Nov 1999 17:56:02 +0000 (17:56 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Tue, 30 Nov 1999 17:56:02 +0000 (17:56 +0000)
1999-11-29  Owen Taylor  <otaylor@redhat.com>

* src/gdk-pixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
Keep the mask around until after we draw ... since
the GC changes aren't flushed to the X server until we
draw, destroying it before that may result in BadPixmap
errors.

gdk-pixbuf/ChangeLog
gdk/gdkpixbuf-render.c

index 9e6c5d1fbde921e76abe08d4652c9600ddb32a7e..15ab9509d6dbdc53f756df24cff3f426ea190e8f 100644 (file)
@@ -1,3 +1,11 @@
+1999-11-29  Owen Taylor  <otaylor@redhat.com>
+
+       * src/gdk-pixbuf-render.c (gdk_pixbuf_render_to_drawable_alpha):
+       Keep the mask around until after we draw ... since
+       the GC changes aren't flushed to the X server until we
+       draw, destroying it before that may result in BadPixmap
+       errors.
+
 1999-11-30  Havoc Pennington  <hp@pobox.com>
 
        * configure.in: Add AM_CONDITIONAL for inside gnome-libs
index 60ee06d29f74fe6400ca9c7475a280bebe7577c1..c85a367160f71d1a11addcac63257e26522026fb 100644 (file)
@@ -276,7 +276,7 @@ gdk_pixbuf_render_to_drawable_alpha (GdkPixbuf *pixbuf, GdkDrawable *drawable,
                                     int x_dither, int y_dither)
 {
        ArtPixBuf *apb;
-       GdkBitmap *bitmap;
+       GdkBitmap *bitmap = NULL;
        GdkGC *gc;
 
        g_return_if_fail (pixbuf != NULL);
@@ -306,7 +306,6 @@ gdk_pixbuf_render_to_drawable_alpha (GdkPixbuf *pixbuf, GdkDrawable *drawable,
 
                gdk_gc_set_clip_mask (gc, bitmap);
                gdk_gc_set_clip_origin (gc, dest_x, dest_y);
-               gdk_bitmap_unref (bitmap);
        }
 
        gdk_pixbuf_render_to_drawable (pixbuf, drawable, gc,
@@ -316,5 +315,8 @@ gdk_pixbuf_render_to_drawable_alpha (GdkPixbuf *pixbuf, GdkDrawable *drawable,
                                       dither,
                                       x_dither, y_dither);
 
+       if (bitmap)
+               gdk_bitmap_unref (bitmap);
        gdk_gc_unref (gc);
 }
+