diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2013-03-22 01:03:12 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-03-22 01:06:11 +0000 |
commit | 6f43d604b62da50ca55abc0e21f129bbb9859781 (patch) | |
tree | 786dd7a8149b0b5a24d2a91b5bc636e6a7dff177 /pdf | |
parent | 7b334e226f7ac03352461935e7193d4c9a27ddca (diff) | |
download | mupdf-6f43d604b62da50ca55abc0e21f129bbb9859781.tar.xz |
pdf_device: only output color if it's changed.
I'd half finished this code before, and only spotted the missing
bits while cleaning up some warnings.
Diffstat (limited to 'pdf')
-rw-r--r-- | pdf/pdf_device.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pdf/pdf_device.c b/pdf/pdf_device.c index 277a0618..058f4cb9 100644 --- a/pdf/pdf_device.c +++ b/pdf/pdf_device.c @@ -436,7 +436,10 @@ pdf_dev_color(pdf_device *pdev, fz_colorspace *colorspace, float *color, int str } if (gs->colorspace[stroke] != colorspace) + { gs->colorspace[stroke] = colorspace; + diff = 1; + } for (i=0; i < colorspace->n; i++) if (gs->color[stroke][i] != color[i]) @@ -445,6 +448,9 @@ pdf_dev_color(pdf_device *pdev, fz_colorspace *colorspace, float *color, int str diff = 1; } + if (diff == 0) + return; + switch (cspace + stroke*8) { case 1: |