diff options
author | Robin Watts <robin.watts@artifex.com> | 2016-07-20 20:59:21 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2016-07-22 11:58:48 +0100 |
commit | e98091d56afdf1cf6c9a017fa0bd35dd0b8968f0 (patch) | |
tree | 5caa5c8d15dd3e32a77979aa31fbfed146d7a0e6 /source/fitz | |
parent | 629d8446b6d9f2712fdf2970df0b78824ad872a0 (diff) | |
download | mupdf-e98091d56afdf1cf6c9a017fa0bd35dd0b8968f0.tar.xz |
Move hash calculation outside locked region.
Try to reduce contention on the glyphcache lock.
Diffstat (limited to 'source/fitz')
-rw-r--r-- | source/fitz/draw-glyph.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/fitz/draw-glyph.c b/source/fitz/draw-glyph.c index 014cc13a..dbaace9e 100644 --- a/source/fitz/draw-glyph.c +++ b/source/fitz/draw-glyph.c @@ -286,8 +286,8 @@ fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix *ctm, fz_colo key.d = subpix_ctm.d * 65536; key.aa = fz_text_aa_level(ctx); - fz_lock(ctx, FZ_LOCK_GLYPHCACHE); hash = do_hash((unsigned char *)&key, sizeof(key)) % GLYPH_HASH_LEN; + fz_lock(ctx, FZ_LOCK_GLYPHCACHE); entry = cache->entry[hash]; while (entry) { |