summaryrefslogtreecommitdiff
path: root/gdk/gdkpixbuf-render.c
diff options
context:
space:
mode:
authorSoeren Sandmann <sandmann@daimi.au.dk>2004-02-18 00:59:14 +0000
committerSøren Sandmann Pedersen <ssp@src.gnome.org>2004-02-18 00:59:14 +0000
commit1c51c48606930b3a784c0bbc99a5a8eb2188ca5f (patch)
treea8ae2772d178953d6f9c2cd996eaa1f1a63f87f2 /gdk/gdkpixbuf-render.c
parentb3013744c5fb3deb8d2e292f300fc54fc710dc85 (diff)
downloadgdk-pixbuf-1c51c48606930b3a784c0bbc99a5a8eb2188ca5f.tar.gz
GC caching, bug #125645 (based on patch by Brian Cameron)
Wed Feb 18 01:44:59 2004 Soeren Sandmann <sandmann@daimi.au.dk> GC caching, bug #125645 (based on patch by Brian Cameron) * gdk/gdkscreen.h (struct _GdkScreen): Add GC cache * gdk/gdkscreen.c (gdk_screen_dispose): New function. Unref the cached GC's here. * gdk/gdkdraw.c (_gdk_drawable_get_scratch_gc): New function to get a scratch gc. * gdk/gdkinternals.h: Declare the function here * gdk/gdkdraw.c (gdk_drawable_real_draw_pixbuf): Use _gdk_drawable_get_scratch_gc() instead of creating a new GC. * gdk/x11/gdkgeometry-x11.c (gdk_window_copy_area_scroll): same * gdk/x11/gdkdrawable-x11.c (draw_with_images): same * gdk/gdkwindow.c (gdk_window_get_composite_drawable): same * gdk/gdkwindow.c (gdk_window_end_paint): same * gdk/gdkpixmap.c (gdk_pixmap_colormap_new_from_pixbuf): same * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_threshold_alpha): same * gdk/gdkpixbuf-render.c (gdk_pixbuf_render_pixmap_and_mask_for_colormap): same
Diffstat (limited to 'gdk/gdkpixbuf-render.c')
-rw-r--r--gdk/gdkpixbuf-render.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gdk/gdkpixbuf-render.c b/gdk/gdkpixbuf-render.c
index 8095188d9..b93fac33c 100644
--- a/gdk/gdkpixbuf-render.c
+++ b/gdk/gdkpixbuf-render.c
@@ -25,6 +25,7 @@
#include "gdk-pixbuf-private.h"
#include "gdkpixbuf.h"
#include "gdkscreen.h"
+#include "gdkinternals.h"
@@ -82,6 +83,7 @@ gdk_pixbuf_render_threshold_alpha (GdkPixbuf *pixbuf,
return;
gc = gdk_gc_new (bitmap);
+ gc = _gdk_drawable_get_scratch_gc (GDK_DRAWABLE (bitmap), FALSE);
if (!pixbuf->has_alpha)
{
@@ -130,8 +132,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);
}
@@ -305,13 +305,12 @@ gdk_pixbuf_render_pixmap_and_mask_for_colormap (GdkPixbuf *pixbuf,
gdk_colormap_get_visual (colormap)->depth);
gdk_drawable_set_colormap (GDK_DRAWABLE (*pixmap_return), colormap);
- gc = gdk_gc_new (*pixmap_return);
+ gc = _gdk_drawable_get_scratch_gc (*pixmap_return, FALSE);
gdk_draw_pixbuf (*pixmap_return, gc, pixbuf,
0, 0, 0, 0,
gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf),
GDK_RGB_DITHER_NORMAL,
0, 0);
- g_object_unref (gc);
}
if (mask_return)