Index: src/opts/SkBlitRow_opts_arm_neon.cpp |
diff --git a/src/opts/SkBlitRow_opts_arm_neon.cpp b/src/opts/SkBlitRow_opts_arm_neon.cpp |
index 0755f5d61dae131b903e9b4d92ddd9eb40902d06..ca67469808bd8f543d5d3e9d8e3f742f26c7813a 100644 |
--- a/src/opts/SkBlitRow_opts_arm_neon.cpp |
+++ b/src/opts/SkBlitRow_opts_arm_neon.cpp |
@@ -635,8 +635,7 @@ void S32A_D565_Blend_neon(uint16_t* SK_RESTRICT dst, |
vdst = vld1q_u16(dst); |
#ifdef SK_CPU_ARM64 |
vsrc = sk_vld4_u8_arm64_4(src); |
-#else |
-#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 6)) |
+#elif (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 6)) |
asm ( |
"vld4.u8 %h[vsrc], [%[src]]!" |
: [vsrc] "=w" (vsrc), [src] "+&r" (src) |
@@ -659,7 +658,6 @@ void S32A_D565_Blend_neon(uint16_t* SK_RESTRICT dst, |
vsrc.val[2] = d2; |
vsrc.val[3] = d3; |
#endif |
-#endif // #ifdef SK_CPU_ARM64 |
// deinterleave dst |
@@ -1311,37 +1309,6 @@ void S32A_Blend_BlitRow32_neon(SkPMColor* SK_RESTRICT dst, |
/////////////////////////////////////////////////////////////////////////////// |
-#undef DEBUG_OPAQUE_DITHER |
- |
-#if defined(DEBUG_OPAQUE_DITHER) |
-static void showme8(char *str, void *p, int len) |
-{ |
- static char buf[256]; |
- char tbuf[32]; |
- int i; |
- char *pc = (char*) p; |
- sprintf(buf,"%8s:", str); |
- for(i=0;i<len;i++) { |
- sprintf(tbuf, " %02x", pc[i]); |
- strcat(buf, tbuf); |
- } |
- SkDebugf("%s\n", buf); |
-} |
-static void showme16(char *str, void *p, int len) |
-{ |
- static char buf[256]; |
- char tbuf[32]; |
- int i; |
- uint16_t *pc = (uint16_t*) p; |
- sprintf(buf,"%8s:", str); |
- len = (len / sizeof(uint16_t)); /* passed as bytes */ |
- for(i=0;i<len;i++) { |
- sprintf(tbuf, " %04x", pc[i]); |
- strcat(buf, tbuf); |
- } |
- SkDebugf("%s\n", buf); |
-} |
-#endif |
#endif // #ifdef SK_CPU_ARM32 |
void S32A_D565_Opaque_Dither_neon (uint16_t * SK_RESTRICT dst, |
@@ -1353,17 +1320,6 @@ void S32A_D565_Opaque_Dither_neon (uint16_t * SK_RESTRICT dst, |
if (count >= UNROLL) { |
-#if defined(DEBUG_OPAQUE_DITHER) |
- uint16_t tmpbuf[UNROLL]; |
- int td[UNROLL]; |
- int tdv[UNROLL]; |
- int ta[UNROLL]; |
- int tap[UNROLL]; |
- uint16_t in_dst[UNROLL]; |
- int offset = 0; |
- int noisy = 0; |
-#endif |
- |
uint8x8_t dbase; |
const uint8_t *dstart = &gDitherMatrix_Neon[(y&3)*12 + (x&3)]; |
dbase = vld1_u8(dstart); |
@@ -1374,52 +1330,6 @@ void S32A_D565_Opaque_Dither_neon (uint16_t * SK_RESTRICT dst, |
uint16x8_t dst8, scale8, alpha8; |
uint16x8_t dst_r, dst_g, dst_b; |
-#if defined(DEBUG_OPAQUE_DITHER) |
- // calculate 8 elements worth into a temp buffer |
- { |
- int my_y = y; |
- int my_x = x; |
- SkPMColor* my_src = (SkPMColor*)src; |
- uint16_t* my_dst = dst; |
- int i; |
- |
- DITHER_565_SCAN(my_y); |
- for(i = 0; i < UNROLL; i++) { |
- SkPMColor c = *my_src++; |
- SkPMColorAssert(c); |
- if (c) { |
- unsigned a = SkGetPackedA32(c); |
- |
- int d = SkAlphaMul(DITHER_VALUE(my_x), SkAlpha255To256(a)); |
- tdv[i] = DITHER_VALUE(my_x); |
- ta[i] = a; |
- tap[i] = SkAlpha255To256(a); |
- td[i] = d; |
- |
- unsigned sr = SkGetPackedR32(c); |
- unsigned sg = SkGetPackedG32(c); |
- unsigned sb = SkGetPackedB32(c); |
- sr = SkDITHER_R32_FOR_565(sr, d); |
- sg = SkDITHER_G32_FOR_565(sg, d); |
- sb = SkDITHER_B32_FOR_565(sb, d); |
- |
- uint32_t src_expanded = (sg << 24) | (sr << 13) | (sb << 2); |
- uint32_t dst_expanded = SkExpand_rgb_16(*my_dst); |
- dst_expanded = dst_expanded * (SkAlpha255To256(255 - a) >> 3); |
- // now src and dst expanded are in g:11 r:10 x:1 b:10 |
- tmpbuf[i] = SkCompact_rgb_16((src_expanded + dst_expanded) >> 5); |
- td[i] = d; |
- } else { |
- tmpbuf[i] = *my_dst; |
- ta[i] = tdv[i] = td[i] = 0xbeef; |
- } |
- in_dst[i] = *my_dst; |
- my_dst += 1; |
- DITHER_INC_X(my_x); |
- } |
- } |
-#endif |
- |
#ifdef SK_CPU_ARM64 |
vsrc = sk_vld4_u8_arm64_4(src); |
#else |
@@ -1489,43 +1399,6 @@ void S32A_D565_Opaque_Dither_neon (uint16_t * SK_RESTRICT dst, |
vst1q_u16(dst, dst8); |
-#if defined(DEBUG_OPAQUE_DITHER) |
- // verify my 8 elements match the temp buffer |
- { |
- int i, bad=0; |
- static int invocation; |
- |
- for (i = 0; i < UNROLL; i++) { |
- if (tmpbuf[i] != dst[i]) { |
- bad=1; |
- } |
- } |
- if (bad) { |
- SkDebugf("BAD S32A_D565_Opaque_Dither_neon(); invocation %d offset %d\n", |
- invocation, offset); |
- SkDebugf(" alpha 0x%x\n", alpha); |
- for (i = 0; i < UNROLL; i++) |
- SkDebugf("%2d: %s %04x w %04x id %04x s %08x d %04x %04x %04x %04x\n", |
- i, ((tmpbuf[i] != dst[i])?"BAD":"got"), dst[i], tmpbuf[i], |
- in_dst[i], src[i-8], td[i], tdv[i], tap[i], ta[i]); |
- |
- showme16("alpha8", &alpha8, sizeof(alpha8)); |
- showme16("scale8", &scale8, sizeof(scale8)); |
- showme8("d", &d, sizeof(d)); |
- showme16("dst8", &dst8, sizeof(dst8)); |
- showme16("dst_b", &dst_b, sizeof(dst_b)); |
- showme16("dst_g", &dst_g, sizeof(dst_g)); |
- showme16("dst_r", &dst_r, sizeof(dst_r)); |
- showme8("sb", &sb, sizeof(sb)); |
- showme8("sg", &sg, sizeof(sg)); |
- showme8("sr", &sr, sizeof(sr)); |
- |
- return; |
- } |
- offset += UNROLL; |
- invocation++; |
- } |
-#endif |
dst += UNROLL; |
count -= UNROLL; |
// skip x += UNROLL, since it's unchanged mod-4 |
@@ -1569,8 +1442,6 @@ void S32A_D565_Opaque_Dither_neon (uint16_t * SK_RESTRICT dst, |
/////////////////////////////////////////////////////////////////////////////// |
-#undef DEBUG_S32_OPAQUE_DITHER |
- |
void S32_D565_Opaque_Dither_neon(uint16_t* SK_RESTRICT dst, |
const SkPMColor* SK_RESTRICT src, |
int count, U8CPU alpha, int x, int y) { |
@@ -1637,25 +1508,6 @@ void S32_D565_Opaque_Dither_neon(uint16_t* SK_RESTRICT dst, |
// store it |
vst1q_u16(dst, dst8); |
-#if defined(DEBUG_S32_OPAQUE_DITHER) |
- // always good to know if we generated good results |
- { |
- int i, myx = x, myy = y; |
- DITHER_565_SCAN(myy); |
- for (i=0;i<UNROLL;i++) { |
- // the '!' in the asm block above post-incremented src by the 8 pixels it reads. |
- SkPMColor c = src[i-8]; |
- unsigned dither = DITHER_VALUE(myx); |
- uint16_t val = SkDitherRGB32To565(c, dither); |
- if (val != dst[i]) { |
- SkDebugf("RBE: src %08x dither %02x, want %04x got %04x dbas[i] %02x\n", |
- c, dither, val, dst[i], dstart[i]); |
- } |
- DITHER_INC_X(myx); |
- } |
- } |
-#endif |
- |
dst += UNROLL; |
// we don't need to increment src as the asm above has already done it |
count -= UNROLL; |