diff options
author | Robin Watts <robin.watts@artifex.com> | 2012-03-12 16:34:00 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2012-03-12 16:34:00 +0000 |
commit | 5060043a33b32dfdd8ffacc88e8ca05b5e8271a9 (patch) | |
tree | 7323e019847fb6ffd555b4330ef2dbffdeba1dab /fitz/res_font.c | |
parent | caf8e7a6c7cfeb245cdb5ac44d310a82ab0155b3 (diff) | |
download | mupdf-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 'fitz/res_font.c')
-rw-r--r-- | fitz/res_font.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fitz/res_font.c b/fitz/res_font.c index e4a4d23a..f6207e80 100644 --- a/fitz/res_font.c +++ b/fitz/res_font.c @@ -387,7 +387,7 @@ fz_copy_ft_bitmap(fz_context *ctx, int left, int top, FT_Bitmap *bitmap) /* The glyph cache lock is always taken when this is called. */ fz_pixmap * -fz_render_ft_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm) +fz_render_ft_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, int aa) { FT_Face face = font->ft_face; FT_Matrix m; @@ -421,7 +421,7 @@ fz_render_ft_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm) fz_warn(ctx, "freetype setting character size: %s", ft_error_string(fterr)); FT_Set_Transform(face, &m, &v); - if (fz_get_aa_level(ctx) == 0) + if (aa == 0) { /* If you really want grid fitting, enable this code. */ float scale = fz_matrix_expansion(trm); |