From f6792a3ed33fb3e27015accad2385c7b86a00559 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Wed, 20 Jul 2016 17:43:05 +0100 Subject: Fix missing alpha only plotter. Spotted with: mutool draw -A0 -r600 -o out.ppm J11_acrobat.pdf --- source/fitz/draw-paint.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'source/fitz/draw-paint.c') diff --git a/source/fitz/draw-paint.c b/source/fitz/draw-paint.c index afeb989f..00b3868d 100644 --- a/source/fitz/draw-paint.c +++ b/source/fitz/draw-paint.c @@ -358,6 +358,24 @@ template_solid_color_N_general(byte * restrict dp, int n, int w, const byte * re } #endif +static inline void +template_solid_color_0_da(byte * restrict dp, int w, int sa) +{ + if (sa == 256) + { + memset(dp, 255, w); + } + else + { + do + { + *dp = FZ_BLEND(255, *dp, sa); + dp++; + } + while (--w); + } +} + #if FZ_PLOTTERS_G static void paint_solid_color_1_alpha(byte * restrict dp, int n, int w, const byte * restrict color, int da) { @@ -378,6 +396,12 @@ static void paint_solid_color_1_da(byte * restrict dp, int n, int w, const byte } #endif /* FZ_PLOTTERS_G */ +static void paint_solid_color_0_da(byte * restrict dp, int n, int w, const byte * restrict color, int da) +{ + TRACK_FN(); + template_solid_color_0_da(dp, w, 1); +} + #if FZ_PLOTTERS_RGB static void paint_solid_color_3_alpha(byte * restrict dp, int n, int w, const byte * restrict color, int da) { @@ -443,6 +467,8 @@ fz_get_solid_color_painter(int n, const byte * restrict color, int da) { switch (n-da) { + case 0: + return paint_solid_color_0_da; #if FZ_PLOTTERS_G case 1: if (da) -- cgit v1.2.3