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 | |
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')
-rw-r--r-- | fitz/fitz.h | 2 | ||||
-rw-r--r-- | fitz/res_font.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/fitz/fitz.h b/fitz/fitz.h index 6427537f..1ec1eb97 100644 --- a/fitz/fitz.h +++ b/fitz/fitz.h @@ -1747,7 +1747,7 @@ fz_glyph_cache *fz_keep_glyph_cache(fz_context *ctx); void fz_drop_glyph_cache_context(fz_context *ctx); void fz_purge_glyph_cache(fz_context *ctx); -fz_pixmap *fz_render_ft_glyph(fz_context *ctx, fz_font *font, int cid, fz_matrix trm); +fz_pixmap *fz_render_ft_glyph(fz_context *ctx, fz_font *font, int cid, fz_matrix trm, int aa); fz_pixmap *fz_render_t3_glyph(fz_context *ctx, fz_font *font, int cid, fz_matrix trm, fz_colorspace *model); fz_pixmap *fz_render_ft_stroked_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm, fz_matrix ctm, fz_stroke_state *state); fz_pixmap *fz_render_glyph(fz_context *ctx, fz_font*, int, fz_matrix, fz_colorspace *model); 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); |