diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkBitmapProcShader.cpp | 9 | ||||
-rw-r--r-- | src/core/SkBitmapProcShader.h | 3 | ||||
-rw-r--r-- | src/core/SkBlitter.cpp | 9 | ||||
-rw-r--r-- | src/core/SkComposeShader.cpp | 14 | ||||
-rw-r--r-- | src/core/SkEmptyShader.h | 4 | ||||
-rw-r--r-- | src/core/SkFilterShader.cpp | 7 | ||||
-rw-r--r-- | src/core/SkFilterShader.h | 3 | ||||
-rw-r--r-- | src/core/SkFlattenable.cpp | 12 | ||||
-rw-r--r-- | src/core/SkLocalMatrixShader.cpp | 9 | ||||
-rw-r--r-- | src/core/SkLocalMatrixShader.h | 15 | ||||
-rw-r--r-- | src/core/SkPathEffect.cpp | 8 | ||||
-rw-r--r-- | src/core/SkPictureShader.cpp | 9 | ||||
-rw-r--r-- | src/core/SkShader.cpp | 17 | ||||
-rw-r--r-- | src/core/SkXfermode.cpp | 29 | ||||
-rw-r--r-- | src/core/SkXfermode_proccoeff.h | 6 |
15 files changed, 7 insertions, 147 deletions
diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp index 1a451fd591..f01d559058 100644 --- a/src/core/SkBitmapProcShader.cpp +++ b/src/core/SkBitmapProcShader.cpp @@ -39,15 +39,6 @@ SkBitmapProcShader::SkBitmapProcShader(const SkBitmap& src, TileMode tmx, TileMo fTileModeY = (uint8_t)tmy; } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkBitmapProcShader::SkBitmapProcShader(SkReadBuffer& buffer) : INHERITED(buffer) { - buffer.readBitmap(&fRawBitmap); - fRawBitmap.setImmutable(); - fTileModeX = buffer.readUInt(); - fTileModeY = buffer.readUInt(); -} -#endif - SkShader::BitmapType SkBitmapProcShader::asABitmap(SkBitmap* texture, SkMatrix* texM, TileMode xy[]) const { diff --git a/src/core/SkBitmapProcShader.h b/src/core/SkBitmapProcShader.h index 17bb83bf56..e6ff1af1cf 100644 --- a/src/core/SkBitmapProcShader.h +++ b/src/core/SkBitmapProcShader.h @@ -56,9 +56,6 @@ public: }; protected: -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING - SkBitmapProcShader(SkReadBuffer& ); -#endif virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; virtual Context* onCreateContext(const ContextRec&, void* storage) const SK_OVERRIDE; diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp index f4669d5959..ba260ad716 100644 --- a/src/core/SkBlitter.cpp +++ b/src/core/SkBlitter.cpp @@ -714,15 +714,6 @@ public: SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(Sk3DShader) protected: -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING - Sk3DShader(SkReadBuffer& buffer) : INHERITED(buffer) { - fProxy = buffer.readShader(); - // Leaving this here until we bump the picture version, though this - // shader should never be recorded. - buffer.readColor(); - } -#endif - virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE { buffer.writeFlattenable(fProxy); } diff --git a/src/core/SkComposeShader.cpp b/src/core/SkComposeShader.cpp index 3c5b55aae6..3c6623d291 100644 --- a/src/core/SkComposeShader.cpp +++ b/src/core/SkComposeShader.cpp @@ -26,20 +26,6 @@ SkComposeShader::SkComposeShader(SkShader* sA, SkShader* sB, SkXfermode* mode) { SkSafeRef(mode); } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkComposeShader::SkComposeShader(SkReadBuffer& buffer) : INHERITED(buffer) { - fShaderA = buffer.readShader(); - if (NULL == fShaderA) { - fShaderA = SkNEW_ARGS(SkColorShader, ((SkColor)0)); - } - fShaderB = buffer.readShader(); - if (NULL == fShaderB) { - fShaderB = SkNEW_ARGS(SkColorShader, ((SkColor)0)); - } - fMode = buffer.readXfermode(); -} -#endif - SkComposeShader::~SkComposeShader() { SkSafeUnref(fMode); fShaderB->unref(); diff --git a/src/core/SkEmptyShader.h b/src/core/SkEmptyShader.h index 250e37ab66..b7fefbe109 100644 --- a/src/core/SkEmptyShader.h +++ b/src/core/SkEmptyShader.h @@ -30,10 +30,6 @@ public: SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkEmptyShader) protected: -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING - SkEmptyShader(SkReadBuffer& buffer) : INHERITED(buffer) {} -#endif - virtual SkShader::Context* onCreateContext(const ContextRec&, void*) const SK_OVERRIDE { return NULL; } diff --git a/src/core/SkFilterShader.cpp b/src/core/SkFilterShader.cpp index cb042e604c..48c4b8b477 100644 --- a/src/core/SkFilterShader.cpp +++ b/src/core/SkFilterShader.cpp @@ -21,13 +21,6 @@ SkFilterShader::SkFilterShader(SkShader* shader, SkColorFilter* filter) { filter->ref(); } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkFilterShader::SkFilterShader(SkReadBuffer& buffer) : INHERITED(buffer) { - fShader = buffer.readShader(); - fFilter = buffer.readColorFilter(); -} -#endif - SkFilterShader::~SkFilterShader() { fFilter->unref(); fShader->unref(); diff --git a/src/core/SkFilterShader.h b/src/core/SkFilterShader.h index b98fc839a6..44c2632711 100644 --- a/src/core/SkFilterShader.h +++ b/src/core/SkFilterShader.h @@ -45,9 +45,6 @@ public: SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkFilterShader) protected: -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING - SkFilterShader(SkReadBuffer&); -#endif virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; virtual Context* onCreateContext(const ContextRec&, void* storage) const SK_OVERRIDE; diff --git a/src/core/SkFlattenable.cpp b/src/core/SkFlattenable.cpp index f8fdd4f00e..27efe7ece3 100644 --- a/src/core/SkFlattenable.cpp +++ b/src/core/SkFlattenable.cpp @@ -9,16 +9,6 @@ #include "SkPtrRecorder.h" #include "SkReadBuffer.h" -/////////////////////////////////////////////////////////////////////////////// - -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -bool SkFlattenable::NeedsDeepUnflatten(const SkReadBuffer& buffer) { - return false; // TODO: looks like all this can go away too now? -} -#endif - -/////////////////////////////////////////////////////////////////////////////// - SkNamedFactorySet::SkNamedFactorySet() : fNextAddedFactory(0) {} uint32_t SkNamedFactorySet::find(SkFlattenable::Factory factory) { @@ -57,8 +47,6 @@ void SkRefCntSet::decPtr(void* ptr) { } /////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// #define MAX_ENTRY_COUNT 1024 diff --git a/src/core/SkLocalMatrixShader.cpp b/src/core/SkLocalMatrixShader.cpp index 62d5e36d89..544ad2fe4c 100644 --- a/src/core/SkLocalMatrixShader.cpp +++ b/src/core/SkLocalMatrixShader.cpp @@ -7,15 +7,6 @@ #include "SkLocalMatrixShader.h" -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkLocalMatrixShader::SkLocalMatrixShader(SkReadBuffer& buffer) : INHERITED(buffer) { - fProxyShader.reset(buffer.readShader()); - if (NULL == fProxyShader.get()) { - sk_throw(); - } -} -#endif - SkFlattenable* SkLocalMatrixShader::CreateProc(SkReadBuffer& buffer) { SkMatrix lm; buffer.readMatrix(&lm); diff --git a/src/core/SkLocalMatrixShader.h b/src/core/SkLocalMatrixShader.h index b8e4714615..aad5668033 100644 --- a/src/core/SkLocalMatrixShader.h +++ b/src/core/SkLocalMatrixShader.h @@ -33,7 +33,7 @@ public: } #if SK_SUPPORT_GPU - + virtual bool asFragmentProcessor(GrContext* context, const SkPaint& paint, const SkMatrix* localMatrix, GrColor* grColor, GrFragmentProcessor** fp) const SK_OVERRIDE { @@ -43,17 +43,17 @@ public: } return fProxyShader->asFragmentProcessor(context, paint, &tmp, grColor, fp); } - -#else - + +#else + virtual bool asFragmentProcessor(GrContext*, const SkPaint&, const SkMatrix*, GrColor*, GrFragmentProcessor**) const SK_OVERRIDE { SkDEBUGFAIL("Should not call in GPU-less build"); return false; } - + #endif - + virtual SkShader* refAsALocalMatrixShader(SkMatrix* localMatrix) const SK_OVERRIDE { if (localMatrix) { *localMatrix = this->getLocalMatrix(); @@ -65,9 +65,6 @@ public: SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLocalMatrixShader) protected: -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING - SkLocalMatrixShader(SkReadBuffer&); -#endif virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; virtual Context* onCreateContext(const ContextRec&, void*) const SK_OVERRIDE; diff --git a/src/core/SkPathEffect.cpp b/src/core/SkPathEffect.cpp index d0748670e3..7338789de2 100644 --- a/src/core/SkPathEffect.cpp +++ b/src/core/SkPathEffect.cpp @@ -49,14 +49,6 @@ void SkPairPathEffect::flatten(SkWriteBuffer& buffer) const { buffer.writeFlattenable(fPE1); } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkPairPathEffect::SkPairPathEffect(SkReadBuffer& buffer) { - fPE0 = buffer.readPathEffect(); - fPE1 = buffer.readPathEffect(); - // either of these may fail, so we have to check for nulls later on -} -#endif - /////////////////////////////////////////////////////////////////////////////// SkFlattenable* SkComposePathEffect::CreateProc(SkReadBuffer& buffer) { diff --git a/src/core/SkPictureShader.cpp b/src/core/SkPictureShader.cpp index 1f32a7ecdf..5fded935cc 100644 --- a/src/core/SkPictureShader.cpp +++ b/src/core/SkPictureShader.cpp @@ -100,15 +100,6 @@ SkPictureShader::SkPictureShader(const SkPicture* picture, TileMode tmx, TileMod , fTmy(tmy) { } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkPictureShader::SkPictureShader(SkReadBuffer& buffer) : INHERITED(buffer) { - fTmx = static_cast<SkShader::TileMode>(buffer.read32()); - fTmy = static_cast<SkShader::TileMode>(buffer.read32()); - buffer.readRect(&fTile); - fPicture = SkPicture::CreateFromBuffer(buffer); -} -#endif - SkPictureShader::~SkPictureShader() { fPicture->unref(); } diff --git a/src/core/SkShader.cpp b/src/core/SkShader.cpp index 39e8ed35f5..816d6fd329 100644 --- a/src/core/SkShader.cpp +++ b/src/core/SkShader.cpp @@ -46,17 +46,6 @@ SkShader::SkShader(const SkMatrix* localMatrix) { } } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkShader::SkShader(SkReadBuffer& buffer) : INHERITED(buffer) { - inc_shader_counter(); - if (buffer.readBool()) { - buffer.readMatrix(&fLocalMatrix); - } else { - fLocalMatrix.reset(); - } -} -#endif - SkShader::~SkShader() { dec_shader_counter(); } @@ -271,12 +260,6 @@ bool SkColorShader::isOpaque() const { return SkColorGetA(fColor) == 255; } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkColorShader::SkColorShader(SkReadBuffer& b) : INHERITED(b) { - fColor = b.readColor(); -} -#endif - SkFlattenable* SkColorShader::CreateProc(SkReadBuffer& buffer) { return SkNEW_ARGS(SkColorShader, (buffer.readColor())); } diff --git a/src/core/SkXfermode.cpp b/src/core/SkXfermode.cpp index 4a3ec39702..e0abb4ebdd 100644 --- a/src/core/SkXfermode.cpp +++ b/src/core/SkXfermode.cpp @@ -1237,23 +1237,6 @@ GrFragmentProcessor* XferEffect::TestCreate(SkRandom* rand, /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkProcCoeffXfermode::SkProcCoeffXfermode(SkReadBuffer& buffer) : INHERITED(buffer) { - uint32_t mode32 = buffer.read32() % SK_ARRAY_COUNT(gProcCoeffs); - if (mode32 >= SK_ARRAY_COUNT(gProcCoeffs)) { - // out of range, just set to something harmless - mode32 = SkXfermode::kSrcOut_Mode; - } - fMode = (SkXfermode::Mode)mode32; - - const ProcCoeff& rec = gProcCoeffs[fMode]; - fProc = rec.fProc; - // these may be valid, or may be CANNOT_USE_COEFF - fSrcCoeff = rec.fSC; - fDstCoeff = rec.fDC; -} -#endif - SkFlattenable* SkProcCoeffXfermode::CreateProc(SkReadBuffer& buffer) { uint32_t mode32 = buffer.read32(); if (!buffer.validate(mode32 < SK_ARRAY_COUNT(gProcCoeffs))) { @@ -1443,9 +1426,6 @@ public: private: SkClearXfermode(const ProcCoeff& rec) : SkProcCoeffXfermode(rec, kClear_Mode) {} -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING - SkClearXfermode(SkReadBuffer& buffer) : SkProcCoeffXfermode(buffer) {} -#endif typedef SkProcCoeffXfermode INHERITED; }; @@ -1508,9 +1488,6 @@ public: private: SkSrcXfermode(const ProcCoeff& rec) : SkProcCoeffXfermode(rec, kSrc_Mode) {} -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING - SkSrcXfermode(SkReadBuffer& buffer) : SkProcCoeffXfermode(buffer) {} -#endif typedef SkProcCoeffXfermode INHERITED; }; @@ -1576,9 +1553,6 @@ public: private: SkDstInXfermode(const ProcCoeff& rec) : SkProcCoeffXfermode(rec, kDstIn_Mode) {} -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING - SkDstInXfermode(SkReadBuffer& buffer) : INHERITED(buffer) {} -#endif typedef SkProcCoeffXfermode INHERITED; }; @@ -1623,9 +1597,6 @@ public: private: SkDstOutXfermode(const ProcCoeff& rec) : SkProcCoeffXfermode(rec, kDstOut_Mode) {} -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING - SkDstOutXfermode(SkReadBuffer& buffer) : INHERITED(buffer) {} -#endif typedef SkProcCoeffXfermode INHERITED; }; diff --git a/src/core/SkXfermode_proccoeff.h b/src/core/SkXfermode_proccoeff.h index f3b9b2491a..d7b47046d1 100644 --- a/src/core/SkXfermode_proccoeff.h +++ b/src/core/SkXfermode_proccoeff.h @@ -22,7 +22,7 @@ public: fSrcCoeff = rec.fSC; fDstCoeff = rec.fDC; } - + 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, @@ -43,10 +43,6 @@ public: SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkProcCoeffXfermode) protected: -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING - SkProcCoeffXfermode(SkReadBuffer& buffer); -#endif - virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE; Mode getMode() const { return fMode; } |