diff options
Diffstat (limited to 'src/cairo_font.c')
-rw-r--r-- | src/cairo_font.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/cairo_font.c b/src/cairo_font.c index 5ad9f0417..f5fc0e981 100644 --- a/src/cairo_font.c +++ b/src/cairo_font.c @@ -36,7 +36,6 @@ #include "cairoint.h" - /* First we implement a global font cache for named fonts. */ typedef struct { @@ -54,9 +53,9 @@ typedef struct { static unsigned long _font_cache_hash (void *cache, void *key) { + unsigned long hash; cairo_font_cache_key_t *in; in = (cairo_font_cache_key_t *) key; - unsigned long hash; /* 1607 and 1451 are just a couple random primes. */ hash = _cairo_hash_string (in->family); @@ -86,12 +85,11 @@ _font_cache_create_entry (void *cache, void *key, void **return_value) { + const cairo_font_backend_t *backend = CAIRO_FONT_BACKEND_DEFAULT; cairo_font_cache_key_t *k; cairo_font_cache_entry_t *entry; k = (cairo_font_cache_key_t *) key; - const struct cairo_font_backend *backend = CAIRO_FONT_BACKEND_DEFAULT; - /* XXX: The current freetype backend may return NULL, (for example * if no fonts are installed), but I would like to guarantee that * the toy API always returns at least *some* font, so I would @@ -145,7 +143,7 @@ _font_cache_destroy_cache (void *cache) free (cache); } -const struct cairo_cache_backend cairo_font_cache_backend = { +static const cairo_cache_backend_t cairo_font_cache_backend = { _font_cache_hash, _font_cache_keys_equal, _font_cache_create_entry, @@ -153,7 +151,6 @@ const struct cairo_cache_backend cairo_font_cache_backend = { _font_cache_destroy_cache }; - static void _lock_global_font_cache (void) { @@ -239,8 +236,8 @@ _cairo_font_init (cairo_font_t *scaled, } cairo_status_t -_cairo_unscaled_font_init (cairo_unscaled_font_t *font, - const struct cairo_font_backend *backend) +_cairo_unscaled_font_init (cairo_unscaled_font_t *font, + const cairo_font_backend_t *backend) { font->refcount = 1; font->backend = backend; @@ -476,7 +473,7 @@ _image_glyph_cache_destroy_cache (void *cache) free (cache); } -const cairo_cache_backend_t cairo_image_cache_backend = { +static const cairo_cache_backend_t cairo_image_cache_backend = { _cairo_glyph_cache_hash, _cairo_glyph_cache_keys_equal, _image_glyph_cache_create_entry, @@ -484,7 +481,6 @@ const cairo_cache_backend_t cairo_image_cache_backend = { _image_glyph_cache_destroy_cache }; - void _cairo_lock_global_image_glyph_cache() { |