aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2014-12-01 11:47:08 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-12-01 11:47:08 -0800
commit3f3b3d003527861dc0bd89733857576408906431 (patch)
tree91d09bd814cea513c55d99003e2ef7ef24e91b62
parentbc0c4bd9dff5c7be1a0845ef0d5cc3f4faaef5f3 (diff)
Remove SK_SUPPORT_LEGACY_DEEPFLATTENING.
This was needed for pictures before v33, and we're now requiring v35+. Will follow up with the same for skia/ext/pixel_ref_utils_unittest.cc BUG=skia: Committed: https://skia.googlesource.com/skia/+/52c293547b973f7fb5de3c83f5062b07d759ab88 Review URL: https://codereview.chromium.org/769953002
-rw-r--r--gm/imagefiltersbase.cpp16
-rw-r--r--gm/imagefiltersgraph.cpp12
-rw-r--r--include/core/SkColorFilter.h3
-rw-r--r--include/core/SkDrawLooper.h3
-rw-r--r--include/core/SkFlattenable.h26
-rw-r--r--include/core/SkMaskFilter.h4
-rw-r--r--include/core/SkPathEffect.h14
-rw-r--r--include/core/SkRasterizer.h4
-rw-r--r--include/core/SkShader.h3
-rw-r--r--include/core/SkXfermode.h4
-rw-r--r--include/effects/Sk1DPathEffect.h3
-rw-r--r--include/effects/Sk2DPathEffect.h10
-rw-r--r--include/effects/SkAvoidXfermode.h3
-rw-r--r--include/effects/SkBitmapSource.h3
-rw-r--r--include/effects/SkBlurDrawLooper.h3
-rw-r--r--include/effects/SkBlurImageFilter.h3
-rw-r--r--include/effects/SkColorCubeFilter.h3
-rw-r--r--include/effects/SkColorFilterImageFilter.h3
-rw-r--r--include/effects/SkColorMatrixFilter.h3
-rw-r--r--include/effects/SkComposeImageFilter.h4
-rw-r--r--include/effects/SkCornerPathEffect.h3
-rw-r--r--include/effects/SkDashPathEffect.h3
-rw-r--r--include/effects/SkDiscretePathEffect.h3
-rw-r--r--include/effects/SkDisplacementMapEffect.h3
-rw-r--r--include/effects/SkDropShadowImageFilter.h3
-rw-r--r--include/effects/SkEmbossMaskFilter.h3
-rw-r--r--include/effects/SkLayerDrawLooper.h7
-rw-r--r--include/effects/SkLayerRasterizer.h3
-rw-r--r--include/effects/SkLerpXfermode.h3
-rw-r--r--include/effects/SkLightingImageFilter.h3
-rw-r--r--include/effects/SkLumaColorFilter.h3
-rw-r--r--include/effects/SkMagnifierImageFilter.h3
-rw-r--r--include/effects/SkMatrixConvolutionImageFilter.h3
-rw-r--r--include/effects/SkMatrixImageFilter.h3
-rw-r--r--include/effects/SkMergeImageFilter.h3
-rw-r--r--include/effects/SkMorphologyImageFilter.h10
-rw-r--r--include/effects/SkOffsetImageFilter.h3
-rw-r--r--include/effects/SkPerlinNoiseShader.h20
-rw-r--r--include/effects/SkPictureImageFilter.h3
-rw-r--r--include/effects/SkPixelXorXfermode.h3
-rw-r--r--include/effects/SkRectShaderImageFilter.h3
-rw-r--r--include/effects/SkTableMaskFilter.h3
-rw-r--r--include/effects/SkTestImageFilters.h3
-rw-r--r--include/effects/SkTileImageFilter.h3
-rw-r--r--include/effects/SkTransparentShader.h4
-rw-r--r--include/effects/SkXfermodeImageFilter.h3
-rw-r--r--samplecode/ClockFaceView.cpp13
-rw-r--r--samplecode/SampleAll.cpp5
-rw-r--r--src/core/SkBitmapProcShader.cpp9
-rw-r--r--src/core/SkBitmapProcShader.h3
-rw-r--r--src/core/SkBlitter.cpp9
-rw-r--r--src/core/SkComposeShader.cpp14
-rw-r--r--src/core/SkEmptyShader.h4
-rw-r--r--src/core/SkFilterShader.cpp7
-rw-r--r--src/core/SkFilterShader.h3
-rw-r--r--src/core/SkFlattenable.cpp12
-rw-r--r--src/core/SkLocalMatrixShader.cpp9
-rw-r--r--src/core/SkLocalMatrixShader.h15
-rw-r--r--src/core/SkPathEffect.cpp8
-rw-r--r--src/core/SkPictureShader.cpp9
-rw-r--r--src/core/SkShader.cpp17
-rw-r--r--src/core/SkXfermode.cpp29
-rw-r--r--src/core/SkXfermode_proccoeff.h6
-rw-r--r--src/effects/Sk1DPathEffect.cpp16
-rw-r--r--src/effects/Sk2DPathEffect.cpp19
-rw-r--r--src/effects/SkAlphaThresholdFilter.cpp12
-rw-r--r--src/effects/SkArithmeticMode.cpp10
-rw-r--r--src/effects/SkAvoidXfermode.cpp8
-rw-r--r--src/effects/SkBitmapSource.cpp9
-rw-r--r--src/effects/SkBlurDrawLooper.cpp13
-rw-r--r--src/effects/SkBlurImageFilter.cpp12
-rw-r--r--src/effects/SkBlurMaskFilter.cpp10
-rw-r--r--src/effects/SkColorCubeFilter.cpp9
-rwxr-xr-xsrc/effects/SkColorFilterImageFilter.cpp15
-rw-r--r--src/effects/SkColorFilters.cpp11
-rw-r--r--src/effects/SkColorMatrixFilter.cpp9
-rw-r--r--src/effects/SkComposeImageFilter.cpp6
-rw-r--r--src/effects/SkCornerPathEffect.cpp6
-rw-r--r--src/effects/SkDashPathEffect.cpp25
-rw-r--r--src/effects/SkDiscretePathEffect.cpp9
-rw-r--r--src/effects/SkDisplacementMapEffect.cpp13
-rw-r--r--src/effects/SkDropShadowImageFilter.cpp18
-rw-r--r--src/effects/SkEmbossMaskFilter.cpp9
-rw-r--r--src/effects/SkLayerRasterizer.cpp7
-rw-r--r--src/effects/SkLerpXfermode.cpp6
-rw-r--r--src/effects/SkLightingImageFilter.cpp35
-rw-r--r--src/effects/SkLumaColorFilter.cpp4
-rw-r--r--src/effects/SkMagnifierImageFilter.cpp18
-rw-r--r--src/effects/SkMatrixConvolutionImageFilter.cpp44
-rw-r--r--src/effects/SkMatrixImageFilter.cpp8
-rwxr-xr-xsrc/effects/SkMergeImageFilter.cpp21
-rw-r--r--src/effects/SkMorphologyImageFilter.cpp10
-rw-r--r--src/effects/SkOffsetImageFilter.cpp9
-rw-r--r--src/effects/SkPerlinNoiseShader.cpp23
-rw-r--r--src/effects/SkPictureImageFilter.cpp15
-rw-r--r--src/effects/SkPixelXorXfermode.cpp6
-rw-r--r--src/effects/SkRectShaderImageFilter.cpp7
-rw-r--r--src/effects/SkTableColorFilter.cpp28
-rw-r--r--src/effects/SkTableMaskFilter.cpp7
-rwxr-xr-xsrc/effects/SkTestImageFilters.cpp8
-rw-r--r--src/effects/SkTileImageFilter.cpp9
-rw-r--r--src/effects/SkXfermodeImageFilter.cpp7
-rw-r--r--src/effects/gradients/SkGradientShader.cpp50
-rw-r--r--src/effects/gradients/SkLinearGradient.cpp14
-rw-r--r--src/effects/gradients/SkRadialGradient.cpp14
-rw-r--r--src/effects/gradients/SkSweepGradient.cpp13
-rw-r--r--src/effects/gradients/SkSweepGradient.h3
-rw-r--r--src/effects/gradients/SkTwoPointConicalGradient.cpp13
-rw-r--r--src/effects/gradients/SkTwoPointRadialGradient.cpp15
-rw-r--r--src/opts/SkXfermode_opts_SSE2.cpp7
-rw-r--r--src/opts/SkXfermode_opts_SSE2.h4
-rw-r--r--src/opts/SkXfermode_opts_arm_neon.cpp6
-rw-r--r--src/opts/SkXfermode_opts_arm_neon.h4
-rw-r--r--tests/ImageFilterTest.cpp23
-rw-r--r--tests/PDFPrimitivesTest.cpp5
115 files changed, 38 insertions, 1050 deletions
diff --git a/gm/imagefiltersbase.cpp b/gm/imagefiltersbase.cpp
index 4546b8add2..749334a61e 100644
--- a/gm/imagefiltersbase.cpp
+++ b/gm/imagefiltersbase.cpp
@@ -22,11 +22,7 @@ public:
public:
Registrar() {
SkFlattenable::Register("FailImageFilter",
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- FailImageFilter::DeepCreateProc,
-#else
FailImageFilter::CreateProc,
-#endif
FailImageFilter::GetFlattenableType());
}
};
@@ -44,10 +40,6 @@ protected:
return false;
}
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- FailImageFilter(SkReadBuffer& buffer) : INHERITED(0, buffer) {}
-#endif
-
private:
typedef SkImageFilter INHERITED;
};
@@ -65,11 +57,7 @@ public:
public:
Registrar() {
SkFlattenable::Register("IdentityImageFilter",
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- IdentityImageFilter::DeepCreateProc,
-#else
IdentityImageFilter::CreateProc,
-#endif
IdentityImageFilter::GetFlattenableType());
}
};
@@ -88,10 +76,6 @@ protected:
return true;
}
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- IdentityImageFilter(SkReadBuffer& buffer) : INHERITED(1, buffer) {}
-#endif
-
private:
typedef SkImageFilter INHERITED;
};
diff --git a/gm/imagefiltersgraph.cpp b/gm/imagefiltersgraph.cpp
index 8af268e568..8469a43b59 100644
--- a/gm/imagefiltersgraph.cpp
+++ b/gm/imagefiltersgraph.cpp
@@ -29,11 +29,7 @@ public:
public:
Registrar() {
SkFlattenable::Register("SimpleOffsetFilter",
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- SimpleOffsetFilter::DeepCreateProc,
-#else
SimpleOffsetFilter::CreateProc,
-#endif
SimpleOffsetFilter::GetFlattenableType());
}
};
@@ -69,14 +65,6 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SimpleOffsetFilter);
protected:
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SimpleOffsetFilter(SkReadBuffer& buffer)
- : SkImageFilter(1, buffer) {
- fDX = buffer.readScalar();
- fDY = buffer.readScalar();
- }
-#endif
-
virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE {
this->INHERITED::flatten(buffer);
buffer.writeScalar(fDX);
diff --git a/include/core/SkColorFilter.h b/include/core/SkColorFilter.h
index 31d4a01ee7..929607a398 100644
--- a/include/core/SkColorFilter.h
+++ b/include/core/SkColorFilter.h
@@ -135,9 +135,6 @@ public:
protected:
SkColorFilter() {}
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- SkColorFilter(SkReadBuffer& rb) : INHERITED(rb) {}
-#endif
private:
typedef SkFlattenable INHERITED;
diff --git a/include/core/SkDrawLooper.h b/include/core/SkDrawLooper.h
index f771d01c70..c866183cb3 100644
--- a/include/core/SkDrawLooper.h
+++ b/include/core/SkDrawLooper.h
@@ -114,9 +114,6 @@ public:
protected:
SkDrawLooper() {}
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- SkDrawLooper(SkReadBuffer& buffer) : INHERITED(buffer) {}
-#endif
private:
typedef SkFlattenable INHERITED;
diff --git a/include/core/SkFlattenable.h b/include/core/SkFlattenable.h
index 679f640d3c..3cfa85af48 100644
--- a/include/core/SkFlattenable.h
+++ b/include/core/SkFlattenable.h
@@ -13,8 +13,6 @@
class SkReadBuffer;
class SkWriteBuffer;
-#define SK_SUPPORT_LEGACY_DEEPFLATTENING
-
/*
* Flattening is straight-forward:
* 1. call getFactory() so we have a function-ptr to recreate the subclass
@@ -45,24 +43,6 @@ class SkWriteBuffer;
#define SK_DECLARE_UNFLATTENABLE_OBJECT() \
virtual Factory getFactory() const SK_OVERRIDE { return NULL; }
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
-#define SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(flattenable) \
- SkFlattenable::Registrar(#flattenable, flattenable::DeepCreateProc, \
- flattenable::GetFlattenableType());
-
-#define SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(flattenable) \
- private: \
- static SkFlattenable* CreateProc(SkReadBuffer&); \
- static SkFlattenable* DeepCreateProc(SkReadBuffer& buffer) { \
- if (NeedsDeepUnflatten(buffer)) { \
- return SkNEW_ARGS(flattenable, (buffer)); \
- } \
- return CreateProc(buffer); \
- } \
- friend class SkPrivateEffectInitializer; \
- public: \
- virtual Factory getFactory() const SK_OVERRIDE {return DeepCreateProc;}
-#else
#define SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(flattenable) \
SkFlattenable::Registrar(#flattenable, flattenable::CreateProc, \
flattenable::GetFlattenableType());
@@ -73,7 +53,6 @@ class SkWriteBuffer;
friend class SkPrivateEffectInitializer; \
public: \
virtual Factory getFactory() const SK_OVERRIDE { return CreateProc; }
-#endif
// If your subclass will *never* need to be unflattened, declare this.
#define SK_DECLARE_NOT_FLATTENABLE_PROCS(flattenable) \
@@ -144,11 +123,6 @@ public:
virtual void flatten(SkWriteBuffer&) const {}
protected:
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- static bool NeedsDeepUnflatten(const SkReadBuffer&);
- SkFlattenable(SkReadBuffer&) {}
-#endif
-
static SkFlattenable* ReturnNullCreateProc(SkReadBuffer&) {
return NULL;
}
diff --git a/include/core/SkMaskFilter.h b/include/core/SkMaskFilter.h
index 026ef40cb1..a651b466fa 100644
--- a/include/core/SkMaskFilter.h
+++ b/include/core/SkMaskFilter.h
@@ -153,10 +153,6 @@ public:
protected:
SkMaskFilter() {}
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- // empty for now, but lets get our subclass to remember to init us for the future
- SkMaskFilter(SkReadBuffer& buffer) : INHERITED(buffer) {}
-#endif
enum FilterReturn {
kFalse_FilterReturn,
diff --git a/include/core/SkPathEffect.h b/include/core/SkPathEffect.h
index 454614a262..2a6e3a9c22 100644
--- a/include/core/SkPathEffect.h
+++ b/include/core/SkPathEffect.h
@@ -135,9 +135,6 @@ public:
protected:
SkPathEffect() {}
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- SkPathEffect(SkReadBuffer& buffer) : INHERITED(buffer) {}
-#endif
private:
// illegal
@@ -159,9 +156,6 @@ public:
protected:
SkPairPathEffect(SkPathEffect* pe0, SkPathEffect* pe1);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- SkPairPathEffect(SkReadBuffer&);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
@@ -197,10 +191,6 @@ protected:
SkComposePathEffect(SkPathEffect* outer, SkPathEffect* inner)
: INHERITED(outer, inner) {}
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkComposePathEffect(SkReadBuffer& buffer) : INHERITED(buffer) {}
-#endif
-
private:
// illegal
SkComposePathEffect(const SkComposePathEffect&);
@@ -234,10 +224,6 @@ protected:
SkSumPathEffect(SkPathEffect* first, SkPathEffect* second)
: INHERITED(first, second) {}
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkSumPathEffect(SkReadBuffer& buffer) : INHERITED(buffer) {}
-#endif
-
private:
// illegal
SkSumPathEffect(const SkSumPathEffect&);
diff --git a/include/core/SkRasterizer.h b/include/core/SkRasterizer.h
index 3280f42611..10caad76bf 100644
--- a/include/core/SkRasterizer.h
+++ b/include/core/SkRasterizer.h
@@ -32,10 +32,6 @@ public:
protected:
SkRasterizer() {}
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- SkRasterizer(SkReadBuffer& buffer) : INHERITED(buffer) {}
-#endif
-
virtual bool onRasterize(const SkPath& path, const SkMatrix& matrix,
const SkIRect* clipBounds,
SkMask* mask, SkMask::CreateMode mode) const;
diff --git a/include/core/SkShader.h b/include/core/SkShader.h
index e9911cef81..0033485e29 100644
--- a/include/core/SkShader.h
+++ b/include/core/SkShader.h
@@ -479,9 +479,6 @@ public:
SK_DEFINE_FLATTENABLE_TYPE(SkShader)
protected:
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- SkShader(SkReadBuffer& );
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
bool computeTotalInverse(const ContextRec&, SkMatrix* totalInverse) const;
diff --git a/include/core/SkXfermode.h b/include/core/SkXfermode.h
index bedcc24569..6d723e8fc2 100644
--- a/include/core/SkXfermode.h
+++ b/include/core/SkXfermode.h
@@ -215,10 +215,6 @@ public:
protected:
SkXfermode() {}
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkXfermode(SkReadBuffer& rb) : SkFlattenable(rb) {}
-#endif
-
/** The default implementation of xfer32/xfer16/xferA8 in turn call this
method, 1 color at a time (upscaled to a SkPMColor). The default
implmentation of this method just returns dst. If performance is
diff --git a/include/effects/Sk1DPathEffect.h b/include/effects/Sk1DPathEffect.h
index 87047e4ec2..9ba11b0812 100644
--- a/include/effects/Sk1DPathEffect.h
+++ b/include/effects/Sk1DPathEffect.h
@@ -64,9 +64,6 @@ public:
protected:
SkPath1DPathEffect(const SkPath& path, SkScalar advance, SkScalar phase, Style);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkPath1DPathEffect(SkReadBuffer& buffer);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
// overrides from Sk1DPathEffect
diff --git a/include/effects/Sk2DPathEffect.h b/include/effects/Sk2DPathEffect.h
index 80a27a3793..97c86ec7f2 100644
--- a/include/effects/Sk2DPathEffect.h
+++ b/include/effects/Sk2DPathEffect.h
@@ -39,9 +39,6 @@ protected:
// protected so that subclasses can call this during unflattening
explicit Sk2DPathEffect(const SkMatrix& mat);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit Sk2DPathEffect(SkReadBuffer&);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
private:
@@ -70,10 +67,6 @@ public:
protected:
SkLine2DPathEffect(SkScalar width, const SkMatrix& matrix)
: Sk2DPathEffect(matrix), fWidth(width) {}
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkLine2DPathEffect(SkReadBuffer&);
-#endif
-
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual void nextSpan(int u, int v, int ucount, SkPath*) const SK_OVERRIDE;
@@ -98,9 +91,6 @@ public:
protected:
SkPath2DPathEffect(const SkMatrix&, const SkPath&);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkPath2DPathEffect(SkReadBuffer& buffer);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual void next(const SkPoint&, int u, int v, SkPath*) const SK_OVERRIDE;
diff --git a/include/effects/SkAvoidXfermode.h b/include/effects/SkAvoidXfermode.h
index 53ce708e36..c79227f762 100644
--- a/include/effects/SkAvoidXfermode.h
+++ b/include/effects/SkAvoidXfermode.h
@@ -54,9 +54,6 @@ public:
protected:
SkAvoidXfermode(SkColor opColor, U8CPU tolerance, Mode mode);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkAvoidXfermode(SkReadBuffer&);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
private:
diff --git a/include/effects/SkBitmapSource.h b/include/effects/SkBitmapSource.h
index 27c7ae204f..8b678b2eb8 100644
--- a/include/effects/SkBitmapSource.h
+++ b/include/effects/SkBitmapSource.h
@@ -27,9 +27,6 @@ public:
protected:
explicit SkBitmapSource(const SkBitmap& bitmap);
SkBitmapSource(const SkBitmap& bitmap, const SkRect& srcRect, const SkRect& dstRect);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkBitmapSource(SkReadBuffer& buffer);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
diff --git a/include/effects/SkBlurDrawLooper.h b/include/effects/SkBlurDrawLooper.h
index 9db9f0d7d2..cb912c1a85 100644
--- a/include/effects/SkBlurDrawLooper.h
+++ b/include/effects/SkBlurDrawLooper.h
@@ -53,9 +53,6 @@ protected:
SkBlurDrawLooper(SkColor color, SkScalar sigma, SkScalar dx, SkScalar dy,
uint32_t flags);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- SkBlurDrawLooper(SkReadBuffer&);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool asABlurShadow(BlurShadowRec*) const SK_OVERRIDE;
diff --git a/include/effects/SkBlurImageFilter.h b/include/effects/SkBlurImageFilter.h
index cfa895a6cf..9064579bea 100644
--- a/include/effects/SkBlurImageFilter.h
+++ b/include/effects/SkBlurImageFilter.h
@@ -30,9 +30,6 @@ protected:
SkImageFilter* input,
const CropRect* cropRect,
uint32_t uniqueID);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkBlurImageFilter(SkReadBuffer& buffer);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
diff --git a/include/effects/SkColorCubeFilter.h b/include/effects/SkColorCubeFilter.h
index 2cfee45e9c..ebd5e5fbb5 100644
--- a/include/effects/SkColorCubeFilter.h
+++ b/include/effects/SkColorCubeFilter.h
@@ -32,9 +32,6 @@ public:
protected:
SkColorCubeFilter(SkData* cubeData, int cubeDimension);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- SkColorCubeFilter(SkReadBuffer& buffer);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
private:
diff --git a/include/effects/SkColorFilterImageFilter.h b/include/effects/SkColorFilterImageFilter.h
index 46f2d2aede..ff163c7cd4 100644
--- a/include/effects/SkColorFilterImageFilter.h
+++ b/include/effects/SkColorFilterImageFilter.h
@@ -23,9 +23,6 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkColorFilterImageFilter)
protected:
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- SkColorFilterImageFilter(SkReadBuffer& buffer);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
diff --git a/include/effects/SkColorMatrixFilter.h b/include/effects/SkColorMatrixFilter.h
index dad40623f1..379ca5755a 100644
--- a/include/effects/SkColorMatrixFilter.h
+++ b/include/effects/SkColorMatrixFilter.h
@@ -41,9 +41,6 @@ public:
protected:
explicit SkColorMatrixFilter(const SkColorMatrix&);
explicit SkColorMatrixFilter(const SkScalar array[20]);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkColorMatrixFilter(SkReadBuffer& buffer);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
private:
diff --git a/include/effects/SkComposeImageFilter.h b/include/effects/SkComposeImageFilter.h
index 26eed37872..0478909cd1 100644
--- a/include/effects/SkComposeImageFilter.h
+++ b/include/effects/SkComposeImageFilter.h
@@ -32,10 +32,6 @@ protected:
SkASSERT(inputs[0]);
SkASSERT(inputs[1]);
}
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkComposeImageFilter(SkReadBuffer& buffer);
-#endif
-
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
SkBitmap* result, SkIPoint* loc) const SK_OVERRIDE;
virtual bool onFilterBounds(const SkIRect&, const SkMatrix&, SkIRect*) const SK_OVERRIDE;
diff --git a/include/effects/SkCornerPathEffect.h b/include/effects/SkCornerPathEffect.h
index e61d49405d..6b75da66e3 100644
--- a/include/effects/SkCornerPathEffect.h
+++ b/include/effects/SkCornerPathEffect.h
@@ -32,9 +32,6 @@ public:
protected:
explicit SkCornerPathEffect(SkScalar radius);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkCornerPathEffect(SkReadBuffer&);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
private:
diff --git a/include/effects/SkDashPathEffect.h b/include/effects/SkDashPathEffect.h
index 394622426d..210b378fb2 100644
--- a/include/effects/SkDashPathEffect.h
+++ b/include/effects/SkDashPathEffect.h
@@ -55,9 +55,6 @@ public:
protected:
SkDashPathEffect(const SkScalar intervals[], int count, SkScalar phase);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkDashPathEffect(SkReadBuffer&);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
private:
diff --git a/include/effects/SkDiscretePathEffect.h b/include/effects/SkDiscretePathEffect.h
index 8f1082cb40..18c7b4bdf8 100644
--- a/include/effects/SkDiscretePathEffect.h
+++ b/include/effects/SkDiscretePathEffect.h
@@ -45,9 +45,6 @@ protected:
SkDiscretePathEffect(SkScalar segLength,
SkScalar deviation,
uint32_t seedAssist);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkDiscretePathEffect(SkReadBuffer&);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
private:
diff --git a/include/effects/SkDisplacementMapEffect.h b/include/effects/SkDisplacementMapEffect.h
index 0a658aceaf..a5296fd6a7 100644
--- a/include/effects/SkDisplacementMapEffect.h
+++ b/include/effects/SkDisplacementMapEffect.h
@@ -54,9 +54,6 @@ protected:
SkScalar scale, SkImageFilter* inputs[2],
const CropRect* cropRect,
uint32_t uniqueID);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkDisplacementMapEffect(SkReadBuffer& buffer);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
private:
diff --git a/include/effects/SkDropShadowImageFilter.h b/include/effects/SkDropShadowImageFilter.h
index c6b936a23c..a931ad00ff 100644
--- a/include/effects/SkDropShadowImageFilter.h
+++ b/include/effects/SkDropShadowImageFilter.h
@@ -51,9 +51,6 @@ protected:
SkDropShadowImageFilter(SkScalar dx, SkScalar dy, SkScalar sigmaX, SkScalar sigmaY, SkColor,
ShadowMode shadowMode, SkImageFilter* input, const CropRect* cropRect,
uint32_t uniqueID);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkDropShadowImageFilter(SkReadBuffer&);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& source, const Context&, SkBitmap* result, SkIPoint* loc) const SK_OVERRIDE;
virtual bool onFilterBounds(const SkIRect& src, const SkMatrix&,
diff --git a/include/effects/SkEmbossMaskFilter.h b/include/effects/SkEmbossMaskFilter.h
index 74895fb0cf..8b6a3c3ac2 100644
--- a/include/effects/SkEmbossMaskFilter.h
+++ b/include/effects/SkEmbossMaskFilter.h
@@ -37,9 +37,6 @@ public:
protected:
SkEmbossMaskFilter(SkScalar blurSigma, const Light& light);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkEmbossMaskFilter(SkReadBuffer&);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
private:
diff --git a/include/effects/SkLayerDrawLooper.h b/include/effects/SkLayerDrawLooper.h
index 5bb8b6646b..d21e399762 100644
--- a/include/effects/SkLayerDrawLooper.h
+++ b/include/effects/SkLayerDrawLooper.h
@@ -81,14 +81,7 @@ public:
SK_TO_STRING_OVERRIDE()
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- static SkFlattenable* DeepCreateProc(SkReadBuffer& buffer) {
- return CreateProc(buffer);
- }
- virtual Factory getFactory() const SK_OVERRIDE { return DeepCreateProc; }
-#else
virtual Factory getFactory() const SK_OVERRIDE { return CreateProc; }
-#endif
static SkFlattenable* CreateProc(SkReadBuffer& buffer);
protected:
diff --git a/include/effects/SkLayerRasterizer.h b/include/effects/SkLayerRasterizer.h
index 60b3f205c3..1d66383ec9 100644
--- a/include/effects/SkLayerRasterizer.h
+++ b/include/effects/SkLayerRasterizer.h
@@ -69,9 +69,6 @@ public:
protected:
SkLayerRasterizer();
SkLayerRasterizer(SkDeque* layers);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- SkLayerRasterizer(SkReadBuffer&);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
// override from SkRasterizer
diff --git a/include/effects/SkLerpXfermode.h b/include/effects/SkLerpXfermode.h
index d779f16777..923e840c5d 100644
--- a/include/effects/SkLerpXfermode.h
+++ b/include/effects/SkLerpXfermode.h
@@ -32,9 +32,6 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLerpXfermode)
protected:
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- SkLerpXfermode(SkReadBuffer&);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
private:
diff --git a/include/effects/SkLightingImageFilter.h b/include/effects/SkLightingImageFilter.h
index 5fb0822666..323da88ec8 100644
--- a/include/effects/SkLightingImageFilter.h
+++ b/include/effects/SkLightingImageFilter.h
@@ -75,9 +75,6 @@ protected:
SkImageFilter* input,
const CropRect* cropRect,
uint32_t uniqueID);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkLightingImageFilter(SkReadBuffer& buffer);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
const SkLight* light() const { return fLight.get(); }
SkScalar surfaceScale() const { return fSurfaceScale; }
diff --git a/include/effects/SkLumaColorFilter.h b/include/effects/SkLumaColorFilter.h
index 420999f2e8..ae666c0bca 100644
--- a/include/effects/SkLumaColorFilter.h
+++ b/include/effects/SkLumaColorFilter.h
@@ -35,9 +35,6 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLumaColorFilter)
protected:
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- SkLumaColorFilter(SkReadBuffer& buffer);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
private:
diff --git a/include/effects/SkMagnifierImageFilter.h b/include/effects/SkMagnifierImageFilter.h
index 4dd47ef7bd..68c3fdfee4 100644
--- a/include/effects/SkMagnifierImageFilter.h
+++ b/include/effects/SkMagnifierImageFilter.h
@@ -20,9 +20,6 @@ public:
protected:
SkMagnifierImageFilter(const SkRect& srcRect, SkScalar inset, SkImageFilter* input);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkMagnifierImageFilter(SkReadBuffer& buffer);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
diff --git a/include/effects/SkMatrixConvolutionImageFilter.h b/include/effects/SkMatrixConvolutionImageFilter.h
index c04d7d1568..b97dabe269 100644
--- a/include/effects/SkMatrixConvolutionImageFilter.h
+++ b/include/effects/SkMatrixConvolutionImageFilter.h
@@ -76,9 +76,6 @@ protected:
SkImageFilter* input,
const CropRect* cropRect,
uint32_t uniqueID);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkMatrixConvolutionImageFilter(SkReadBuffer& buffer);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
diff --git a/include/effects/SkMatrixImageFilter.h b/include/effects/SkMatrixImageFilter.h
index ae6a0b7abb..0063e41630 100644
--- a/include/effects/SkMatrixImageFilter.h
+++ b/include/effects/SkMatrixImageFilter.h
@@ -43,9 +43,6 @@ protected:
SkPaint::FilterLevel,
SkImageFilter* input,
uint32_t uniqueID);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- SkMatrixImageFilter(SkReadBuffer& buffer);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
diff --git a/include/effects/SkMergeImageFilter.h b/include/effects/SkMergeImageFilter.h
index 5e723aa290..59183e3fc1 100644
--- a/include/effects/SkMergeImageFilter.h
+++ b/include/effects/SkMergeImageFilter.h
@@ -38,9 +38,6 @@ protected:
const SkXfermode::Mode modes[],
const CropRect* cropRect,
uint32_t uniqueID);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkMergeImageFilter(SkReadBuffer& buffer);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
diff --git a/include/effects/SkMorphologyImageFilter.h b/include/effects/SkMorphologyImageFilter.h
index 3f2be45cc5..ff7ed89d43 100644
--- a/include/effects/SkMorphologyImageFilter.h
+++ b/include/effects/SkMorphologyImageFilter.h
@@ -34,9 +34,6 @@ protected:
bool filterImageGeneric(Proc procX, Proc procY,
Proxy*, const SkBitmap& src, const Context&,
SkBitmap* result, SkIPoint* offset) const;
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- SkMorphologyImageFilter(SkReadBuffer& buffer);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
#if SK_SUPPORT_GPU
virtual bool canFilterImageGPU() const SK_OVERRIDE { return true; }
@@ -76,10 +73,6 @@ public:
protected:
SkDilateImageFilter(int radiusX, int radiusY, SkImageFilter* input, const CropRect* cropRect, uint32_t uniqueID)
: INHERITED(radiusX, radiusY, input, cropRect, uniqueID) {}
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkDilateImageFilter(SkReadBuffer& buffer) : INHERITED(buffer) {}
-#endif
-
private:
typedef SkMorphologyImageFilter INHERITED;
};
@@ -108,9 +101,6 @@ public:
protected:
SkErodeImageFilter(int radiusX, int radiusY, SkImageFilter* input, const CropRect* cropRect, uint32_t uniqueID)
: INHERITED(radiusX, radiusY, input, cropRect, uniqueID) {}
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkErodeImageFilter(SkReadBuffer& buffer) : INHERITED(buffer) {}
-#endif
private:
typedef SkMorphologyImageFilter INHERITED;
diff --git a/include/effects/SkOffsetImageFilter.h b/include/effects/SkOffsetImageFilter.h
index a870c0b8ee..6a60e62bda 100644
--- a/include/effects/SkOffsetImageFilter.h
+++ b/include/effects/SkOffsetImageFilter.h
@@ -28,9 +28,6 @@ public:
protected:
SkOffsetImageFilter(SkScalar dx, SkScalar dy, SkImageFilter* input, const CropRect* cropRect, uint32_t uniqueID);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkOffsetImageFilter(SkReadBuffer& buffer);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
diff --git a/include/effects/SkPerlinNoiseShader.h b/include/effects/SkPerlinNoiseShader.h
index 2937926cd7..fc6748462c 100644
--- a/include/effects/SkPerlinNoiseShader.h
+++ b/include/effects/SkPerlinNoiseShader.h
@@ -103,9 +103,6 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPerlinNoiseShader)
protected:
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- SkPerlinNoiseShader(SkReadBuffer&);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual Context* onCreateContext(const ContextRec&, void* storage) const SK_OVERRIDE;
@@ -115,16 +112,13 @@ private:
const SkISize* tileSize);
virtual ~SkPerlinNoiseShader();
- // TODO (scroggo): Once all SkShaders are created from a factory, and we have removed the
- // constructor that creates SkPerlinNoiseShader from an SkReadBuffer, several fields can
- // be made constant.
- /*const*/ SkPerlinNoiseShader::Type fType;
- /*const*/ SkScalar fBaseFrequencyX;
- /*const*/ SkScalar fBaseFrequencyY;
- /*const*/ int fNumOctaves;
- /*const*/ SkScalar fSeed;
- /*const*/ SkISize fTileSize;
- /*const*/ bool fStitchTiles;
+ const SkPerlinNoiseShader::Type fType;
+ const SkScalar fBaseFrequencyX;
+ const SkScalar fBaseFrequencyY;
+ const int fNumOctaves;
+ const SkScalar fSeed;
+ const SkISize fTileSize;
+ const bool fStitchTiles;
typedef SkShader INHERITED;
};
diff --git a/include/effects/SkPictureImageFilter.h b/include/effects/SkPictureImageFilter.h
index ed5c63c18a..f4f1fff4ef 100644
--- a/include/effects/SkPictureImageFilter.h
+++ b/include/effects/SkPictureImageFilter.h
@@ -40,9 +40,6 @@ protected:
* SkReadBuffer::setBitmapDecoder() before calling this constructor.
* @param SkReadBuffer Serialized picture data.
*/
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkPictureImageFilter(SkReadBuffer&);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE;
diff --git a/include/effects/SkPixelXorXfermode.h b/include/effects/SkPixelXorXfermode.h
index eb485b4652..758a5e9815 100644
--- a/include/effects/SkPixelXorXfermode.h
+++ b/include/effects/SkPixelXorXfermode.h
@@ -26,9 +26,6 @@ public:
protected:
explicit SkPixelXorXfermode(SkColor opColor) : fOpColor(opColor) {}
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkPixelXorXfermode(SkReadBuffer& rb);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
// override from SkXfermode
diff --git a/include/effects/SkRectShaderImageFilter.h b/include/effects/SkRectShaderImageFilter.h
index c4311db43e..dc35c947ba 100644
--- a/include/effects/SkRectShaderImageFilter.h
+++ b/include/effects/SkRectShaderImageFilter.h
@@ -34,9 +34,6 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkRectShaderImageFilter)
protected:
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- SkRectShaderImageFilter(SkReadBuffer& buffer);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
diff --git a/include/effects/SkTableMaskFilter.h b/include/effects/SkTableMaskFilter.h
index 8b9417900e..ec071d0e6a 100644
--- a/include/effects/SkTableMaskFilter.h
+++ b/include/effects/SkTableMaskFilter.h
@@ -55,9 +55,6 @@ public:
protected:
SkTableMaskFilter();
explicit SkTableMaskFilter(const uint8_t table[256]);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkTableMaskFilter(SkReadBuffer& rb);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
private:
diff --git a/include/effects/SkTestImageFilters.h b/include/effects/SkTestImageFilters.h
index a8186e08c2..6acd1d293c 100644
--- a/include/effects/SkTestImageFilters.h
+++ b/include/effects/SkTestImageFilters.h
@@ -23,9 +23,6 @@ public:
protected:
SkDownSampleImageFilter(SkScalar scale, SkImageFilter* input)
: INHERITED(1, &input), fScale(scale) {}
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- SkDownSampleImageFilter(SkReadBuffer& buffer);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
diff --git a/include/effects/SkTileImageFilter.h b/include/effects/SkTileImageFilter.h
index 440337a642..49d69a0ebf 100644
--- a/include/effects/SkTileImageFilter.h
+++ b/include/effects/SkTileImageFilter.h
@@ -32,9 +32,6 @@ public:
protected:
SkTileImageFilter(const SkRect& srcRect, const SkRect& dstRect, SkImageFilter* input, uint32_t uniqueID)
: INHERITED(1, &input, NULL, uniqueID), fSrcRect(srcRect), fDstRect(dstRect) {}
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkTileImageFilter(SkReadBuffer& buffer);
-#endif
virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE;
diff --git a/include/effects/SkTransparentShader.h b/include/effects/SkTransparentShader.h
index e23687c021..96de80abe5 100644
--- a/include/effects/SkTransparentShader.h
+++ b/include/effects/SkTransparentShader.h
@@ -41,10 +41,6 @@ protected:
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE {}
private:
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- SkTransparentShader(SkReadBuffer& buffer) : INHERITED(buffer) {}
-#endif
-
typedef SkShader INHERITED;
};
diff --git a/include/effects/SkXfermodeImageFilter.h b/include/effects/SkXfermodeImageFilter.h
index 6736889ac8..96d258fd08 100644
--- a/include/effects/SkXfermodeImageFilter.h
+++ b/include/effects/SkXfermodeImageFilter.h
@@ -47,9 +47,6 @@ public:
protected:
SkXfermodeImageFilter(SkXfermode* mode, SkImageFilter* inputs[2],
const CropRect* cropRect, uint32_t uniqueID);
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit SkXfermodeImageFilter(SkReadBuffer& buffer);
-#endif
virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
private:
diff --git a/samplecode/ClockFaceView.cpp b/samplecode/ClockFaceView.cpp
index 46d4120c9b..4ba65bd894 100644
--- a/samplecode/ClockFaceView.cpp
+++ b/samplecode/ClockFaceView.cpp
@@ -90,13 +90,6 @@ protected:
dst->addCircle(loc.fX, loc.fY, fRadius);
}
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- Dot2DPathEffect(SkReadBuffer& buffer) : INHERITED(buffer) {
- fRadius = buffer.readScalar();
- fPts = NULL;
- }
-#endif
-
virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE {
buffer.writeMatrix(this->getMatrix());
buffer.writeScalar(fRadius);
@@ -126,13 +119,7 @@ public:
}
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(InverseFillPE)
-protected:
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- InverseFillPE(SkReadBuffer& buffer) : INHERITED(buffer) {}
-#endif
-
private:
-
typedef SkPathEffect INHERITED;
};
diff --git a/samplecode/SampleAll.cpp b/samplecode/SampleAll.cpp
index 19e692f518..f5a7c143f4 100644
--- a/samplecode/SampleAll.cpp
+++ b/samplecode/SampleAll.cpp
@@ -172,11 +172,6 @@ protected:
dst->addCircle(loc.fX, loc.fY, fRadius);
}
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- Dot2DPathEffect(SkReadBuffer& buffer) : INHERITED(buffer) {
- fRadius = buffer.readScalar();
- }
-#endif
virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE {
this->INHERITED::flatten(buffer);
buffer.writeScalar(fRadius);
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;
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index 6fefe49dcb..9fd4351b42 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -58,13 +58,6 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(MatrixTestImageFilter)
protected:
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit MatrixTestImageFilter(SkReadBuffer& buffer) : SkImageFilter(0, NULL) {
- fReporter = static_cast<skiatest::Reporter*>(buffer.readFunctionPtr());
- buffer.readMatrix(&fExpectedMatrix);
- }
-#endif
-
virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE {
this->INHERITED::flatten(buffer);
buffer.writeFunctionPtr(fReporter);
@@ -74,7 +67,7 @@ protected:
private:
skiatest::Reporter* fReporter;
SkMatrix fExpectedMatrix;
-
+
typedef SkImageFilter INHERITED;
};
@@ -487,7 +480,7 @@ DEF_TEST(ImageFilterDrawTiled, reporter) {
}
}
-static void draw_saveLayer_picture(int width, int height, int tileSize,
+static void draw_saveLayer_picture(int width, int height, int tileSize,
SkBBHFactory* factory, SkBitmap* result) {
SkMatrix matrix;
@@ -501,8 +494,8 @@ static void draw_saveLayer_picture(int width, int height, int tileSize,
paint.setImageFilter(imageFilter.get());
SkPictureRecorder recorder;
SkRect bounds = SkRect::Make(SkIRect::MakeXYWH(0, 0, 50, 50));
- SkCanvas* recordingCanvas = recorder.beginRecording(SkIntToScalar(width),
- SkIntToScalar(height),
+ SkCanvas* recordingCanvas = recorder.beginRecording(SkIntToScalar(width),
+ SkIntToScalar(height),
factory, 0);
recordingCanvas->translate(-55, 0);
recordingCanvas->saveLayer(&bounds, &paint);
@@ -625,11 +618,11 @@ DEF_TEST(ImageFilterDrawTiledBlurRTree, reporter) {
SkPictureRecorder recorder1, recorder2;
// The only difference between these two pictures is that one has RTree aceleration.
- SkCanvas* recordingCanvas1 = recorder1.beginRecording(SkIntToScalar(width),
- SkIntToScalar(height),
+ SkCanvas* recordingCanvas1 = recorder1.beginRecording(SkIntToScalar(width),
+ SkIntToScalar(height),
NULL, 0);
- SkCanvas* recordingCanvas2 = recorder2.beginRecording(SkIntToScalar(width),
- SkIntToScalar(height),
+ SkCanvas* recordingCanvas2 = recorder2.beginRecording(SkIntToScalar(width),
+ SkIntToScalar(height),
&factory, 0);
draw_blurred_rect(recordingCanvas1);
draw_blurred_rect(recordingCanvas2);
diff --git a/tests/PDFPrimitivesTest.cpp b/tests/PDFPrimitivesTest.cpp
index 05677cd1ab..60a1099136 100644
--- a/tests/PDFPrimitivesTest.cpp
+++ b/tests/PDFPrimitivesTest.cpp
@@ -444,11 +444,6 @@ public:
return true;
}
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(DummyImageFilter)
-#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
- explicit DummyImageFilter(SkReadBuffer& buffer) : SkImageFilter(0, NULL) {
- fVisited = buffer.readBool();
- }
-#endif
bool visited() const { return fVisited; }
private: