diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-06-18 14:32:53 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-06-19 00:28:57 +0100 |
commit | c0e01d9cd71bd958e1b31a03cea4c08a1bdf4926 (patch) | |
tree | cf545b73863d7b4c0fb6a72e4b0267b41a20405b /src/cairo-xlib-private.h | |
parent | 7f238f542441cc5912d14e5c6f9c49ffd0b83fad (diff) | |
download | cairo-c0e01d9cd71bd958e1b31a03cea4c08a1bdf4926.tar.gz |
[xlib] Improve GC caching efficacy
Shrink the overall size of the per-screen GC cache, but allow multiple GCs
per depth, as it quite common to need up to two temporary GCs along some
drawing paths. Decrease the number of GCs we obtain in total by returning
clean (i.e. a GC without a clip set) back to the screen pool after use.
Compensate for the increased number of put/get by performing the query
using atomic operations where available. So overall we see a dramatic
reduction on the numbers of XCreateGC and XFreeGC, of even greater benefit
for RENDER-less servers.
Diffstat (limited to 'src/cairo-xlib-private.h')
-rw-r--r-- | src/cairo-xlib-private.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/cairo-xlib-private.h b/src/cairo-xlib-private.h index 4995bc6f9..c79617bf5 100644 --- a/src/cairo-xlib-private.h +++ b/src/cairo-xlib-private.h @@ -103,8 +103,8 @@ struct _cairo_xlib_screen_info { cairo_bool_t has_font_options; cairo_font_options_t font_options; - GC gc[9]; - unsigned int gc_needs_clip_reset; + GC gc[4]; + int gc_depths; /* 4 x uint8_t, high bit == needs reset */ cairo_array_t visuals; }; @@ -154,12 +154,13 @@ _cairo_xlib_screen_info_close_display (cairo_xlib_screen_info_t *info); cairo_private GC _cairo_xlib_screen_get_gc (cairo_xlib_screen_info_t *info, - int depth, + unsigned int depth, + Drawable drawable, unsigned int *need_reset); -cairo_private cairo_status_t +cairo_private void _cairo_xlib_screen_put_gc (cairo_xlib_screen_info_t *info, - int depth, + unsigned int depth, GC gc, cairo_bool_t reset_clip); |