diff options
author | Robin Watts <robin.watts@artifex.com> | 2016-05-27 17:13:56 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2016-05-29 10:11:30 +0100 |
commit | 6ac9843782043fd221db156de525fc825ecdeb0c (patch) | |
tree | 0de733d065f4a5a5f0df0c80278c07a09247ca02 /source/fitz/draw-device.c | |
parent | 37dbda6399654f4aaf6a5062e70d85b578d2d584 (diff) | |
download | mupdf-6ac9843782043fd221db156de525fc825ecdeb0c.tar.xz |
Split draw-paint.c plotters out into separate functions.
Again, mainly so profiling works nicely.
Diffstat (limited to 'source/fitz/draw-device.c')
-rw-r--r-- | source/fitz/draw-device.c | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/source/fitz/draw-device.c b/source/fitz/draw-device.c index 88e117c7..202e24dd 100644 --- a/source/fitz/draw-device.c +++ b/source/fitz/draw-device.c @@ -572,14 +572,33 @@ draw_glyph(unsigned char *colorbv, fz_pixmap *dst, fz_glyph *glyph, unsigned char *mp = msk->samples + skip_y * msk->stride + skip_x; int da = dst->alpha; - while (h--) + if (dst->colorspace) { - if (dst->colorspace) - fz_paint_span_with_color(dp, mp, dst->n, w, colorbv, da); - else - fz_paint_span(dp, da, mp, 1, 0, w, 255); - dp += dst->stride; - mp += msk->stride; + fz_span_color_painter_t *fn; + + fn = fz_get_span_color_painter(dst->n, da, colorbv); + if (fn == NULL) + return; + while (h--) + { + (*fn)(dp, mp, dst->n, w, colorbv, da); + dp += dst->stride; + mp += msk->stride; + } + } + else + { + fz_span_painter_t *fn; + + fn = fz_get_span_painter(da, 1, 0, 255); + if (fn == NULL) + return; + while (h--) + { + (*fn)(dp, da, mp, 1, 0, w, 255); + dp += dst->stride; + mp += msk->stride; + } } } } |