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:

Review URL: https://codereview.chromium.org/769953002
This commit is contained in:
mtklein 2014-12-01 10:23:11 -08:00 committed by Commit bot
parent 01d6e5f462
commit 52c293547b
115 changed files with 38 additions and 1050 deletions

View File

@ -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;
};

View File

@ -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);

View File

@ -135,9 +135,6 @@ public:
protected:
SkColorFilter() {}
#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
SkColorFilter(SkReadBuffer& rb) : INHERITED(rb) {}
#endif
private:
typedef SkFlattenable INHERITED;

View File

@ -114,9 +114,6 @@ public:
protected:
SkDrawLooper() {}
#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
SkDrawLooper(SkReadBuffer& buffer) : INHERITED(buffer) {}
#endif
private:
typedef SkFlattenable INHERITED;

View File

@ -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;
}

View File

@ -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,

View File

@ -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&);

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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:

View File

@ -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&,

View File

@ -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;

View File

@ -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&,

View File

@ -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:

View File

@ -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&,

View File

@ -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:

View File

@ -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;

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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&,

View File

@ -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:

View File

@ -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:

View File

@ -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

View File

@ -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:

View File

@ -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; }

View File

@ -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:

View File

@ -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&,

View File

@ -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&,

View File

@ -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&,

View File

@ -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&,

View File

@ -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;

View File

@ -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&,

View File

@ -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;
};

View File

@ -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;

View File

@ -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

View File

@ -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&,

View File

@ -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:

View File

@ -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&,

View File

@ -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;

View File

@ -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;
};

View File

@ -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:

View File

@ -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;
};

View File

@ -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);

View File

@ -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 {

View File

@ -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;

View File

@ -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);
}

View File

@ -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();

View File

@ -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;
}

View File

@ -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();

View File

@ -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;

View File

@ -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) {
@ -56,8 +46,6 @@ void SkRefCntSet::decPtr(void* ptr) {
((SkRefCnt*)ptr)->unref();
}
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
#define MAX_ENTRY_COUNT 1024

View File

@ -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);

View File

@ -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;

View File

@ -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) {

View File

@ -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();
}

View File

@ -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()));
}

View File

@ -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;
};

View File

@ -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; }

View File

@ -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;
}

View File

@ -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);

View File

@ -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();

View File

@ -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]);

View File

@ -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();

View File

@ -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);

View File

@ -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();

View File

@ -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,

View File

@ -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();

View File

@ -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());

View File

@ -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());

View File

@ -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;

View File

@ -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)) {

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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();

View File

@ -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();

View File

@ -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))) {

View File

@ -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();

View File

@ -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);
}

View File

@ -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));

View File

@ -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);
}

View File

@ -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) {

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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,

View File

@ -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

View File

@ -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();

View File

@ -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;

View File

@ -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());
}

View File

@ -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());

View File

@ -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);
}

View File

@ -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) {

View File

@ -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

Some files were not shown because too many files have changed in this diff Show More