summaryrefslogtreecommitdiff
path: root/source/fitz/draw-paint.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-07-20 17:43:05 +0100
committerRobin Watts <robin.watts@artifex.com>2016-07-20 17:45:06 +0100
commitf6792a3ed33fb3e27015accad2385c7b86a00559 (patch)
tree26e678c62168826512be14db21383cfb26b84f01 /source/fitz/draw-paint.c
parent03909b0f38a58f47aec99a72a726ff7a791f5f08 (diff)
downloadmupdf-f6792a3ed33fb3e27015accad2385c7b86a00559.tar.xz
Fix missing alpha only plotter.
Spotted with: mutool draw -A0 -r600 -o out.ppm J11_acrobat.pdf
Diffstat (limited to 'source/fitz/draw-paint.c')
-rw-r--r--source/fitz/draw-paint.c26
1 files changed, 26 insertions, 0 deletions
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)