diff options
Diffstat (limited to 'core/SkXfermode.cpp')
-rw-r--r-- | core/SkXfermode.cpp | 114 |
1 files changed, 1 insertions, 113 deletions
diff --git a/core/SkXfermode.cpp b/core/SkXfermode.cpp index 53c431b7..182d3b71 100644 --- a/core/SkXfermode.cpp +++ b/core/SkXfermode.cpp @@ -774,118 +774,6 @@ void SkXfermode::xferA8(SkAlpha* SK_RESTRICT dst, } } -/////////////////////////////////////////////////////////////////////////////// -#ifdef SK_SUPPORT_LEGACY_PROCXFERMODE - -void SkProcXfermode::xfer32(SkPMColor* SK_RESTRICT dst, - const SkPMColor* SK_RESTRICT src, int count, - const SkAlpha* SK_RESTRICT aa) const { - SkASSERT(dst && src && count >= 0); - - SkXfermodeProc proc = fProc; - - if (NULL != proc) { - if (NULL == aa) { - for (int i = count - 1; i >= 0; --i) { - dst[i] = proc(src[i], dst[i]); - } - } else { - for (int i = count - 1; i >= 0; --i) { - unsigned a = aa[i]; - if (0 != a) { - SkPMColor dstC = dst[i]; - SkPMColor C = proc(src[i], dstC); - if (a != 0xFF) { - C = SkFourByteInterp(C, dstC, a); - } - dst[i] = C; - } - } - } - } -} - -void SkProcXfermode::xfer16(uint16_t* SK_RESTRICT dst, - const SkPMColor* SK_RESTRICT src, int count, - const SkAlpha* SK_RESTRICT aa) const { - SkASSERT(dst && src && count >= 0); - - SkXfermodeProc proc = fProc; - - if (NULL != proc) { - if (NULL == aa) { - for (int i = count - 1; i >= 0; --i) { - SkPMColor dstC = SkPixel16ToPixel32(dst[i]); - dst[i] = SkPixel32ToPixel16_ToU16(proc(src[i], dstC)); - } - } else { - for (int i = count - 1; i >= 0; --i) { - unsigned a = aa[i]; - if (0 != a) { - SkPMColor dstC = SkPixel16ToPixel32(dst[i]); - SkPMColor C = proc(src[i], dstC); - if (0xFF != a) { - C = SkFourByteInterp(C, dstC, a); - } - dst[i] = SkPixel32ToPixel16_ToU16(C); - } - } - } - } -} - -void SkProcXfermode::xferA8(SkAlpha* SK_RESTRICT dst, - const SkPMColor* SK_RESTRICT src, int count, - const SkAlpha* SK_RESTRICT aa) const { - SkASSERT(dst && src && count >= 0); - - SkXfermodeProc proc = fProc; - - if (NULL != proc) { - if (NULL == aa) { - for (int i = count - 1; i >= 0; --i) { - SkPMColor res = proc(src[i], dst[i] << SK_A32_SHIFT); - dst[i] = SkToU8(SkGetPackedA32(res)); - } - } else { - for (int i = count - 1; i >= 0; --i) { - unsigned a = aa[i]; - if (0 != a) { - SkAlpha dstA = dst[i]; - SkPMColor res = proc(src[i], dstA << SK_A32_SHIFT); - unsigned A = SkGetPackedA32(res); - if (0xFF != a) { - A = SkAlphaBlend(A, dstA, SkAlpha255To256(a)); - } - dst[i] = SkToU8(A); - } - } - } - } -} - -SkProcXfermode::SkProcXfermode(SkReadBuffer& buffer) - : SkXfermode(buffer) { - fProc = NULL; - if (!buffer.isCrossProcess()) { - fProc = (SkXfermodeProc)buffer.readFunctionPtr(); - } -} - -void SkProcXfermode::flatten(SkWriteBuffer& buffer) const { - this->INHERITED::flatten(buffer); - if (!buffer.isCrossProcess()) { - buffer.writeFunctionPtr((void*)fProc); - } -} - -#ifndef SK_IGNORE_TO_STRING -void SkProcXfermode::toString(SkString* str) const { - str->appendf("SkProcXfermode: %p", fProc); -} -#endif - -#endif ////////////////////////////////////////////////////////////////////////////// #if SK_SUPPORT_GPU @@ -1076,7 +964,7 @@ public: break; } default: - GrCrash("Unknown XferEffect mode."); + SkFAIL("Unknown XferEffect mode."); break; } } |