diff options
author | Andrea Canciani <ranma42@gmail.com> | 2011-07-04 12:36:23 +0200 |
---|---|---|
committer | Andrea Canciani <ranma42@gmail.com> | 2011-07-21 19:16:42 +0200 |
commit | 1aa077e129485789803ad050f461067b4fe374d7 (patch) | |
tree | 455c9b9d86429eb427d3db98e60dd6696b2c4dae /src/cairo-xlib-private.h | |
parent | 5eb8eacde0ec3267e55e9b63a33ed2d4642867a7 (diff) | |
download | cairo-1aa077e129485789803ad050f461067b4fe374d7.tar.gz |
xcb,xlib: Cleanup GC cache handling
Device mutexes guarantee the consistency between multiple threads,
hence GC cache does not rely anymore on atomic operations.
This makes it possible to avoid bit twiddling and to use a simple
array.
Diffstat (limited to 'src/cairo-xlib-private.h')
-rw-r--r-- | src/cairo-xlib-private.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cairo-xlib-private.h b/src/cairo-xlib-private.h index a6bdcd1e2..d10e986d1 100644 --- a/src/cairo-xlib-private.h +++ b/src/cairo-xlib-private.h @@ -66,6 +66,8 @@ struct _cairo_xlib_hook { #define CUBE_SIZE 6 /* size of gray ramp */ #define RAMP_SIZE 16 +/* maximum number of cached GC's */ +#define GC_CACHE_SIZE 4 struct _cairo_xlib_display { cairo_device_t base; @@ -110,8 +112,8 @@ struct _cairo_xlib_screen { cairo_bool_t has_font_options; cairo_font_options_t font_options; - GC gc[4]; - cairo_atomic_int_t gc_depths; /* 4 x uint8_t */ + GC gc[GC_CACHE_SIZE]; + uint8_t gc_depths[GC_CACHE_SIZE]; cairo_list_t visuals; }; |