diff options
author | Robin Watts <robin.watts@artifex.com> | 2010-06-29 21:56:34 +0200 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2010-06-29 21:56:34 +0200 |
commit | 7748021cc09a52fbb12fc33d7e84806890394249 (patch) | |
tree | 692a594b52bb72b55247a0db7b1095783d552b17 /draw/archx86.c | |
parent | d9661dcb35f70cbd5019db4320cd24d6dbae584a (diff) | |
download | mupdf-7748021cc09a52fbb12fc33d7e84806890394249.tar.xz |
Move over to RGBA instead of ARGB. Add missing gray-alpha 'duff' functions.
Diffstat (limited to 'draw/archx86.c')
-rw-r--r-- | draw/archx86.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/draw/archx86.c b/draw/archx86.c index 0c313f33..5418e9f7 100644 --- a/draw/archx86.c +++ b/draw/archx86.c @@ -40,7 +40,7 @@ static void duff_4i1o4mmx(byte *sp0, int sw, byte *mp0, int mw, byte *dp0, int d { int ts = *s++; int ma = *mp++ + 1; - int sa = ((ts & 0xff) * ma) >> 8; + int sa = (((ts>>24) & 0xff) * ma) >> 8; int ssa = 255 - sa; __m64 d0 = _mm_cvtsi32_si64(*d); @@ -50,11 +50,11 @@ static void duff_4i1o4mmx(byte *sp0, int sw, byte *mp0, int mw, byte *dp0, int d __m64 mma = _mm_set1_pi16(ma); __m64 mssa = _mm_set1_pi16(ssa); - /* unpack 0000argb => a0r0g0b0 */ + /* unpack 0000rgba => r0g0b0a0 */ __m64 d1 = _mm_unpacklo_pi8(d0, mzero); __m64 s1 = _mm_unpacklo_pi8(s0, mzero); - /* s1 * ma => a0r0g0b0 */ + /* s1 * ma => r0g0b0a0 */ __m64 msma = _mm_mullo_pi16(s1, mma); /* d1 * mssa */ __m64 mdssa = _mm_mullo_pi16(d1, mssa); @@ -79,6 +79,8 @@ static void duff_4i1o4mmx(byte *sp0, int sw, byte *mp0, int mw, byte *dp0, int d #if 0 /* TODO */ +/* Needs to be rgba, not bgra, as well as needing finishing */ + static inline unsigned getargb(unsigned *s, int w, int h, int u, int v) { |