diff options
Diffstat (limited to 'src')
65 files changed, 23 insertions, 785 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; } diff --git a/src/effects/Sk1DPathEffect.cpp b/src/effects/Sk1DPathEffect.cpp index 47824fd0f2..83f684e2ca 100644 --- a/src/effects/Sk1DPathEffect.cpp +++ b/src/effects/Sk1DPathEffect.cpp @@ -147,22 +147,6 @@ static void morphpath(SkPath* dst, const SkPath& src, SkPathMeasure& meas, } } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkPath1DPathEffect::SkPath1DPathEffect(SkReadBuffer& buffer) { - fAdvance = buffer.readScalar(); - if (fAdvance > 0) { - buffer.readPath(&fPath); - fInitialOffset = buffer.readScalar(); - fStyle = (Style) buffer.readUInt(); - } else { - SkDEBUGF(("SkPath1DPathEffect can't use advance <= 0\n")); - // Make Coverity happy. - fInitialOffset = 0; - fStyle = kStyleCount; - } -} -#endif - SkScalar SkPath1DPathEffect::begin(SkScalar contourLength) const { return fInitialOffset; } diff --git a/src/effects/Sk2DPathEffect.cpp b/src/effects/Sk2DPathEffect.cpp index cef2266d50..2ad202ae85 100644 --- a/src/effects/Sk2DPathEffect.cpp +++ b/src/effects/Sk2DPathEffect.cpp @@ -73,13 +73,6 @@ void Sk2DPathEffect::flatten(SkWriteBuffer& buffer) const { buffer.writeMatrix(fMatrix); } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -Sk2DPathEffect::Sk2DPathEffect(SkReadBuffer& buffer) { - buffer.readMatrix(&fMatrix); - fMatrixIsInvertible = fMatrix.invert(&fInverse); -} -#endif - /////////////////////////////////////////////////////////////////////////////// bool SkLine2DPathEffect::filterPath(SkPath* dst, const SkPath& src, @@ -104,12 +97,6 @@ void SkLine2DPathEffect::nextSpan(int u, int v, int ucount, SkPath* dst) const { } } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkLine2DPathEffect::SkLine2DPathEffect(SkReadBuffer& buffer) : INHERITED(buffer) { - fWidth = buffer.readScalar(); -} -#endif - SkFlattenable* SkLine2DPathEffect::CreateProc(SkReadBuffer& buffer) { SkMatrix matrix; buffer.readMatrix(&matrix); @@ -128,12 +115,6 @@ SkPath2DPathEffect::SkPath2DPathEffect(const SkMatrix& m, const SkPath& p) : INHERITED(m), fPath(p) { } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkPath2DPathEffect::SkPath2DPathEffect(SkReadBuffer& buffer) : INHERITED(buffer) { - buffer.readPath(&fPath); -} -#endif - SkFlattenable* SkPath2DPathEffect::CreateProc(SkReadBuffer& buffer) { SkMatrix matrix; buffer.readMatrix(&matrix); diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp index e181675409..ffdba32264 100644 --- a/src/effects/SkAlphaThresholdFilter.cpp +++ b/src/effects/SkAlphaThresholdFilter.cpp @@ -19,9 +19,6 @@ public: SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkAlphaThresholdFilterImpl) protected: -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING - explicit SkAlphaThresholdFilterImpl(SkReadBuffer& buffer); -#endif virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, @@ -238,15 +235,6 @@ void AlphaThresholdEffect::onComputeInvariantOutput(GrInvariantOutput* inout) co #endif -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkAlphaThresholdFilterImpl::SkAlphaThresholdFilterImpl(SkReadBuffer& buffer) - : INHERITED(1, buffer) { - fInnerThreshold = buffer.readScalar(); - fOuterThreshold = buffer.readScalar(); - buffer.readRegion(&fRegion); -} -#endif - SkFlattenable* SkAlphaThresholdFilterImpl::CreateProc(SkReadBuffer& buffer) { SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); SkScalar inner = buffer.readScalar(); diff --git a/src/effects/SkArithmeticMode.cpp b/src/effects/SkArithmeticMode.cpp index 6fb5241c82..d1e7472f06 100644 --- a/src/effects/SkArithmeticMode.cpp +++ b/src/effects/SkArithmeticMode.cpp @@ -49,16 +49,6 @@ private: fEnforcePMColor = enforcePMColor; } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING - SkArithmeticMode_scalar(SkReadBuffer& buffer) : INHERITED(buffer) { - fK[0] = buffer.readScalar(); - fK[1] = buffer.readScalar(); - fK[2] = buffer.readScalar(); - fK[3] = buffer.readScalar(); - fEnforcePMColor = buffer.readBool(); - } -#endif - virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE { buffer.writeScalar(fK[0]); buffer.writeScalar(fK[1]); diff --git a/src/effects/SkAvoidXfermode.cpp b/src/effects/SkAvoidXfermode.cpp index b596bfdb73..41c4e9646d 100644 --- a/src/effects/SkAvoidXfermode.cpp +++ b/src/effects/SkAvoidXfermode.cpp @@ -21,14 +21,6 @@ SkAvoidXfermode::SkAvoidXfermode(SkColor opColor, U8CPU tolerance, Mode mode) { fMode = mode; } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkAvoidXfermode::SkAvoidXfermode(SkReadBuffer& buffer) : INHERITED(buffer) { - fOpColor = buffer.readColor(); - fDistMul = buffer.readUInt(); - fMode = (Mode)buffer.readUInt(); -} -#endif - SkFlattenable* SkAvoidXfermode::CreateProc(SkReadBuffer& buffer) { const SkColor color = buffer.readColor(); const unsigned tolerance = buffer.readUInt(); diff --git a/src/effects/SkBitmapSource.cpp b/src/effects/SkBitmapSource.cpp index 4da77a9e02..ff76ab4bba 100644 --- a/src/effects/SkBitmapSource.cpp +++ b/src/effects/SkBitmapSource.cpp @@ -26,15 +26,6 @@ SkBitmapSource::SkBitmapSource(const SkBitmap& bitmap, const SkRect& srcRect, co , fSrcRect(srcRect) , fDstRect(dstRect) {} -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkBitmapSource::SkBitmapSource(SkReadBuffer& buffer) : INHERITED(0, buffer) { - buffer.readBitmap(&fBitmap); - buffer.readRect(&fSrcRect); - buffer.readRect(&fDstRect); - buffer.validate(buffer.isValid() && SkIsValidRect(fSrcRect) && SkIsValidRect(fDstRect)); -} -#endif - SkFlattenable* SkBitmapSource::CreateProc(SkReadBuffer& buffer) { SkRect src, dst; buffer.readRect(&src); diff --git a/src/effects/SkBlurDrawLooper.cpp b/src/effects/SkBlurDrawLooper.cpp index fc9e47b0b4..b3094d6c45 100644 --- a/src/effects/SkBlurDrawLooper.cpp +++ b/src/effects/SkBlurDrawLooper.cpp @@ -62,19 +62,6 @@ void SkBlurDrawLooper::init(SkScalar sigma, SkScalar dx, SkScalar dy, this->initEffects(); } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkBlurDrawLooper::SkBlurDrawLooper(SkReadBuffer& buffer) : INHERITED(buffer) { - - fSigma = buffer.readScalar(); - fDx = buffer.readScalar(); - fDy = buffer.readScalar(); - fBlurColor = buffer.readColor(); - fBlurFlags = buffer.readUInt() & kAll_BlurFlag; - - this->initEffects(); -} -#endif - SkFlattenable* SkBlurDrawLooper::CreateProc(SkReadBuffer& buffer) { const SkColor color = buffer.readColor(); const SkScalar sigma = buffer.readScalar(); diff --git a/src/effects/SkBlurImageFilter.cpp b/src/effects/SkBlurImageFilter.cpp index 4166d20035..e5bb8c1e74 100644 --- a/src/effects/SkBlurImageFilter.cpp +++ b/src/effects/SkBlurImageFilter.cpp @@ -31,18 +31,6 @@ static SkVector mapSigma(const SkSize& localSigma, const SkMatrix& ctm) { return sigma; } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkBlurImageFilter::SkBlurImageFilter(SkReadBuffer& buffer) - : INHERITED(1, buffer) { - fSigma.fWidth = buffer.readScalar(); - fSigma.fHeight = buffer.readScalar(); - buffer.validate(SkScalarIsFinite(fSigma.fWidth) && - SkScalarIsFinite(fSigma.fHeight) && - (fSigma.fWidth >= 0) && - (fSigma.fHeight >= 0)); -} -#endif - SkBlurImageFilter::SkBlurImageFilter(SkScalar sigmaX, SkScalar sigmaY, SkImageFilter* input, diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp index 5b0e60adde..b5bcc3c5de 100644 --- a/src/effects/SkBlurMaskFilter.cpp +++ b/src/effects/SkBlurMaskFilter.cpp @@ -585,16 +585,6 @@ void SkBlurMaskFilterImpl::computeFastBounds(const SkRect& src, src.fRight + pad, src.fBottom + pad); } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkBlurMaskFilterImpl::SkBlurMaskFilterImpl(SkReadBuffer& buffer) : SkMaskFilter(buffer) { - fSigma = buffer.readScalar(); - fBlurStyle = (SkBlurStyle)buffer.readInt(); - fBlurFlags = buffer.readUInt() & SkBlurMaskFilter::kAll_BlurFlag; - SkASSERT(fSigma > 0); - SkASSERT((unsigned)fBlurStyle <= kLastEnum_SkBlurStyle); -} -#endif - SkFlattenable* SkBlurMaskFilterImpl::CreateProc(SkReadBuffer& buffer) { const SkScalar sigma = buffer.readScalar(); const unsigned style = buffer.readUInt(); diff --git a/src/effects/SkColorCubeFilter.cpp b/src/effects/SkColorCubeFilter.cpp index 18c5b5603f..30641c3c30 100644 --- a/src/effects/SkColorCubeFilter.cpp +++ b/src/effects/SkColorCubeFilter.cpp @@ -161,15 +161,6 @@ void SkColorCubeFilter::filterSpan(const SkPMColor src[], int count, SkPMColor d } } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkColorCubeFilter::SkColorCubeFilter(SkReadBuffer& buffer) - : fCache(buffer.readInt()) { - fCubeData.reset(buffer.readByteArrayAsData()); - buffer.validate(is_valid_3D_lut(fCubeData, fCache.cubeDimension())); - fUniqueID = SkNextColorCubeUniqueID(); -} -#endif - SkFlattenable* SkColorCubeFilter::CreateProc(SkReadBuffer& buffer) { int cubeDimension = buffer.readInt(); SkAutoDataUnref cubeData(buffer.readByteArrayAsData()); diff --git a/src/effects/SkColorFilterImageFilter.cpp b/src/effects/SkColorFilterImageFilter.cpp index 012f1329a4..10976d77f0 100755 --- a/src/effects/SkColorFilterImageFilter.cpp +++ b/src/effects/SkColorFilterImageFilter.cpp @@ -84,21 +84,6 @@ SkColorFilterImageFilter::SkColorFilterImageFilter(SkColorFilter* cf, : INHERITED(1, &input, cropRect, uniqueID), fColorFilter(SkRef(cf)) { } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkColorFilterImageFilter::SkColorFilterImageFilter(SkReadBuffer& buffer) : INHERITED(1, buffer) { - fColorFilter = buffer.readColorFilter(); - // we aren't prepared for this to be NULL, and it can't ever be when we're NOT supporting - // SK_SUPPORT_LEGACY_DEEPFLATTENING, as we always go through a factory which can detect - // NULL. However, since here we're in the legacy code, we assign a dummy filter so we - // don't crash with a null-ptr. - if (NULL == fColorFilter) { - // colormatrix identity is effectively a no-op - fColorFilter = SkColorMatrixFilter::Create(SkColorMatrix()); - SkASSERT(fColorFilter); - } -} -#endif - SkFlattenable* SkColorFilterImageFilter::CreateProc(SkReadBuffer& buffer) { SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); SkAutoTUnref<SkColorFilter> cf(buffer.readColorFilter()); diff --git a/src/effects/SkColorFilters.cpp b/src/effects/SkColorFilters.cpp index e085281aa5..92e6f432f1 100644 --- a/src/effects/SkColorFilters.cpp +++ b/src/effects/SkColorFilters.cpp @@ -84,17 +84,6 @@ protected: buffer.writeUInt(fMode); } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING - SkModeColorFilter(SkReadBuffer& buffer) { - fColor = buffer.readColor(); - fMode = (SkXfermode::Mode)buffer.readUInt(); - if (buffer.isValid()) { - this->updateCache(); - buffer.validate(SkIsValidMode(fMode)); - } - } -#endif - private: SkColor fColor; SkXfermode::Mode fMode; diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp index 20702920de..27231b1466 100644 --- a/src/effects/SkColorMatrixFilter.cpp +++ b/src/effects/SkColorMatrixFilter.cpp @@ -307,15 +307,6 @@ void SkColorMatrixFilter::flatten(SkWriteBuffer& buffer) const { buffer.writeScalarArray(fMatrix.fMat, 20); } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkColorMatrixFilter::SkColorMatrixFilter(SkReadBuffer& buffer) : INHERITED(buffer) { - SkASSERT(buffer.getArrayCount() == 20); - if (buffer.readScalarArray(fMatrix.fMat, 20)) { - this->initState(fMatrix.fMat); - } -} -#endif - SkFlattenable* SkColorMatrixFilter::CreateProc(SkReadBuffer& buffer) { SkColorMatrix matrix; if (buffer.readScalarArray(matrix.fMat, 20)) { diff --git a/src/effects/SkComposeImageFilter.cpp b/src/effects/SkComposeImageFilter.cpp index c0556749ac..9bec500976 100644 --- a/src/effects/SkComposeImageFilter.cpp +++ b/src/effects/SkComposeImageFilter.cpp @@ -40,9 +40,3 @@ SkFlattenable* SkComposeImageFilter::CreateProc(SkReadBuffer& buffer) { SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 2); return SkComposeImageFilter::Create(common.getInput(0), common.getInput(1)); } - -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkComposeImageFilter::SkComposeImageFilter(SkReadBuffer& buffer) - : INHERITED(2, buffer) { -} -#endif diff --git a/src/effects/SkCornerPathEffect.cpp b/src/effects/SkCornerPathEffect.cpp index 06558826bf..8dc506ace4 100644 --- a/src/effects/SkCornerPathEffect.cpp +++ b/src/effects/SkCornerPathEffect.cpp @@ -135,9 +135,3 @@ SkFlattenable* SkCornerPathEffect::CreateProc(SkReadBuffer& buffer) { void SkCornerPathEffect::flatten(SkWriteBuffer& buffer) const { buffer.writeScalar(fRadius); } - -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkCornerPathEffect::SkCornerPathEffect(SkReadBuffer& buffer) { - fRadius = buffer.readScalar(); -} -#endif diff --git a/src/effects/SkDashPathEffect.cpp b/src/effects/SkDashPathEffect.cpp index f31d883c8e..f866ea074e 100644 --- a/src/effects/SkDashPathEffect.cpp +++ b/src/effects/SkDashPathEffect.cpp @@ -369,28 +369,3 @@ SkFlattenable* SkDashPathEffect::CreateProc(SkReadBuffer& buffer) { } return NULL; } - -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkDashPathEffect::SkDashPathEffect(SkReadBuffer& buffer) - : INHERITED(buffer) - , fPhase(0) - , fInitialDashLength(0) - , fInitialDashIndex(0) - , fIntervalLength(0) { - fPhase = buffer.readScalar(); - fCount = buffer.getArrayCount(); - size_t allocSize = sizeof(SkScalar) * fCount; - if (buffer.validateAvailable(allocSize)) { - fIntervals = (SkScalar*)sk_malloc_throw(allocSize); - buffer.readScalarArray(fIntervals, fCount); - } else { - fIntervals = NULL; - } - - // set the internal data members, fPhase should have been between 0 and intervalLength - // when written to buffer so no need to adjust it - SkDashPath::CalcDashParameters(fPhase, fIntervals, fCount, - &fInitialDashLength, &fInitialDashIndex, &fIntervalLength); -} -#endif - diff --git a/src/effects/SkDiscretePathEffect.cpp b/src/effects/SkDiscretePathEffect.cpp index e8cc6a2f70..8aa0e22356 100644 --- a/src/effects/SkDiscretePathEffect.cpp +++ b/src/effects/SkDiscretePathEffect.cpp @@ -87,12 +87,3 @@ void SkDiscretePathEffect::flatten(SkWriteBuffer& buffer) const { buffer.writeScalar(fPerterb); buffer.writeUInt(fSeedAssist); } - -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkDiscretePathEffect::SkDiscretePathEffect(SkReadBuffer& buffer) { - fSegLength = buffer.readScalar(); - fPerterb = buffer.readScalar(); - fSeedAssist = buffer.readUInt(); -} -#endif - diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp index edae0441f4..d39240e012 100644 --- a/src/effects/SkDisplacementMapEffect.cpp +++ b/src/effects/SkDisplacementMapEffect.cpp @@ -192,19 +192,6 @@ SkDisplacementMapEffect::SkDisplacementMapEffect(ChannelSelectorType xChannelSel SkDisplacementMapEffect::~SkDisplacementMapEffect() { } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkDisplacementMapEffect::SkDisplacementMapEffect(SkReadBuffer& buffer) - : INHERITED(2, buffer) -{ - fXChannelSelector = (SkDisplacementMapEffect::ChannelSelectorType) buffer.readInt(); - fYChannelSelector = (SkDisplacementMapEffect::ChannelSelectorType) buffer.readInt(); - fScale = buffer.readScalar(); - buffer.validate(channel_selector_type_is_valid(fXChannelSelector) && - channel_selector_type_is_valid(fYChannelSelector) && - SkScalarIsFinite(fScale)); -} -#endif - SkFlattenable* SkDisplacementMapEffect::CreateProc(SkReadBuffer& buffer) { SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 2); ChannelSelectorType xsel = (ChannelSelectorType)buffer.readInt(); diff --git a/src/effects/SkDropShadowImageFilter.cpp b/src/effects/SkDropShadowImageFilter.cpp index 0ba8b234b7..5bbb958e9c 100644 --- a/src/effects/SkDropShadowImageFilter.cpp +++ b/src/effects/SkDropShadowImageFilter.cpp @@ -29,24 +29,6 @@ SkDropShadowImageFilter::SkDropShadowImageFilter(SkScalar dx, SkScalar dy, { } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkDropShadowImageFilter::SkDropShadowImageFilter(SkReadBuffer& buffer) - : INHERITED(1, buffer) { - fDx = buffer.readScalar(); - fDy = buffer.readScalar(); - fSigmaX = buffer.readScalar(); - fSigmaY = buffer.readScalar(); - fColor = buffer.readColor(); - fShadowMode = buffer.isVersionLT(SkReadBuffer::kDropShadowMode_Version) ? - kDrawShadowAndForeground_ShadowMode : - static_cast<ShadowMode>(buffer.readInt()); - buffer.validate(SkScalarIsFinite(fDx) && - SkScalarIsFinite(fDy) && - SkScalarIsFinite(fSigmaX) && - SkScalarIsFinite(fSigmaY)); -} -#endif - SkFlattenable* SkDropShadowImageFilter::CreateProc(SkReadBuffer& buffer) { SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); SkScalar dx = buffer.readScalar(); diff --git a/src/effects/SkEmbossMaskFilter.cpp b/src/effects/SkEmbossMaskFilter.cpp index 4841b92816..8fcd272646 100644 --- a/src/effects/SkEmbossMaskFilter.cpp +++ b/src/effects/SkEmbossMaskFilter.cpp @@ -124,15 +124,6 @@ bool SkEmbossMaskFilter::filterMask(SkMask* dst, const SkMask& src, return true; } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkEmbossMaskFilter::SkEmbossMaskFilter(SkReadBuffer& buffer) : SkMaskFilter(buffer) { - SkASSERT(buffer.getArrayCount() == sizeof(Light)); - buffer.readByteArray(&fLight, sizeof(Light)); - SkASSERT(fLight.fPad == 0); // for the font-cache lookup to be clean - fBlurSigma = buffer.readScalar(); -} -#endif - SkFlattenable* SkEmbossMaskFilter::CreateProc(SkReadBuffer& buffer) { Light light; if (buffer.readByteArray(&light, sizeof(Light))) { diff --git a/src/effects/SkLayerRasterizer.cpp b/src/effects/SkLayerRasterizer.cpp index b331a0363d..d3e112c3a4 100644 --- a/src/effects/SkLayerRasterizer.cpp +++ b/src/effects/SkLayerRasterizer.cpp @@ -148,18 +148,13 @@ bool SkLayerRasterizer::onRasterize(const SkPath& path, const SkMatrix& matrix, return true; } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkLayerRasterizer::SkLayerRasterizer(SkReadBuffer& buffer) - : SkRasterizer(buffer), fLayers(ReadLayers(buffer)) {} -#endif - SkFlattenable* SkLayerRasterizer::CreateProc(SkReadBuffer& buffer) { return SkNEW_ARGS(SkLayerRasterizer, (ReadLayers(buffer))); } SkDeque* SkLayerRasterizer::ReadLayers(SkReadBuffer& buffer) { int count = buffer.readInt(); - + SkDeque* layers = SkNEW_ARGS(SkDeque, (sizeof(SkLayerRasterizer_Rec))); for (int i = 0; i < count; i++) { SkLayerRasterizer_Rec* rec = (SkLayerRasterizer_Rec*)layers->push_back(); diff --git a/src/effects/SkLerpXfermode.cpp b/src/effects/SkLerpXfermode.cpp index 0376a57b64..76c97ef9ac 100644 --- a/src/effects/SkLerpXfermode.cpp +++ b/src/effects/SkLerpXfermode.cpp @@ -23,12 +23,6 @@ SkXfermode* SkLerpXfermode::Create(SkScalar scale) { SkLerpXfermode::SkLerpXfermode(unsigned scale256) : fScale256(scale256) {} -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkLerpXfermode::SkLerpXfermode(SkReadBuffer& buffer) : INHERITED(buffer) { - fScale256 = buffer.readUInt(); -} -#endif - void SkLerpXfermode::flatten(SkWriteBuffer& buffer) const { buffer.writeUInt(fScale256); } diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp index bf9877e044..740ad02969 100644 --- a/src/effects/SkLightingImageFilter.cpp +++ b/src/effects/SkLightingImageFilter.cpp @@ -290,9 +290,6 @@ protected: SkDiffuseLightingImageFilter(SkLight* light, SkScalar surfaceScale, SkScalar kd, SkImageFilter* input, const CropRect* cropRect, uint32_t uniqueID); -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING - explicit SkDiffuseLightingImageFilter(SkReadBuffer& buffer); -#endif virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE; virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE; @@ -322,9 +319,6 @@ protected: SkSpecularLightingImageFilter(SkLight* light, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, SkImageFilter* input, const CropRect*, uint32_t uniqueID); -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING - explicit SkSpecularLightingImageFilter(SkReadBuffer& buffer); -#endif virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE; virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&, SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE; @@ -942,15 +936,6 @@ SkImageFilter* SkLightingImageFilter::CreateSpotLitSpecular(const SkPoint3& loca SkLightingImageFilter::~SkLightingImageFilter() {} -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkLightingImageFilter::SkLightingImageFilter(SkReadBuffer& buffer) - : INHERITED(1, buffer) { - fLight.reset(SkLight::UnflattenLight(buffer)); - fSurfaceScale = buffer.readScalar(); - buffer.validate(SkScalarIsFinite(fSurfaceScale)); -} -#endif - void SkLightingImageFilter::flatten(SkWriteBuffer& buffer) const { this->INHERITED::flatten(buffer); fLight->flattenLight(buffer); @@ -981,15 +966,6 @@ SkDiffuseLightingImageFilter::SkDiffuseLightingImageFilter(SkLight* light, SkSca { } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkDiffuseLightingImageFilter::SkDiffuseLightingImageFilter(SkReadBuffer& buffer) - : INHERITED(buffer) -{ - fKD = buffer.readScalar(); - buffer.validate(SkScalarIsFinite(fKD) && (fKD >= 0)); -} -#endif - SkFlattenable* SkDiffuseLightingImageFilter::CreateProc(SkReadBuffer& buffer) { SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); SkAutoTUnref<SkLight> light(SkLight::UnflattenLight(buffer)); @@ -1096,17 +1072,6 @@ SkSpecularLightingImageFilter::SkSpecularLightingImageFilter(SkLight* light, SkS { } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkSpecularLightingImageFilter::SkSpecularLightingImageFilter(SkReadBuffer& buffer) - : INHERITED(buffer) -{ - fKS = buffer.readScalar(); - fShininess = buffer.readScalar(); - buffer.validate(SkScalarIsFinite(fKS) && (fKS >= 0) && - SkScalarIsFinite(fShininess)); -} -#endif - SkFlattenable* SkSpecularLightingImageFilter::CreateProc(SkReadBuffer& buffer) { SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); SkAutoTUnref<SkLight> light(SkLight::UnflattenLight(buffer)); diff --git a/src/effects/SkLumaColorFilter.cpp b/src/effects/SkLumaColorFilter.cpp index 2b57cb1cef..9ad5797f35 100644 --- a/src/effects/SkLumaColorFilter.cpp +++ b/src/effects/SkLumaColorFilter.cpp @@ -44,10 +44,6 @@ SkColorFilter* SkLumaColorFilter::Create() { SkLumaColorFilter::SkLumaColorFilter() : INHERITED() {} -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkLumaColorFilter::SkLumaColorFilter(SkReadBuffer& buffer) : INHERITED(buffer) {} -#endif - SkFlattenable* SkLumaColorFilter::CreateProc(SkReadBuffer&) { return SkNEW(SkLumaColorFilter); } diff --git a/src/effects/SkMagnifierImageFilter.cpp b/src/effects/SkMagnifierImageFilter.cpp index e0826efe0d..973ac66905 100644 --- a/src/effects/SkMagnifierImageFilter.cpp +++ b/src/effects/SkMagnifierImageFilter.cpp @@ -235,7 +235,7 @@ void GrMagnifierEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const SkImageFilter* SkMagnifierImageFilter::Create(const SkRect& srcRect, SkScalar inset, SkImageFilter* input) { - + if (!SkScalarIsFinite(inset) || !SkIsValidRect(srcRect)) { return NULL; } @@ -247,22 +247,6 @@ SkImageFilter* SkMagnifierImageFilter::Create(const SkRect& srcRect, SkScalar in } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkMagnifierImageFilter::SkMagnifierImageFilter(SkReadBuffer& buffer) - : INHERITED(1, buffer) { - float x = buffer.readScalar(); - float y = buffer.readScalar(); - float width = buffer.readScalar(); - float height = buffer.readScalar(); - fSrcRect = SkRect::MakeXYWH(x, y, width, height); - fInset = buffer.readScalar(); - - buffer.validate(SkScalarIsFinite(fInset) && SkIsValidRect(fSrcRect) && - // Negative numbers in src rect are not supported - (fSrcRect.fLeft >= 0) && (fSrcRect.fTop >= 0)); -} -#endif - SkMagnifierImageFilter::SkMagnifierImageFilter(const SkRect& srcRect, SkScalar inset, SkImageFilter* input) : INHERITED(1, &input), fSrcRect(srcRect), fInset(inset) { diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp index cdcf66f692..045f6a96d5 100644 --- a/src/effects/SkMatrixConvolutionImageFilter.cpp +++ b/src/effects/SkMatrixConvolutionImageFilter.cpp @@ -76,50 +76,6 @@ SkMatrixConvolutionImageFilter* SkMatrixConvolutionImageFilter::Create( input, cropRect, uniqueID)); } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -static bool tile_mode_is_valid(SkMatrixConvolutionImageFilter::TileMode tileMode) { - switch (tileMode) { - case SkMatrixConvolutionImageFilter::kClamp_TileMode: - case SkMatrixConvolutionImageFilter::kRepeat_TileMode: - case SkMatrixConvolutionImageFilter::kClampToBlack_TileMode: - return true; - default: - break; - } - return false; -} - -SkMatrixConvolutionImageFilter::SkMatrixConvolutionImageFilter(SkReadBuffer& buffer) - : INHERITED(1, buffer) { - fKernelSize.fWidth = buffer.readInt(); - fKernelSize.fHeight = buffer.readInt(); - if ((fKernelSize.fWidth >= 1) && (fKernelSize.fHeight >= 1) && - // Make sure size won't be larger than a signed int, - // which would still be extremely large for a kernel, - // but we don't impose a hard limit for kernel size - (gMaxKernelSize / fKernelSize.fWidth >= fKernelSize.fHeight)) { - size_t size = fKernelSize.fWidth * fKernelSize.fHeight; - fKernel = SkNEW_ARRAY(SkScalar, size); - SkDEBUGCODE(bool success =) buffer.readScalarArray(fKernel, size); - SkASSERT(success); - } else { - fKernel = 0; - } - fGain = buffer.readScalar(); - fBias = buffer.readScalar(); - fKernelOffset.fX = buffer.readInt(); - fKernelOffset.fY = buffer.readInt(); - fTileMode = (TileMode) buffer.readInt(); - fConvolveAlpha = buffer.readBool(); - buffer.validate((fKernel != 0) && - SkScalarIsFinite(fGain) && - SkScalarIsFinite(fBias) && - tile_mode_is_valid(fTileMode) && - (fKernelOffset.fX >= 0) && (fKernelOffset.fX < fKernelSize.fWidth) && - (fKernelOffset.fY >= 0) && (fKernelOffset.fY < fKernelSize.fHeight)); -} -#endif - SkFlattenable* SkMatrixConvolutionImageFilter::CreateProc(SkReadBuffer& buffer) { SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); SkISize kernelSize; diff --git a/src/effects/SkMatrixImageFilter.cpp b/src/effects/SkMatrixImageFilter.cpp index 8b07dd4a46..919dff3994 100644 --- a/src/effects/SkMatrixImageFilter.cpp +++ b/src/effects/SkMatrixImageFilter.cpp @@ -31,14 +31,6 @@ SkMatrixImageFilter* SkMatrixImageFilter::Create(const SkMatrix& transform, return SkNEW_ARGS(SkMatrixImageFilter, (transform, filterLevel, input, uniqueID)); } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkMatrixImageFilter::SkMatrixImageFilter(SkReadBuffer& buffer) - : INHERITED(1, buffer) { - buffer.readMatrix(&fTransform); - fFilterLevel = static_cast<SkPaint::FilterLevel>(buffer.readInt()); -} -#endif - SkFlattenable* SkMatrixImageFilter::CreateProc(SkReadBuffer& buffer) { SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); SkMatrix matrix; diff --git a/src/effects/SkMergeImageFilter.cpp b/src/effects/SkMergeImageFilter.cpp index 9e7f4e543c..d932d3ccce 100755 --- a/src/effects/SkMergeImageFilter.cpp +++ b/src/effects/SkMergeImageFilter.cpp @@ -140,24 +140,3 @@ void SkMergeImageFilter::flatten(SkWriteBuffer& buffer) const { buffer.writeByteArray(fModes, countInputs() * sizeof(fModes[0])); } } - -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkMergeImageFilter::SkMergeImageFilter(SkReadBuffer& buffer) - : INHERITED(-1, buffer) { - bool hasModes = buffer.readBool(); - if (hasModes) { - this->initAllocModes(); - int nbInputs = countInputs(); - size_t size = nbInputs * sizeof(fModes[0]); - SkASSERT(buffer.getArrayCount() == size); - if (buffer.validate(buffer.getArrayCount() == size) && - buffer.readByteArray(fModes, size)) { - for (int i = 0; i < nbInputs; ++i) { - buffer.validate(SkIsValidMode((SkXfermode::Mode)fModes[i])); - } - } - } else { - fModes = 0; - } -} -#endif diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp index 9c97c35bc2..3d27d10ee1 100644 --- a/src/effects/SkMorphologyImageFilter.cpp +++ b/src/effects/SkMorphologyImageFilter.cpp @@ -22,16 +22,6 @@ #include "effects/Gr1DKernelEffect.h" #endif -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkMorphologyImageFilter::SkMorphologyImageFilter(SkReadBuffer& buffer) - : INHERITED(1, buffer) { - fRadius.fWidth = buffer.readInt(); - fRadius.fHeight = buffer.readInt(); - buffer.validate((fRadius.fWidth >= 0) && - (fRadius.fHeight >= 0)); -} -#endif - SkMorphologyImageFilter::SkMorphologyImageFilter(int radiusX, int radiusY, SkImageFilter* input, diff --git a/src/effects/SkOffsetImageFilter.cpp b/src/effects/SkOffsetImageFilter.cpp index 90528c62d8..b7ded082d9 100644 --- a/src/effects/SkOffsetImageFilter.cpp +++ b/src/effects/SkOffsetImageFilter.cpp @@ -108,12 +108,3 @@ SkOffsetImageFilter::SkOffsetImageFilter(SkScalar dx, SkScalar dy, SkImageFilter : INHERITED(1, &input, cropRect, uniqueID) { fOffset.set(dx, dy); } - -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkOffsetImageFilter::SkOffsetImageFilter(SkReadBuffer& buffer) - : INHERITED(1, buffer) { - buffer.readPoint(&fOffset); - buffer.validate(SkScalarIsFinite(fOffset.fX) && - SkScalarIsFinite(fOffset.fY)); -} -#endif diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp index 019258972d..8c608fa036 100644 --- a/src/effects/SkPerlinNoiseShader.cpp +++ b/src/effects/SkPerlinNoiseShader.cpp @@ -51,11 +51,6 @@ inline SkScalar smoothCurve(SkScalar t) { return SkScalarMul(SkScalarSquare(t), SK_Scalar3 - 2 * t); } -bool perlin_noise_type_is_valid(SkPerlinNoiseShader::Type type) { - return (SkPerlinNoiseShader::kFractalNoise_Type == type) || - (SkPerlinNoiseShader::kTurbulence_Type == type); -} - } // end namespace struct SkPerlinNoiseShader::StitchData { @@ -288,22 +283,6 @@ SkPerlinNoiseShader::SkPerlinNoiseShader(SkPerlinNoiseShader::Type type, SkASSERT(numOctaves >= 0 && numOctaves < 256); } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkPerlinNoiseShader::SkPerlinNoiseShader(SkReadBuffer& buffer) : INHERITED(buffer) { - fType = (SkPerlinNoiseShader::Type) buffer.readInt(); - fBaseFrequencyX = buffer.readScalar(); - fBaseFrequencyY = buffer.readScalar(); - fNumOctaves = buffer.readInt(); - fSeed = buffer.readScalar(); - fStitchTiles = buffer.readBool(); - fTileSize.fWidth = buffer.readInt(); - fTileSize.fHeight = buffer.readInt(); - buffer.validate(perlin_noise_type_is_valid(fType) && - (fNumOctaves >= 0) && (fNumOctaves <= 255) && - (fStitchTiles != fTileSize.isEmpty())); -} -#endif - SkPerlinNoiseShader::~SkPerlinNoiseShader() { } @@ -964,7 +943,7 @@ bool SkPerlinNoiseShader::asFragmentProcessor(GrContext* context, const SkPaint& const SkMatrix* externalLocalMatrix, GrColor* paintColor, GrFragmentProcessor** fp) const { SkASSERT(context); - + *paintColor = SkColor2GrColorJustAlpha(paint.getColor()); SkMatrix localMatrix = this->getLocalMatrix(); diff --git a/src/effects/SkPictureImageFilter.cpp b/src/effects/SkPictureImageFilter.cpp index da5597d699..5399ea7476 100644 --- a/src/effects/SkPictureImageFilter.cpp +++ b/src/effects/SkPictureImageFilter.cpp @@ -30,21 +30,6 @@ SkPictureImageFilter::~SkPictureImageFilter() { SkSafeUnref(fPicture); } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkPictureImageFilter::SkPictureImageFilter(SkReadBuffer& buffer) - : INHERITED(0, buffer), - fPicture(NULL) { - if (!buffer.isCrossProcess()) { - if (buffer.readBool()) { - fPicture = SkPicture::CreateFromBuffer(buffer); - } - } else { - buffer.validate(!buffer.readBool()); - } - buffer.readRect(&fCropRect); -} -#endif - SkFlattenable* SkPictureImageFilter::CreateProc(SkReadBuffer& buffer) { SkAutoTUnref<SkPicture> picture; SkRect cropRect; diff --git a/src/effects/SkPixelXorXfermode.cpp b/src/effects/SkPixelXorXfermode.cpp index 68b5306a52..2a6ac47aac 100644 --- a/src/effects/SkPixelXorXfermode.cpp +++ b/src/effects/SkPixelXorXfermode.cpp @@ -25,12 +25,6 @@ void SkPixelXorXfermode::flatten(SkWriteBuffer& wb) const { wb.writeColor(fOpColor); } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkPixelXorXfermode::SkPixelXorXfermode(SkReadBuffer& rb) : INHERITED(rb) { - fOpColor = rb.readColor(); -} -#endif - SkFlattenable* SkPixelXorXfermode::CreateProc(SkReadBuffer& buffer) { return Create(buffer.readColor()); } diff --git a/src/effects/SkRectShaderImageFilter.cpp b/src/effects/SkRectShaderImageFilter.cpp index 09417c8840..91a127e0e3 100644 --- a/src/effects/SkRectShaderImageFilter.cpp +++ b/src/effects/SkRectShaderImageFilter.cpp @@ -34,13 +34,6 @@ SkRectShaderImageFilter::SkRectShaderImageFilter(SkShader* s, const CropRect* cr , fShader(SkRef(s)) { } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkRectShaderImageFilter::SkRectShaderImageFilter(SkReadBuffer& buffer) - : INHERITED(0, buffer) { - fShader = buffer.readShader(); -} -#endif - SkFlattenable* SkRectShaderImageFilter::CreateProc(SkReadBuffer& buffer) { SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 0); SkAutoTUnref<SkShader> shader(buffer.readShader()); diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp index c3c2ba067b..7cd628fd2d 100644 --- a/src/effects/SkTableColorFilter.cpp +++ b/src/effects/SkTableColorFilter.cpp @@ -61,9 +61,6 @@ public: }; protected: -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING - SkTable_ColorFilter(SkReadBuffer& buffer); -#endif virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; private: @@ -227,27 +224,6 @@ SkFlattenable* SkTable_ColorFilter::CreateProc(SkReadBuffer& buffer) { return SkTableColorFilter::CreateARGB(a, r, g, b); } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkTable_ColorFilter::SkTable_ColorFilter(SkReadBuffer& buffer) : INHERITED(buffer) { - fBitmap = NULL; - - uint8_t storage[5*256]; - - fFlags = buffer.readInt(); - - size_t size = buffer.getArrayCount(); - SkASSERT(size <= sizeof(storage)); - buffer.validate(size <= sizeof(storage)); - buffer.readByteArray(storage, size); - - SkDEBUGCODE(size_t raw = ) SkPackBits::Unpack8(storage, size, fStorage); - - SkASSERT(raw <= sizeof(fStorage)); - SkDEBUGCODE(size_t count = gCountNibBits[fFlags & 0xF]); - SkASSERT(raw == count * 256); -} -#endif - bool SkTable_ColorFilter::asComponentTable(SkBitmap* table) const { if (table) { if (NULL == fBitmap) { @@ -312,7 +288,7 @@ private: GrTextureAccess fTextureAccess; // currently not used in shader code, just to assist onComputeInvariantOutput(). - unsigned fFlags; + unsigned fFlags; GrTextureStripAtlas* fAtlas; int fRow; @@ -358,7 +334,7 @@ void GLColorTableEffect::setData(const GrGLProgramDataManager& pdm, const GrProc rgbaYValues[3] = 0.125; rgbaYValues[0] = 0.375; rgbaYValues[1] = 0.625; - rgbaYValues[2] = 0.875; + rgbaYValues[2] = 0.875; } pdm.set4fv(fRGBAYValuesUni, 1, rgbaYValues); } diff --git a/src/effects/SkTableMaskFilter.cpp b/src/effects/SkTableMaskFilter.cpp index 42b4ab6ff6..dc9b335fd4 100644 --- a/src/effects/SkTableMaskFilter.cpp +++ b/src/effects/SkTableMaskFilter.cpp @@ -82,13 +82,6 @@ SkFlattenable* SkTableMaskFilter::CreateProc(SkReadBuffer& buffer) { return Create(table); } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkTableMaskFilter::SkTableMaskFilter(SkReadBuffer& rb) : INHERITED(rb) { - SkASSERT(256 == rb.getArrayCount()); - rb.readByteArray(fTable, 256); -} -#endif - /////////////////////////////////////////////////////////////////////////////// void SkTableMaskFilter::MakeGammaTable(uint8_t table[256], SkScalar gamma) { diff --git a/src/effects/SkTestImageFilters.cpp b/src/effects/SkTestImageFilters.cpp index a414c924f3..be991f6f83 100755 --- a/src/effects/SkTestImageFilters.cpp +++ b/src/effects/SkTestImageFilters.cpp @@ -80,11 +80,3 @@ void SkDownSampleImageFilter::flatten(SkWriteBuffer& buffer) const { this->INHERITED::flatten(buffer); buffer.writeScalar(fScale); } - -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkDownSampleImageFilter::SkDownSampleImageFilter(SkReadBuffer& buffer) - : INHERITED(1, buffer) { - fScale = buffer.readScalar(); - buffer.validate(SkScalarIsFinite(fScale)); -} -#endif diff --git a/src/effects/SkTileImageFilter.cpp b/src/effects/SkTileImageFilter.cpp index 04c62d0574..d640ac7adb 100644 --- a/src/effects/SkTileImageFilter.cpp +++ b/src/effects/SkTileImageFilter.cpp @@ -93,15 +93,6 @@ bool SkTileImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm, return true; } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkTileImageFilter::SkTileImageFilter(SkReadBuffer& buffer) - : INHERITED(1, buffer) { - buffer.readRect(&fSrcRect); - buffer.readRect(&fDstRect); - buffer.validate(buffer.isValid() && SkIsValidRect(fSrcRect) && SkIsValidRect(fDstRect)); -} -#endif - SkFlattenable* SkTileImageFilter::CreateProc(SkReadBuffer& buffer) { SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); SkRect src, dst; diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp index 379d6d8f95..1618b64036 100644 --- a/src/effects/SkXfermodeImageFilter.cpp +++ b/src/effects/SkXfermodeImageFilter.cpp @@ -32,13 +32,6 @@ SkXfermodeImageFilter::~SkXfermodeImageFilter() { SkSafeUnref(fMode); } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkXfermodeImageFilter::SkXfermodeImageFilter(SkReadBuffer& buffer) - : INHERITED(2, buffer) { - fMode = buffer.readXfermode(); -} -#endif - SkFlattenable* SkXfermodeImageFilter::CreateProc(SkReadBuffer& buffer) { SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 2); SkAutoTUnref<SkXfermode> mode(buffer.readXfermode()); diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp index d7b51440b3..e70be04697 100644 --- a/src/effects/gradients/SkGradientShader.cpp +++ b/src/effects/gradients/SkGradientShader.cpp @@ -199,56 +199,6 @@ SkGradientShaderBase::SkGradientShaderBase(const Descriptor& desc) this->initCommon(); } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -static SkShader::TileMode unpack_mode(uint32_t packed) { - return (SkShader::TileMode)(packed & 0xF); -} - -static uint32_t unpack_flags(uint32_t packed) { - return packed >> 4; -} - -SkGradientShaderBase::SkGradientShaderBase(SkReadBuffer& buffer) : INHERITED(buffer) { - int colorCount = fColorCount = buffer.getArrayCount(); - if (colorCount > kColorStorageCount) { - size_t allocSize = (sizeof(SkColor) + sizeof(SkScalar) + sizeof(Rec)) * colorCount; - if (buffer.validateAvailable(allocSize)) { - fOrigColors = reinterpret_cast<SkColor*>(sk_malloc_throw(allocSize)); - } else { - fOrigColors = NULL; - colorCount = fColorCount = 0; - } - } else { - fOrigColors = fStorage; - } - buffer.readColorArray(fOrigColors, colorCount); - - fOrigPos = (SkScalar*)(fOrigColors + colorCount); - - { - uint32_t packed = buffer.readUInt(); - fGradFlags = SkToU8(unpack_flags(packed)); - fTileMode = unpack_mode(packed); - } - fTileProc = gTileProcs[fTileMode]; - fRecs = (Rec*)(fOrigPos + colorCount); - if (colorCount > 2) { - Rec* recs = fRecs; - recs[0].fPos = 0; - fOrigPos[0] = 0; - for (int i = 1; i < colorCount; i++) { - recs[i].fPos = buffer.readInt(); - recs[i].fScale = buffer.readUInt(); - fOrigPos[i] = SkFixedToScalar(recs[i].fPos); - } - } else { - fOrigPos = NULL; - } - buffer.readMatrix(&fPtsToUnit); - this->initCommon(); -} -#endif - SkGradientShaderBase::~SkGradientShaderBase() { if (fOrigColors != fStorage) { sk_free(fOrigColors); diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp index 3ab721950a..1faca5e4a1 100644 --- a/src/effects/gradients/SkLinearGradient.cpp +++ b/src/effects/gradients/SkLinearGradient.cpp @@ -60,14 +60,6 @@ SkLinearGradient::SkLinearGradient(const SkPoint pts[2], const Descriptor& desc) pts_to_unit_matrix(pts, &fPtsToUnit); } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkLinearGradient::SkLinearGradient(SkReadBuffer& buffer) - : INHERITED(buffer) - , fStart(buffer.readPoint()) - , fEnd(buffer.readPoint()) { -} -#endif - SkFlattenable* SkLinearGradient::CreateProc(SkReadBuffer& buffer) { DescriptorScope desc; if (!desc.unflatten(buffer)) { @@ -568,7 +560,7 @@ bool SkLinearGradient::asFragmentProcessor(GrContext* context, const SkPaint& pa const SkMatrix* localMatrix, GrColor* paintColor, GrFragmentProcessor** fp) const { SkASSERT(context); - + SkMatrix matrix; if (!this->getLocalMatrix().invert(&matrix)) { return false; @@ -581,10 +573,10 @@ bool SkLinearGradient::asFragmentProcessor(GrContext* context, const SkPaint& pa matrix.postConcat(inv); } matrix.postConcat(fPtsToUnit); - + *paintColor = SkColor2GrColorJustAlpha(paint.getColor()); *fp = GrLinearGradient::Create(context, *this, matrix, fTileMode); - + return true; } diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp index 99531d93d4..7c0e8f6031 100644 --- a/src/effects/gradients/SkRadialGradient.cpp +++ b/src/effects/gradients/SkRadialGradient.cpp @@ -252,14 +252,6 @@ SkShader::GradientType SkRadialGradient::asAGradient(GradientInfo* info) const { return kRadial_GradientType; } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkRadialGradient::SkRadialGradient(SkReadBuffer& buffer) - : INHERITED(buffer), - fCenter(buffer.readPoint()), - fRadius(buffer.readScalar()) { -} -#endif - SkFlattenable* SkRadialGradient::CreateProc(SkReadBuffer& buffer) { DescriptorScope desc; if (!desc.unflatten(buffer)) { @@ -578,7 +570,7 @@ bool SkRadialGradient::asFragmentProcessor(GrContext* context, const SkPaint& pa const SkMatrix* localMatrix, GrColor* paintColor, GrFragmentProcessor** fp) const { SkASSERT(context); - + SkMatrix matrix; if (!this->getLocalMatrix().invert(&matrix)) { return false; @@ -591,10 +583,10 @@ bool SkRadialGradient::asFragmentProcessor(GrContext* context, const SkPaint& pa matrix.postConcat(inv); } matrix.postConcat(fPtsToUnit); - + *paintColor = SkColor2GrColorJustAlpha(paint.getColor()); *fp = GrRadialGradient::Create(context, *this, matrix, fTileMode); - + return true; } diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp index d080ec5fde..163700641c 100644 --- a/src/effects/gradients/SkSweepGradient.cpp +++ b/src/effects/gradients/SkSweepGradient.cpp @@ -41,13 +41,6 @@ SkShader::GradientType SkSweepGradient::asAGradient(GradientInfo* info) const { return kSweep_GradientType; } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkSweepGradient::SkSweepGradient(SkReadBuffer& buffer) - : INHERITED(buffer), - fCenter(buffer.readPoint()) { -} -#endif - SkFlattenable* SkSweepGradient::CreateProc(SkReadBuffer& buffer) { DescriptorScope desc; if (!desc.unflatten(buffer)) { @@ -294,7 +287,7 @@ void GrGLSweepGradient::emitCode(GrGLFPBuilder* builder, bool SkSweepGradient::asFragmentProcessor(GrContext* context, const SkPaint& paint, const SkMatrix* localMatrix, GrColor* paintColor, GrFragmentProcessor** effect) const { - + SkMatrix matrix; if (!this->getLocalMatrix().invert(&matrix)) { return false; @@ -307,10 +300,10 @@ bool SkSweepGradient::asFragmentProcessor(GrContext* context, const SkPaint& pai matrix.postConcat(inv); } matrix.postConcat(fPtsToUnit); - + *effect = GrSweepGradient::Create(context, *this, matrix); *paintColor = SkColor2GrColorJustAlpha(paint.getColor()); - + return true; } diff --git a/src/effects/gradients/SkSweepGradient.h b/src/effects/gradients/SkSweepGradient.h index d816295077..2ca4a623fa 100644 --- a/src/effects/gradients/SkSweepGradient.h +++ b/src/effects/gradients/SkSweepGradient.h @@ -41,9 +41,6 @@ public: SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkSweepGradient) protected: -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING - SkSweepGradient(SkReadBuffer& buffer); -#endif virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE; virtual Context* onCreateContext(const ContextRec&, void* storage) const SK_OVERRIDE; diff --git a/src/effects/gradients/SkTwoPointConicalGradient.cpp b/src/effects/gradients/SkTwoPointConicalGradient.cpp index 5410f6a9df..2fc848e109 100644 --- a/src/effects/gradients/SkTwoPointConicalGradient.cpp +++ b/src/effects/gradients/SkTwoPointConicalGradient.cpp @@ -343,19 +343,6 @@ SkShader::GradientType SkTwoPointConicalGradient::asAGradient( return kConical_GradientType; } -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkTwoPointConicalGradient::SkTwoPointConicalGradient( - SkReadBuffer& buffer) - : INHERITED(buffer) - , fCenter1(buffer.readPoint()) - , fCenter2(buffer.readPoint()) - , fRadius1(buffer.readScalar()) - , fRadius2(buffer.readScalar()) - , fFlippedGrad(buffer.readBool()) { - this->init(); -} -#endif - SkFlattenable* SkTwoPointConicalGradient::CreateProc(SkReadBuffer& buffer) { DescriptorScope desc; if (!desc.unflatten(buffer)) { diff --git a/src/effects/gradients/SkTwoPointRadialGradient.cpp b/src/effects/gradients/SkTwoPointRadialGradient.cpp index 3e400445ae..8ce3f435b7 100644 --- a/src/effects/gradients/SkTwoPointRadialGradient.cpp +++ b/src/effects/gradients/SkTwoPointRadialGradient.cpp @@ -343,17 +343,6 @@ void SkTwoPointRadialGradient::toString(SkString* str) const { } #endif -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkTwoPointRadialGradient::SkTwoPointRadialGradient(SkReadBuffer& buffer) - : INHERITED(buffer), - fCenter1(buffer.readPoint()), - fCenter2(buffer.readPoint()), - fRadius1(buffer.readScalar()), - fRadius2(buffer.readScalar()) { - init(); -}; -#endif - SkFlattenable* SkTwoPointRadialGradient::CreateProc(SkReadBuffer& buffer) { DescriptorScope desc; if (!desc.unflatten(buffer)) { @@ -686,7 +675,7 @@ bool SkTwoPointRadialGradient::asFragmentProcessor(GrContext* context, const SkP const SkMatrix* localMatrix, GrColor* paintColor, GrFragmentProcessor** fp) const { SkASSERT(context); - + // invert the localM, translate to center1 (fPtsToUni), rotate so center2 is on x axis. SkMatrix matrix; if (!this->getLocalMatrix().invert(&matrix)) { @@ -712,7 +701,7 @@ bool SkTwoPointRadialGradient::asFragmentProcessor(GrContext* context, const SkP *paintColor = SkColor2GrColorJustAlpha(paint.getColor()); *fp = GrRadial2Gradient::Create(context, *this, matrix, fTileMode); - + return true; } diff --git a/src/opts/SkXfermode_opts_SSE2.cpp b/src/opts/SkXfermode_opts_SSE2.cpp index 02ca0382dd..fccf665147 100644 --- a/src/opts/SkXfermode_opts_SSE2.cpp +++ b/src/opts/SkXfermode_opts_SSE2.cpp @@ -641,13 +641,6 @@ typedef __m128i (*SkXfermodeProcSIMD)(const __m128i& src, const __m128i& dst); extern SkXfermodeProcSIMD gSSE2XfermodeProcs[]; -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkSSE2ProcCoeffXfermode::SkSSE2ProcCoeffXfermode(SkReadBuffer& buffer) : INHERITED(buffer) { - fProcSIMD = reinterpret_cast<void*>(gSSE2XfermodeProcs[this->getMode()]); - buffer.validate(fProcSIMD != NULL); -} -#endif - void SkSSE2ProcCoeffXfermode::xfer32(SkPMColor dst[], const SkPMColor src[], int count, const SkAlpha aa[]) const { SkASSERT(dst && src && count >= 0); diff --git a/src/opts/SkXfermode_opts_SSE2.h b/src/opts/SkXfermode_opts_SSE2.h index 8512aee094..7ccce488fd 100644 --- a/src/opts/SkXfermode_opts_SSE2.h +++ b/src/opts/SkXfermode_opts_SSE2.h @@ -25,10 +25,6 @@ public: SK_TO_STRING_OVERRIDE() private: -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING - SkSSE2ProcCoeffXfermode(SkReadBuffer& buffer); -#endif - void* fProcSIMD; typedef SkProcCoeffXfermode INHERITED; }; diff --git a/src/opts/SkXfermode_opts_arm_neon.cpp b/src/opts/SkXfermode_opts_arm_neon.cpp index dca58eb53e..7534c986ca 100644 --- a/src/opts/SkXfermode_opts_arm_neon.cpp +++ b/src/opts/SkXfermode_opts_arm_neon.cpp @@ -743,12 +743,6 @@ typedef uint8x8x4_t (*SkXfermodeProcSIMD)(uint8x8x4_t src, uint8x8x4_t dst); extern SkXfermodeProcSIMD gNEONXfermodeProcs[]; -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING -SkNEONProcCoeffXfermode::SkNEONProcCoeffXfermode(SkReadBuffer& buffer) : INHERITED(buffer) { - fProcSIMD = reinterpret_cast<void*>(gNEONXfermodeProcs[this->getMode()]); -} -#endif - void SkNEONProcCoeffXfermode::xfer32(SkPMColor* SK_RESTRICT dst, const SkPMColor* SK_RESTRICT src, int count, const SkAlpha* SK_RESTRICT aa) const { diff --git a/src/opts/SkXfermode_opts_arm_neon.h b/src/opts/SkXfermode_opts_arm_neon.h index 745bfe260c..f091432d88 100644 --- a/src/opts/SkXfermode_opts_arm_neon.h +++ b/src/opts/SkXfermode_opts_arm_neon.h @@ -17,10 +17,6 @@ public: SK_TO_STRING_OVERRIDE() private: -#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING - SkNEONProcCoeffXfermode(SkReadBuffer& buffer); -#endif - // void* is used to avoid pulling arm_neon.h in the core and having to build // it with -mfpu=neon. void* fProcSIMD; |