aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/core/SkXfermode.h52
-rw-r--r--samplecode/SampleAll.cpp49
-rw-r--r--src/core/SkXfermode.cpp112
-rw-r--r--src/utils/debugger/SkDebugCanvas.cpp2
4 files changed, 0 insertions, 215 deletions
diff --git a/include/core/SkXfermode.h b/include/core/SkXfermode.h
index 9bad1e8d37..88f3f620d2 100644
--- a/include/core/SkXfermode.h
+++ b/include/core/SkXfermode.h
@@ -17,8 +17,6 @@ class GrEffectRef;
class GrTexture;
class SkString;
-//#define SK_SUPPORT_LEGACY_PROCXFERMODE
-
/** \class SkXfermode
*
* SkXfermode is the base class for objects that are called to implement custom
@@ -246,54 +244,4 @@ private:
typedef SkFlattenable INHERITED;
};
-///////////////////////////////////////////////////////////////////////////////
-
-#ifdef SK_SUPPORT_LEGACY_PROCXFERMODE
-/** \class SkProcXfermode
-
- SkProcXfermode is a xfermode that applies the specified proc to its colors.
- This class is not exported to java.
-*/
-class SK_API SkProcXfermode : public SkXfermode {
-public:
- static SkProcXfermode* Create(SkXfermodeProc proc) {
- return SkNEW_ARGS(SkProcXfermode, (proc));
- }
-
- // overrides from SkXfermode
- virtual void xfer32(SkPMColor dst[], const SkPMColor src[], int count,
- const SkAlpha aa[]) const SK_OVERRIDE;
- virtual void xfer16(uint16_t dst[], const SkPMColor src[], int count,
- const SkAlpha aa[]) const SK_OVERRIDE;
- virtual void xferA8(SkAlpha dst[], const SkPMColor src[], int count,
- const SkAlpha aa[]) const SK_OVERRIDE;
-
- SK_TO_STRING_OVERRIDE()
- SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkProcXfermode)
-
-protected:
- SkProcXfermode(SkReadBuffer&);
- virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
-
- // allow subclasses to update this after we unflatten
- void setProc(SkXfermodeProc proc) {
- fProc = proc;
- }
-
- SkXfermodeProc getProc() const {
- return fProc;
- }
-
-#ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS
-public:
-#endif
- SkProcXfermode(SkXfermodeProc proc) : fProc(proc) {}
-
-private:
- SkXfermodeProc fProc;
-
- typedef SkXfermode INHERITED;
-};
-#endif
-
#endif
diff --git a/samplecode/SampleAll.cpp b/samplecode/SampleAll.cpp
index 96dcdae057..ea1f143288 100644
--- a/samplecode/SampleAll.cpp
+++ b/samplecode/SampleAll.cpp
@@ -491,55 +491,6 @@ protected:
canvas->restore();
}
- /*
-./SkColorFilter.h:25:class SkColorFilter : public SkFlattenable { -- abstract
- static SkColorFilter* CreatXfermodeFilter() *** untested ***
- static SkColorFilter* CreatePorterDuffFilter() *** untested ***
- static SkColorFilter* CreateLightingFilter() -- tested
-./SkDrawLooper.h:9:class SkDrawLooper : public SkFlattenable { -- virtually abstract
- ./SkBlurDrawLooper.h:9:class SkBlurDrawLooper : public SkDrawLooper { *** untested ***
-./SkMaskFilter.h:41:class SkMaskFilter : public SkFlattenable { -- abstract chmod +w .h
- ./SkEmbossMaskFilter.h:27:class SkEmbossMaskFilter : public SkMaskFilter { -- tested
-./SkPathEffect.h:33:class SkPathEffect : public SkFlattenable { -- abstract
- ./Sk1DPathEffect.h:27:class Sk1DPathEffect : public SkPathEffect { -- abstract
- ./Sk1DPathEffect.h:48:class SkPath1DPathEffect : public Sk1DPathEffect { -- tested
- ./Sk2DPathEffect.h:25:class Sk2DPathEffect : public SkPathEffect { *** untested ***
- ./SkCornerPathEffect.h:28:class SkCornerPathEffect : public SkPathEffect { *** untested ***
- ./SkDashPathEffect.h:27:class SkDashPathEffect : public SkPathEffect {
- ./SkDiscretePathEffect.h:27:class SkDiscretePathEffect : public SkPathEffect {
- ./SkPaint.h:760:class SkStrokePathEffect : public SkPathEffect {
- ./SkPathEffect.h:58:class SkPairPathEffect : public SkPathEffect {
- ./SkPathEffect.h:78:class SkComposePathEffect : public SkPairPathEffect {
- ./SkPathEffect.h:114:class SkSumPathEffect : public SkPairPathEffect {
-./SkRasterizer.h:29:class SkRasterizer : public SkFlattenable {
- ./SkLayerRasterizer.h:27:class SkLayerRasterizer : public SkRasterizer {
-./SkShader.h:36:class SkShader : public SkFlattenable {
- ./SkColorFilter.h:59:class SkFilterShader : public SkShader {
- ./SkColorShader.h:26:class SkColorShader : public SkShader {
- ./SkShaderExtras.h:31:class SkComposeShader : public SkShader {
- ./SkTransparentShader.h:23:class SkTransparentShader : public SkShader {
-./SkUnitMapper.h:24:class SkUnitMapper : public SkFlattenable {
- ./SkUnitMapper.h:33:class SkDiscreteMapper : public SkUnitMapper {
- ./SkUnitMapper.h:51:class SkFlipCosineMapper : public SkUnitMapper {
-./SkXfermode.h:32:class SkXfermode : public SkFlattenable {
- ./SkAvoidXfermode.h:28:class SkAvoidXfermode : public SkXfermode { *** not done *** chmod +w .h .cpp
- ./SkXfermode.h:54:class SkProcXfermode : public SkXfermode {
- */
-
- /*
-./SkBlurMaskFilter.h:25:class SkBlurMaskFilter {
- chmod +w SkBlurMaskFilter.cpp
-./SkGradientShader.h:30:class SkGradientShader {
- */
- // save layer, bounder, looper
- // matrix
- // clip /path/region
- // bitmap proc shader ?
-
-/* untested:
-SkCornerPathEffect.h:28:class SkCornerPathEffect : public SkPathEffect {
-*/
-
virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y, unsigned modi) {
fClickPt.set(x, y);
this->inval(NULL);
diff --git a/src/core/SkXfermode.cpp b/src/core/SkXfermode.cpp
index 73d0b01e1e..182d3b7197 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
diff --git a/src/utils/debugger/SkDebugCanvas.cpp b/src/utils/debugger/SkDebugCanvas.cpp
index ec201789fd..14fbf8888a 100644
--- a/src/utils/debugger/SkDebugCanvas.cpp
+++ b/src/utils/debugger/SkDebugCanvas.cpp
@@ -125,8 +125,6 @@ public:
#endif
};
-// The OverdrawFilter modifies every paint to use an SkProcXfermode which
-// in turn invokes OverdrawXferModeProc
class SkOverdrawFilter : public SkDrawFilter {
public:
SkOverdrawFilter() {