diff options
author | Soeren Sandmann <sandmann@daimi.au.dk> | 2004-02-18 17:03:46 +0000 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@src.gnome.org> | 2004-02-18 17:03:46 +0000 |
commit | b69a67119cbd32b647ac180932b2ab90f5cf9d13 (patch) | |
tree | 23287b48ee170770955d9d925f76d8364156172f /gdk/gdkpixbuf-render.c | |
parent | f539d993341bfc657eab7aa760c82d2290d42e60 (diff) | |
download | gdk-pixbuf-b69a67119cbd32b647ac180932b2ab90f5cf9d13.tar.gz |
Use a scratch GC in the case where the background is a solid color.
Wed Feb 18 17:53:27 2004 Soeren Sandmann <sandmann@daimi.au.dk>
* gdk/gdkwindow.c (gdk_window_get_bg_gc): Use a scratch GC in the
case where the background is a solid color.
(gdk_window_clear_backing_rect): Reset the clip region after use.
* gdk/gdkpixbuf-render.c (gdk_pixbuf_render_threshold_alpha): Go
back to using a scratch GC. Pointed out by Owen Taylor
* gdk/gdkdraw.c (gdk_drawable_real_draw_pixbuf): Only use a
scratch GC if the passed-in one is NULL
Diffstat (limited to 'gdk/gdkpixbuf-render.c')
-rw-r--r-- | gdk/gdkpixbuf-render.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/gdk/gdkpixbuf-render.c b/gdk/gdkpixbuf-render.c index 0065ed13f..2675c3995 100644 --- a/gdk/gdkpixbuf-render.c +++ b/gdk/gdkpixbuf-render.c @@ -82,14 +82,13 @@ gdk_pixbuf_render_threshold_alpha (GdkPixbuf *pixbuf, if (width == 0 || height == 0) return; - gc = gdk_gc_new (bitmap); + gc = _gdk_drawable_get_scratch_gc (bitmap, FALSE); if (!pixbuf->has_alpha) { color.pixel = (alpha_threshold == 255) ? 0 : 1; gdk_gc_set_foreground (gc, &color); gdk_draw_rectangle (bitmap, gc, TRUE, dest_x, dest_y, width, height); - g_object_unref (gc); return; } @@ -131,8 +130,6 @@ gdk_pixbuf_render_threshold_alpha (GdkPixbuf *pixbuf, start + dest_x, y + dest_y, x - 1 + dest_x, y + dest_y); } - - g_object_unref (gc); } |