summaryrefslogtreecommitdiff
path: root/draw/draw_glyph.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-03-12 16:34:00 +0000
committerRobin Watts <robin.watts@artifex.com>2012-03-12 16:34:00 +0000
commit5060043a33b32dfdd8ffacc88e8ca05b5e8271a9 (patch)
tree7323e019847fb6ffd555b4330ef2dbffdeba1dab /draw/draw_glyph.c
parentcaf8e7a6c7cfeb245cdb5ac44d310a82ab0155b3 (diff)
downloadmupdf-5060043a33b32dfdd8ffacc88e8ca05b5e8271a9.tar.xz
Store AA level used to render a glyph in the glyphcache.
In the existing code, glyphs are stored/retrieved from the glyphcache with no reference to the antialias level used to create them. This means that if we are using different aa levels in different threads, we can retrieve 'non-matching' glyphs and hence get rendering indeterminisms. Fixed simply here by storing the aa level in the glyphcache too.
Diffstat (limited to 'draw/draw_glyph.c')
-rw-r--r--draw/draw_glyph.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/draw/draw_glyph.c b/draw/draw_glyph.c
index 110a7a25..b8f69ce3 100644
--- a/draw/draw_glyph.c
+++ b/draw/draw_glyph.c
@@ -20,6 +20,7 @@ struct fz_glyph_key_s
int c, d;
unsigned short gid;
unsigned char e, f;
+ int aa;
};
void
@@ -128,6 +129,7 @@ fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix ctm, fz_color
key.d = ctm.d * 65536;
key.e = (ctm.e - floorf(ctm.e)) * 256;
key.f = (ctm.f - floorf(ctm.f)) * 256;
+ key.aa = fz_get_aa_level(ctx);
fz_lock(ctx, FZ_LOCK_GLYPHCACHE);
val = fz_hash_find(ctx, cache->hash, &key);
@@ -145,7 +147,7 @@ fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix ctm, fz_color
{
if (font->ft_face)
{
- val = fz_render_ft_glyph(ctx, font, gid, ctm);
+ val = fz_render_ft_glyph(ctx, font, gid, ctm, key.aa);
}
else if (font->t3procs)
{