diff options
author | Robin Watts <robin.watts@artifex.com> | 2017-06-15 17:57:28 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2017-06-22 14:59:43 +0100 |
commit | 2764ef8c0fd10d16a41842e8834efb1bd17e65d8 (patch) | |
tree | c1811c37e5314d59754e82a467ca88c775e7cd16 /source/fitz/draw-glyph.c | |
parent | dd58ea5e2ff7e6b61cc5a5b6fd950fb62e92b8be (diff) | |
download | mupdf-2764ef8c0fd10d16a41842e8834efb1bd17e65d8.tar.xz |
Move rasterizer/anti-alias choices into the draw device.
We still use the fz_context versions as the default, but these
can be overridden with draw device options.
Diffstat (limited to 'source/fitz/draw-glyph.c')
-rw-r--r-- | source/fitz/draw-glyph.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/source/fitz/draw-glyph.c b/source/fitz/draw-glyph.c index 7a6b9126..49ca6661 100644 --- a/source/fitz/draw-glyph.c +++ b/source/fitz/draw-glyph.c @@ -177,7 +177,7 @@ fz_subpixel_adjust(fz_context *ctx, fz_matrix *ctm, fz_matrix *subpix_ctm, unsig } fz_glyph * -fz_render_stroked_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix *trm, const fz_matrix *ctm, const fz_stroke_state *stroke, const fz_irect *scissor) +fz_render_stroked_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix *trm, const fz_matrix *ctm, const fz_stroke_state *stroke, const fz_irect *scissor, int aa) { if (fz_font_ft_face(ctx, font)) { @@ -187,13 +187,13 @@ fz_render_stroked_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix *trm, if (stroke->dash_len > 0) return NULL; (void)fz_subpixel_adjust(ctx, trm, &subpix_trm, &qe, &qf); - return fz_render_ft_stroked_glyph(ctx, font, gid, &subpix_trm, ctm, stroke); + return fz_render_ft_stroked_glyph(ctx, font, gid, &subpix_trm, ctm, stroke, aa); } - return fz_render_glyph(ctx, font, gid, trm, NULL, scissor, 1); + return fz_render_glyph(ctx, font, gid, trm, NULL, scissor, 1, aa); } fz_pixmap * -fz_render_stroked_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, fz_matrix *trm, const fz_matrix *ctm, const fz_stroke_state *stroke, const fz_irect *scissor) +fz_render_stroked_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, fz_matrix *trm, const fz_matrix *ctm, const fz_stroke_state *stroke, const fz_irect *scissor, int aa) { if (fz_font_ft_face(ctx, font)) { @@ -203,9 +203,9 @@ fz_render_stroked_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, fz_matri if (stroke->dash_len > 0) return NULL; (void)fz_subpixel_adjust(ctx, trm, &subpix_trm, &qe, &qf); - return fz_render_ft_stroked_glyph_pixmap(ctx, font, gid, &subpix_trm, ctm, stroke); + return fz_render_ft_stroked_glyph_pixmap(ctx, font, gid, &subpix_trm, ctm, stroke, aa); } - return fz_render_glyph_pixmap(ctx, font, gid, trm, scissor); + return fz_render_glyph_pixmap(ctx, font, gid, trm, scissor, aa); } static unsigned do_hash(unsigned char *s, int len) @@ -245,7 +245,7 @@ move_to_front(fz_glyph_cache *cache, fz_glyph_cache_entry *entry) } fz_glyph * -fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix *ctm, fz_colorspace *model, const fz_irect *scissor, int alpha) +fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix *ctm, fz_colorspace *model, const fz_irect *scissor, int alpha, int aa) { fz_glyph_cache *cache; fz_glyph_key key; @@ -289,7 +289,7 @@ fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix *ctm, fz_colo key.b = subpix_ctm.b * 65536; key.c = subpix_ctm.c * 65536; key.d = subpix_ctm.d * 65536; - key.aa = fz_text_aa_level(ctx); + key.aa = aa; hash = do_hash((unsigned char *)&key, sizeof(key)) % GLYPH_HASH_LEN; fz_lock(ctx, FZ_LOCK_GLYPHCACHE); @@ -314,7 +314,7 @@ fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix *ctm, fz_colo { if (is_ft_font) { - val = fz_render_ft_glyph(ctx, font, gid, &subpix_ctm, key.aa); + val = fz_render_ft_glyph(ctx, font, gid, &subpix_ctm, aa); } else if (fz_font_t3_procs(ctx, font)) { @@ -329,7 +329,7 @@ fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix *ctm, fz_colo */ fz_unlock(ctx, FZ_LOCK_GLYPHCACHE); locked = 0; - val = fz_render_t3_glyph(ctx, font, gid, &subpix_ctm, model, scissor); + val = fz_render_t3_glyph(ctx, font, gid, &subpix_ctm, model, scissor, aa); fz_lock(ctx, FZ_LOCK_GLYPHCACHE); locked = 1; } @@ -411,7 +411,7 @@ unlock_and_return_val: } fz_pixmap * -fz_render_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, fz_matrix *ctm, const fz_irect *scissor) +fz_render_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, fz_matrix *ctm, const fz_irect *scissor, int aa) { fz_pixmap *val; unsigned char qe, qf; @@ -433,11 +433,11 @@ fz_render_glyph_pixmap(fz_context *ctx, fz_font *font, int gid, fz_matrix *ctm, { if (is_ft_font) { - val = fz_render_ft_glyph_pixmap(ctx, font, gid, &subpix_ctm, fz_text_aa_level(ctx)); + val = fz_render_ft_glyph_pixmap(ctx, font, gid, &subpix_ctm, aa); } else if (fz_font_t3_procs(ctx, font)) { - val = fz_render_t3_glyph_pixmap(ctx, font, gid, &subpix_ctm, NULL, scissor); + val = fz_render_t3_glyph_pixmap(ctx, font, gid, &subpix_ctm, NULL, scissor, aa); } else { |