Index: src/core/SkXfermode.cpp |
diff --git a/src/core/SkXfermode.cpp b/src/core/SkXfermode.cpp |
index 73d0b01e1e6f2436590f5fec1239ccccfc3679c1..182d3b7197ce20b168275fdd10f73bb25b53f830 100644 |
--- a/src/core/SkXfermode.cpp |
+++ b/src/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 |