summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2014-05-07 00:50:37 +0100
committerRobin Watts <robin.watts@artifex.com>2014-05-07 10:12:15 +0100
commit515cb62c5dd98a87341d3c1e45b27b2bf13f1318 (patch)
tree676b487f7bceec7201e9f6b96589bbc130c098d5 /source
parentae20681b54c54755d14cd4631ed13b2a19eeaa67 (diff)
downloadmupdf-515cb62c5dd98a87341d3c1e45b27b2bf13f1318.tar.xz
Bug 694801: fast_cmyk_to_rgb caching broken.
fast_cmyk_to_rgb had a simple 1 place cache to avoid recalculating the same conversions again and again. The implementation was broken though, both in C and ARM code versions. This seems to fix it.
Diffstat (limited to 'source')
-rw-r--r--source/fitz/colorspace.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/fitz/colorspace.c b/source/fitz/colorspace.c
index 01a319de..8b8f3f96 100644
--- a/source/fitz/colorspace.c
+++ b/source/fitz/colorspace.c
@@ -431,11 +431,13 @@ fast_cmyk_to_rgb_ARM(unsigned char *dst, unsigned char *src, int n)
"b 2f @ enter loop \n"
"1: @ White or Black \n"
"@ Cunning trick: On entry r11 = 0 if black, r11 = FF if white \n"
+ "eor r12,r11,#0xFF @ r12= FF if black, 0 if white \n"
"ldrb r7, [r1],#1 @ r8 = s[4] \n"
"strb r11,[r0],#1 @ d[0] = r \n"
"strb r11,[r0],#1 @ d[1] = g \n"
"strb r11,[r0],#1 @ d[2] = b \n"
"strb r7, [r0],#1 @ d[3] = s[4] \n"
+ "mov r12,r12,LSL #24 @ r12 = CMYK \n"
"subs r2, r2, #1 @ r2 = n-- \n"
"beq 9f \n"
"2: @ Main loop starts here \n"
@@ -639,10 +641,18 @@ static void fast_cmyk_to_rgb(fz_context *ctx, fz_pixmap *dst, fz_pixmap *src)
else if (k == 0 && c == 0 && m == 0 && y == 0)
{
r = g = b = 255;
+ C = 0;
+ M = 0;
+ Y = 0;
+ K = 0;
}
else if (k == 255)
{
r = g = b = 0;
+ C = 0;
+ M = 0;
+ Y = 0;
+ K = 255;
}
else
{