aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar senorblanco <senorblanco@chromium.org>2015-03-18 12:11:33 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-18 12:11:33 -0700
commit24e06d5244ae96e440410e1d76e039983b2efac9 (patch)
treea836fa9291bdcfd543cc25edc964527b77b91dba
parent6fbfdb1e5ebe42bf16d929082b43186c8183b063 (diff)
Remove uniqueID from all filter serialization.
(This is essentially a revert of https://codereview.chromium.org/503833002/.) This was necessary back when SkPaint was flattened even for in-process use. Now that we only flatten SkPaint for cross-process use, there's no need to serialize UniqueIDs. Note: SkDropShadowImageFilter is being constructed with a croprect and UniqueID (of 0) in Blink. I've made the uniqueID param default to 0 temporarily, until this rolls in and Blink can be changed. (Blink can't be changed first, since unlike the other filters, there's no constructor that takes a cropRect but not a uniqueID.) BUG=skia: Review URL: https://codereview.chromium.org/1019493002
-rw-r--r--bench/ImageFilterCollapse.cpp2
-rw-r--r--gm/dropshadowimagefilter.cpp6
-rw-r--r--gm/filterfastbounds.cpp4
-rw-r--r--gm/imagefilterscropexpand.cpp2
-rw-r--r--gm/tablecolorfilter.cpp4
-rw-r--r--include/core/SkImageFilter.h4
-rw-r--r--include/effects/SkBlurImageFilter.h7
-rw-r--r--include/effects/SkColorFilterImageFilter.h6
-rw-r--r--include/effects/SkDisplacementMapEffect.h6
-rw-r--r--include/effects/SkDropShadowImageFilter.h14
-rw-r--r--include/effects/SkLightingImageFilter.h3
-rw-r--r--include/effects/SkMatrixConvolutionImageFilter.h6
-rw-r--r--include/effects/SkMatrixImageFilter.h11
-rw-r--r--include/effects/SkMergeImageFilter.h13
-rw-r--r--include/effects/SkMorphologyImageFilter.h20
-rw-r--r--include/effects/SkOffsetImageFilter.h7
-rw-r--r--include/effects/SkPictureImageFilter.h23
-rw-r--r--include/effects/SkRectShaderImageFilter.h4
-rw-r--r--include/effects/SkTileImageFilter.h6
-rw-r--r--include/effects/SkXfermodeImageFilter.h7
-rw-r--r--samplecode/SampleFilterFuzz.cpp2
-rw-r--r--src/core/SkImageFilter.cpp16
-rw-r--r--src/effects/SkBlurImageFilter.cpp7
-rwxr-xr-xsrc/effects/SkColorFilterImageFilter.cpp12
-rw-r--r--src/effects/SkDisplacementMapEffect.cpp11
-rw-r--r--src/effects/SkDropShadowImageFilter.cpp6
-rw-r--r--src/effects/SkLightingImageFilter.cpp36
-rw-r--r--src/effects/SkMatrixConvolutionImageFilter.cpp12
-rw-r--r--src/effects/SkMatrixImageFilter.cpp12
-rwxr-xr-xsrc/effects/SkMergeImageFilter.cpp9
-rw-r--r--src/effects/SkMorphologyImageFilter.cpp9
-rw-r--r--src/effects/SkOffsetImageFilter.cpp6
-rw-r--r--src/effects/SkPictureImageFilter.cpp8
-rw-r--r--src/effects/SkRectShaderImageFilter.cpp11
-rw-r--r--src/effects/SkTileImageFilter.cpp6
-rw-r--r--src/effects/SkXfermodeImageFilter.cpp7
-rw-r--r--tests/ImageFilterTest.cpp4
37 files changed, 147 insertions, 182 deletions
diff --git a/bench/ImageFilterCollapse.cpp b/bench/ImageFilterCollapse.cpp
index 6cda6ac389..4e56c72f57 100644
--- a/bench/ImageFilterCollapse.cpp
+++ b/bench/ImageFilterCollapse.cpp
@@ -33,7 +33,7 @@ protected:
fImageFilter = NULL;
for(int i = nFilters; i --> 0;) {
SkAutoTUnref<SkImageFilter> filter(
- SkColorFilterImageFilter::Create(colorFilters[i], fImageFilter, NULL, 0)
+ SkColorFilterImageFilter::Create(colorFilters[i], fImageFilter, NULL)
);
SkRefCnt_SafeAssign(fImageFilter, filter.get());
}
diff --git a/gm/dropshadowimagefilter.cpp b/gm/dropshadowimagefilter.cpp
index f60f22c70f..e06264c9da 100644
--- a/gm/dropshadowimagefilter.cpp
+++ b/gm/dropshadowimagefilter.cpp
@@ -133,11 +133,11 @@ protected:
SkDropShadowImageFilter::Create(7.0f, 7.0f, 3.0f, 3.0f, SK_ColorBLUE,
SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode),
SkDropShadowImageFilter::Create(7.0f, 7.0f, 3.0f, 3.0f, SK_ColorBLUE,
- SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode, cfif, NULL, 0),
+ SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode, cfif, NULL),
SkDropShadowImageFilter::Create(7.0f, 7.0f, 3.0f, 3.0f, SK_ColorBLUE,
- SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode, NULL, &cropRect, 0),
+ SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode, NULL, &cropRect),
SkDropShadowImageFilter::Create(7.0f, 7.0f, 3.0f, 3.0f, SK_ColorBLUE,
- SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode, NULL, &bogusRect, 0),
+ SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode, NULL, &bogusRect),
SkDropShadowImageFilter::Create(7.0f, 7.0f, 3.0f, 3.0f, SK_ColorBLUE,
SkDropShadowImageFilter::kDrawShadowOnly_ShadowMode),
};
diff --git a/gm/filterfastbounds.cpp b/gm/filterfastbounds.cpp
index 6244001374..0ae7068503 100644
--- a/gm/filterfastbounds.cpp
+++ b/gm/filterfastbounds.cpp
@@ -117,7 +117,7 @@ static void create_paints(SkImageFilter* source, SkTArray<SkPaint>* paints) {
SkDropShadowImageFilter::Create(10.0f, 10.0f,
3.0f, 3.0f,
SK_ColorRED, kBoth,
- source, NULL, 0));
+ source, NULL));
add_paint(dsif, paints);
}
@@ -128,7 +128,7 @@ static void create_paints(SkImageFilter* source, SkTArray<SkPaint>* paints) {
3.0f, 3.0f,
SK_ColorRED,
SkDropShadowImageFilter::kDrawShadowOnly_ShadowMode,
- source, NULL, 0));
+ source, NULL));
add_paint(dsif, paints);
}
diff --git a/gm/imagefilterscropexpand.cpp b/gm/imagefilterscropexpand.cpp
index 7db41e0364..4fe746a1a1 100644
--- a/gm/imagefilterscropexpand.cpp
+++ b/gm/imagefilterscropexpand.cpp
@@ -143,7 +143,7 @@ protected:
draw(canvas, checkerboard, rect, SkDropShadowImageFilter::Create(
SkIntToScalar(10), SkIntToScalar(10), SkIntToScalar(3), SkIntToScalar(3),
SK_ColorBLUE, SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode,
- noop_cropped.get(), &big_rect, 0));
+ noop_cropped.get(), &big_rect));
draw(canvas, checkerboard, rect, SkDisplacementMapEffect::Create(
SkDisplacementMapEffect::kR_ChannelSelectorType,
diff --git a/gm/tablecolorfilter.cpp b/gm/tablecolorfilter.cpp
index 0d6da8f475..deba9e55e9 100644
--- a/gm/tablecolorfilter.cpp
+++ b/gm/tablecolorfilter.cpp
@@ -164,7 +164,7 @@ protected:
for (unsigned i = 0; i < SK_ARRAY_COUNT(gColorFilterMakers); ++i) {
SkAutoTUnref<SkColorFilter> colorFilter1(gColorFilterMakers[i]());
SkAutoTUnref<SkImageFilter> imageFilter1(SkColorFilterImageFilter::Create(
- colorFilter1, NULL, NULL, 0));
+ colorFilter1, NULL, NULL));
// Move down to the next line and draw it
// each draw being at xOffset of the previous one
@@ -173,7 +173,7 @@ protected:
for (unsigned j = 1; j < SK_ARRAY_COUNT(gColorFilterMakers); ++j) {
SkAutoTUnref<SkColorFilter> colorFilter2(gColorFilterMakers[j]());
SkAutoTUnref<SkImageFilter> imageFilter2(SkColorFilterImageFilter::Create(
- colorFilter2, imageFilter1, NULL, 0));
+ colorFilter2, imageFilter1, NULL));
paint.setImageFilter(imageFilter2);
canvas->drawBitmap(bm, x, y, &paint);
x += xOffset;
diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h
index cb18f7c615..b64a2957fd 100644
--- a/include/core/SkImageFilter.h
+++ b/include/core/SkImageFilter.h
@@ -228,7 +228,6 @@ protected:
const CropRect& cropRect() const { return fCropRect; }
int inputCount() const { return fInputs.count(); }
SkImageFilter** inputs() const { return fInputs.get(); }
- uint32_t uniqueID() const { return fUniqueID; }
SkImageFilter* getInput(int index) const { return fInputs[index]; }
@@ -242,12 +241,11 @@ protected:
CropRect fCropRect;
// most filters accept at most 2 input-filters
SkAutoSTArray<2, SkImageFilter*> fInputs;
- uint32_t fUniqueID;
void allocInputs(int count);
};
- SkImageFilter(int inputCount, SkImageFilter** inputs, const CropRect* cropRect = NULL, uint32_t uniqueID = 0);
+ SkImageFilter(int inputCount, SkImageFilter** inputs, const CropRect* cropRect = NULL);
virtual ~SkImageFilter();
diff --git a/include/effects/SkBlurImageFilter.h b/include/effects/SkBlurImageFilter.h
index d6b506621d..6f4537fed7 100644
--- a/include/effects/SkBlurImageFilter.h
+++ b/include/effects/SkBlurImageFilter.h
@@ -16,8 +16,8 @@ public:
static SkBlurImageFilter* Create(SkScalar sigmaX,
SkScalar sigmaY,
SkImageFilter* input = NULL,
- const CropRect* cropRect = NULL, uint32_t uniqueID = 0) {
- return SkNEW_ARGS(SkBlurImageFilter, (sigmaX, sigmaY, input, cropRect, uniqueID));
+ const CropRect* cropRect = NULL) {
+ return SkNEW_ARGS(SkBlurImageFilter, (sigmaX, sigmaY, input, cropRect));
}
void computeFastBounds(const SkRect&, SkRect*) const SK_OVERRIDE;
@@ -29,8 +29,7 @@ protected:
SkBlurImageFilter(SkScalar sigmaX,
SkScalar sigmaY,
SkImageFilter* input,
- const CropRect* cropRect,
- uint32_t uniqueID);
+ const CropRect* cropRect);
void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
diff --git a/include/effects/SkColorFilterImageFilter.h b/include/effects/SkColorFilterImageFilter.h
index c8b1661a95..7f775dbd68 100644
--- a/include/effects/SkColorFilterImageFilter.h
+++ b/include/effects/SkColorFilterImageFilter.h
@@ -16,8 +16,7 @@ class SK_API SkColorFilterImageFilter : public SkImageFilter {
public:
static SkColorFilterImageFilter* Create(SkColorFilter* cf,
SkImageFilter* input = NULL,
- const CropRect* cropRect = NULL,
- uint32_t uniqueID = 0);
+ const CropRect* cropRect = NULL);
virtual ~SkColorFilterImageFilter();
SK_TO_STRING_OVERRIDE()
@@ -34,8 +33,7 @@ protected:
private:
SkColorFilterImageFilter(SkColorFilter* cf,
SkImageFilter* input,
- const CropRect* cropRect,
- uint32_t uniqueID);
+ const CropRect* cropRect);
SkColorFilter* fColorFilter;
typedef SkImageFilter INHERITED;
diff --git a/include/effects/SkDisplacementMapEffect.h b/include/effects/SkDisplacementMapEffect.h
index e55b324ce9..b3fa8d5f00 100644
--- a/include/effects/SkDisplacementMapEffect.h
+++ b/include/effects/SkDisplacementMapEffect.h
@@ -27,8 +27,7 @@ public:
ChannelSelectorType yChannelSelector,
SkScalar scale, SkImageFilter* displacement,
SkImageFilter* color = NULL,
- const CropRect* cropRect = NULL,
- uint32_t uniqueID = 0);
+ const CropRect* cropRect = NULL);
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDisplacementMapEffect)
@@ -54,8 +53,7 @@ protected:
SkDisplacementMapEffect(ChannelSelectorType xChannelSelector,
ChannelSelectorType yChannelSelector,
SkScalar scale, SkImageFilter* inputs[2],
- const CropRect* cropRect,
- uint32_t uniqueID);
+ const CropRect* cropRect);
void flatten(SkWriteBuffer&) const SK_OVERRIDE;
private:
diff --git a/include/effects/SkDropShadowImageFilter.h b/include/effects/SkDropShadowImageFilter.h
index 5eb64094e2..759f65e476 100644
--- a/include/effects/SkDropShadowImageFilter.h
+++ b/include/effects/SkDropShadowImageFilter.h
@@ -24,11 +24,10 @@ public:
static SkDropShadowImageFilter* Create(SkScalar dx, SkScalar dy,
SkScalar sigmaX, SkScalar sigmaY, SkColor color,
SkImageFilter* input = NULL,
- const CropRect* cropRect = NULL,
- uint32_t uniqueID = 0) {
+ const CropRect* cropRect = NULL) {
return SkNEW_ARGS(SkDropShadowImageFilter, (dx, dy, sigmaX, sigmaY, color,
kDrawShadowAndForeground_ShadowMode,
- input, cropRect, uniqueID));
+ input, cropRect));
}
static SkDropShadowImageFilter* Create(SkScalar dx, SkScalar dy,
@@ -36,16 +35,16 @@ public:
ShadowMode shadowMode,
SkImageFilter* input,
const CropRect* cropRect,
- uint32_t uniqueID) {
+ uint32_t = 0) {
return SkNEW_ARGS(SkDropShadowImageFilter, (dx, dy, sigmaX, sigmaY, color,
- shadowMode, input, cropRect, uniqueID));
+ shadowMode, input, cropRect));
}
static SkDropShadowImageFilter* Create(SkScalar dx, SkScalar dy,
SkScalar sigmaX, SkScalar sigmaY, SkColor color,
ShadowMode shadowMode) {
return SkNEW_ARGS(SkDropShadowImageFilter, (dx, dy, sigmaX, sigmaY, color,
- shadowMode, NULL, NULL, 0));
+ shadowMode, NULL, NULL));
}
void computeFastBounds(const SkRect&, SkRect*) const SK_OVERRIDE;
@@ -54,8 +53,7 @@ public:
protected:
SkDropShadowImageFilter(SkScalar dx, SkScalar dy, SkScalar sigmaX, SkScalar sigmaY, SkColor,
- ShadowMode shadowMode, SkImageFilter* input, const CropRect* cropRect,
- uint32_t uniqueID);
+ ShadowMode shadowMode, SkImageFilter* input, const CropRect* cropRect);
void flatten(SkWriteBuffer&) const SK_OVERRIDE;
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/SkLightingImageFilter.h b/include/effects/SkLightingImageFilter.h
index d06af93cf7..e0f78a8d38 100644
--- a/include/effects/SkLightingImageFilter.h
+++ b/include/effects/SkLightingImageFilter.h
@@ -73,8 +73,7 @@ protected:
SkLightingImageFilter(SkLight* light,
SkScalar surfaceScale,
SkImageFilter* input,
- const CropRect* cropRect,
- uint32_t uniqueID);
+ const CropRect* cropRect);
void flatten(SkWriteBuffer&) const SK_OVERRIDE;
const SkLight* light() const { return fLight.get(); }
SkScalar surfaceScale() const { return fSurfaceScale; }
diff --git a/include/effects/SkMatrixConvolutionImageFilter.h b/include/effects/SkMatrixConvolutionImageFilter.h
index 327f98f139..ddb421f011 100644
--- a/include/effects/SkMatrixConvolutionImageFilter.h
+++ b/include/effects/SkMatrixConvolutionImageFilter.h
@@ -60,8 +60,7 @@ public:
TileMode tileMode,
bool convolveAlpha,
SkImageFilter* input = NULL,
- const CropRect* cropRect = NULL,
- uint32_t uniqueID = 0);
+ const CropRect* cropRect = NULL);
SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMatrixConvolutionImageFilter)
@@ -75,8 +74,7 @@ protected:
TileMode tileMode,
bool convolveAlpha,
SkImageFilter* input,
- const CropRect* cropRect,
- uint32_t uniqueID);
+ const CropRect* cropRect);
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 d0afdc3bd9..2c11aa63a3 100644
--- a/include/effects/SkMatrixImageFilter.h
+++ b/include/effects/SkMatrixImageFilter.h
@@ -30,14 +30,12 @@ public:
static SkMatrixImageFilter* Create(const SkMatrix& transform,
SkFilterQuality,
- SkImageFilter* input = NULL,
- uint32_t uniqueID = 0);
+ SkImageFilter* input = NULL);
#ifdef SK_SUPPORT_LEGACY_FILTERLEVEL_ENUM
static SkMatrixImageFilter* Create(const SkMatrix& transform,
SkPaint::FilterLevel level,
- SkImageFilter* input = NULL,
- uint32_t uniqueID = 0) {
- return Create(transform, SkFilterQuality(level), input, uniqueID);
+ SkImageFilter* input = NULL) {
+ return Create(transform, SkFilterQuality(level), input);
}
#endif
virtual ~SkMatrixImageFilter();
@@ -50,8 +48,7 @@ public:
protected:
SkMatrixImageFilter(const SkMatrix& transform,
SkFilterQuality,
- SkImageFilter* input,
- uint32_t uniqueID);
+ SkImageFilter* input);
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 ba2849b778..52ff9d7776 100644
--- a/include/effects/SkMergeImageFilter.h
+++ b/include/effects/SkMergeImageFilter.h
@@ -18,17 +18,15 @@ public:
static SkMergeImageFilter* Create(SkImageFilter* first, SkImageFilter* second,
SkXfermode::Mode mode = SkXfermode::kSrcOver_Mode,
- const CropRect* cropRect = NULL,
- uint32_t uniqueID = 0) {
+ const CropRect* cropRect = NULL) {
SkImageFilter* inputs[2] = { first, second };
SkXfermode::Mode modes[2] = { mode, mode };
- return SkNEW_ARGS(SkMergeImageFilter, (inputs, 2, modes, cropRect, uniqueID));
+ return SkNEW_ARGS(SkMergeImageFilter, (inputs, 2, modes, cropRect));
}
static SkMergeImageFilter* Create(SkImageFilter* filters[], int count,
const SkXfermode::Mode modes[] = NULL,
- const CropRect* cropRect = NULL,
- uint32_t uniqueID = 0) {
- return SkNEW_ARGS(SkMergeImageFilter, (filters, count, modes, cropRect, uniqueID));
+ const CropRect* cropRect = NULL) {
+ return SkNEW_ARGS(SkMergeImageFilter, (filters, count, modes, cropRect));
}
SK_TO_STRING_OVERRIDE()
@@ -37,8 +35,7 @@ public:
protected:
SkMergeImageFilter(SkImageFilter* filters[], int count,
const SkXfermode::Mode modes[],
- const CropRect* cropRect,
- uint32_t uniqueID);
+ const CropRect* cropRect);
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 901955bee6..c5c5c7401e 100644
--- a/include/effects/SkMorphologyImageFilter.h
+++ b/include/effects/SkMorphologyImageFilter.h
@@ -30,7 +30,7 @@ public:
protected:
SkMorphologyImageFilter(int radiusX, int radiusY, SkImageFilter* input,
- const CropRect* cropRect, uint32_t uniqueID);
+ const CropRect* cropRect);
bool filterImageGeneric(Proc procX, Proc procY,
Proxy*, const SkBitmap& src, const Context&,
SkBitmap* result, SkIPoint* offset) const;
@@ -53,12 +53,11 @@ class SK_API SkDilateImageFilter : public SkMorphologyImageFilter {
public:
static SkDilateImageFilter* Create(int radiusX, int radiusY,
SkImageFilter* input = NULL,
- const CropRect* cropRect = NULL,
- uint32_t uniqueID = 0) {
+ const CropRect* cropRect = NULL) {
if (radiusX < 0 || radiusY < 0) {
return NULL;
}
- return SkNEW_ARGS(SkDilateImageFilter, (radiusX, radiusY, input, cropRect, uniqueID));
+ return SkNEW_ARGS(SkDilateImageFilter, (radiusX, radiusY, input, cropRect));
}
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
@@ -72,8 +71,8 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDilateImageFilter)
protected:
- SkDilateImageFilter(int radiusX, int radiusY, SkImageFilter* input, const CropRect* cropRect, uint32_t uniqueID)
- : INHERITED(radiusX, radiusY, input, cropRect, uniqueID) {}
+ SkDilateImageFilter(int radiusX, int radiusY, SkImageFilter* input, const CropRect* cropRect)
+ : INHERITED(radiusX, radiusY, input, cropRect) {}
private:
typedef SkMorphologyImageFilter INHERITED;
};
@@ -82,12 +81,11 @@ class SK_API SkErodeImageFilter : public SkMorphologyImageFilter {
public:
static SkErodeImageFilter* Create(int radiusX, int radiusY,
SkImageFilter* input = NULL,
- const CropRect* cropRect = NULL,
- uint32_t uniqueID = 0) {
+ const CropRect* cropRect = NULL) {
if (radiusX < 0 || radiusY < 0) {
return NULL;
}
- return SkNEW_ARGS(SkErodeImageFilter, (radiusX, radiusY, input, cropRect, uniqueID));
+ return SkNEW_ARGS(SkErodeImageFilter, (radiusX, radiusY, input, cropRect));
}
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
@@ -101,8 +99,8 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkErodeImageFilter)
protected:
- SkErodeImageFilter(int radiusX, int radiusY, SkImageFilter* input, const CropRect* cropRect, uint32_t uniqueID)
- : INHERITED(radiusX, radiusY, input, cropRect, uniqueID) {}
+ SkErodeImageFilter(int radiusX, int radiusY, SkImageFilter* input, const CropRect* cropRect)
+ : INHERITED(radiusX, radiusY, input, cropRect) {}
private:
typedef SkMorphologyImageFilter INHERITED;
diff --git a/include/effects/SkOffsetImageFilter.h b/include/effects/SkOffsetImageFilter.h
index ed2878a212..818869171a 100644
--- a/include/effects/SkOffsetImageFilter.h
+++ b/include/effects/SkOffsetImageFilter.h
@@ -16,19 +16,18 @@ class SK_API SkOffsetImageFilter : public SkImageFilter {
public:
static SkOffsetImageFilter* Create(SkScalar dx, SkScalar dy, SkImageFilter* input = NULL,
- const CropRect* cropRect = NULL,
- uint32_t uniqueID = 0) {
+ const CropRect* cropRect = NULL) {
if (!SkScalarIsFinite(dx) || !SkScalarIsFinite(dy)) {
return NULL;
}
- return SkNEW_ARGS(SkOffsetImageFilter, (dx, dy, input, cropRect, uniqueID));
+ return SkNEW_ARGS(SkOffsetImageFilter, (dx, dy, input, cropRect));
}
void computeFastBounds(const SkRect& src, SkRect* dst) const SK_OVERRIDE;
SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkOffsetImageFilter)
protected:
- SkOffsetImageFilter(SkScalar dx, SkScalar dy, SkImageFilter* input, const CropRect* cropRect, uint32_t uniqueID);
+ SkOffsetImageFilter(SkScalar dx, SkScalar dy, SkImageFilter* input, const CropRect* cropRect);
void flatten(SkWriteBuffer&) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
diff --git a/include/effects/SkPictureImageFilter.h b/include/effects/SkPictureImageFilter.h
index 332663f730..21d25c4693 100644
--- a/include/effects/SkPictureImageFilter.h
+++ b/include/effects/SkPictureImageFilter.h
@@ -16,17 +16,16 @@ public:
/**
* Refs the passed-in picture.
*/
- static SkPictureImageFilter* Create(const SkPicture* picture, int32_t uniqueID = 0) {
- return SkNEW_ARGS(SkPictureImageFilter, (picture, uniqueID));
+ static SkPictureImageFilter* Create(const SkPicture* picture) {
+ return SkNEW_ARGS(SkPictureImageFilter, (picture));
}
/**
* Refs the passed-in picture. cropRect can be used to crop or expand the destination rect when
* the picture is drawn. (No scaling is implied by the dest rect; only the CTM is applied.)
*/
- static SkPictureImageFilter* Create(const SkPicture* picture, const SkRect& cropRect,
- uint32_t uniqueID = 0) {
- return SkNEW_ARGS(SkPictureImageFilter, (picture, cropRect, uniqueID,
+ static SkPictureImageFilter* Create(const SkPicture* picture, const SkRect& cropRect) {
+ return SkNEW_ARGS(SkPictureImageFilter, (picture, cropRect,
kDeviceSpace_PictureResolution,
kLow_SkFilterQuality));
}
@@ -40,17 +39,15 @@ public:
*/
static SkPictureImageFilter* CreateForLocalSpace(const SkPicture* picture,
const SkRect& cropRect,
- SkFilterQuality filterQuality,
- uint32_t uniqueID = 0) {
- return SkNEW_ARGS(SkPictureImageFilter, (picture, cropRect, uniqueID,
+ SkFilterQuality filterQuality) {
+ return SkNEW_ARGS(SkPictureImageFilter, (picture, cropRect,
kLocalSpace_PictureResolution, filterQuality));
}
#ifdef SK_SUPPORT_LEGACY_FILTERLEVEL_ENUM
static SkPictureImageFilter* CreateForLocalSpace(const SkPicture* picture,
const SkRect& cropRect,
- SkPaint::FilterLevel filterLevel,
- uint32_t uniqueID = 0) {
- return CreateForLocalSpace(picture, cropRect, (SkFilterQuality)filterLevel, uniqueID);
+ SkPaint::FilterLevel filterLevel) {
+ return CreateForLocalSpace(picture, cropRect, (SkFilterQuality)filterLevel);
}
#endif
SK_TO_STRING_OVERRIDE()
@@ -62,8 +59,8 @@ protected:
kLocalSpace_PictureResolution
};
- explicit SkPictureImageFilter(const SkPicture* picture, uint32_t uniqueID);
- SkPictureImageFilter(const SkPicture* picture, const SkRect& cropRect, uint32_t uniqueID,
+ explicit SkPictureImageFilter(const SkPicture* picture);
+ SkPictureImageFilter(const SkPicture* picture, const SkRect& cropRect,
PictureResolution, SkFilterQuality);
virtual ~SkPictureImageFilter();
/* Constructs an SkPictureImageFilter object from an SkReadBuffer.
diff --git a/include/effects/SkRectShaderImageFilter.h b/include/effects/SkRectShaderImageFilter.h
index a2d42b34b4..6228736fa1 100644
--- a/include/effects/SkRectShaderImageFilter.h
+++ b/include/effects/SkRectShaderImageFilter.h
@@ -28,7 +28,7 @@ public:
SK_ATTR_DEPRECATED("use Create(SkShader*, const CropRect*)")
static SkRectShaderImageFilter* Create(SkShader* s, const SkRect& rect);
- static SkRectShaderImageFilter* Create(SkShader* s, const CropRect* rect = NULL, uint32_t uniqueID = 0);
+ static SkRectShaderImageFilter* Create(SkShader* s, const CropRect* rect = NULL);
virtual ~SkRectShaderImageFilter();
SK_TO_STRING_OVERRIDE()
@@ -41,7 +41,7 @@ protected:
SkBitmap* result, SkIPoint* loc) const SK_OVERRIDE;
private:
- SkRectShaderImageFilter(SkShader* s, const CropRect* rect, uint32_t uniqueID = 0);
+ SkRectShaderImageFilter(SkShader* s, const CropRect* rect);
SkShader* fShader;
typedef SkImageFilter INHERITED;
diff --git a/include/effects/SkTileImageFilter.h b/include/effects/SkTileImageFilter.h
index 82673d65e0..95b4c75282 100644
--- a/include/effects/SkTileImageFilter.h
+++ b/include/effects/SkTileImageFilter.h
@@ -20,7 +20,7 @@ public:
@param input Input from which the subregion defined by srcRect will be tiled
*/
static SkTileImageFilter* Create(const SkRect& srcRect, const SkRect& dstRect,
- SkImageFilter* input, uint32_t uniqueID = 0);
+ SkImageFilter* input);
virtual bool onFilterImage(Proxy* proxy, const SkBitmap& src, const Context& ctx,
SkBitmap* dst, SkIPoint* offset) const SK_OVERRIDE;
@@ -31,8 +31,8 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTileImageFilter)
protected:
- SkTileImageFilter(const SkRect& srcRect, const SkRect& dstRect, SkImageFilter* input, uint32_t uniqueID)
- : INHERITED(1, &input, NULL, uniqueID), fSrcRect(srcRect), fDstRect(dstRect) {}
+ SkTileImageFilter(const SkRect& srcRect, const SkRect& dstRect, SkImageFilter* input)
+ : INHERITED(1, &input, NULL), fSrcRect(srcRect), fDstRect(dstRect) {}
void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE;
diff --git a/include/effects/SkXfermodeImageFilter.h b/include/effects/SkXfermodeImageFilter.h
index 47c44b87e1..66df053ba7 100644
--- a/include/effects/SkXfermodeImageFilter.h
+++ b/include/effects/SkXfermodeImageFilter.h
@@ -25,10 +25,9 @@ public:
static SkXfermodeImageFilter* Create(SkXfermode* mode, SkImageFilter* background,
SkImageFilter* foreground = NULL,
- const CropRect* cropRect = NULL,
- uint32_t uniqueID = 0) {
+ const CropRect* cropRect = NULL) {
SkImageFilter* inputs[2] = { background, foreground };
- return SkNEW_ARGS(SkXfermodeImageFilter, (mode, inputs, cropRect, uniqueID));
+ return SkNEW_ARGS(SkXfermodeImageFilter, (mode, inputs, cropRect));
}
SK_TO_STRING_OVERRIDE()
@@ -47,7 +46,7 @@ public:
protected:
SkXfermodeImageFilter(SkXfermode* mode, SkImageFilter* inputs[2],
- const CropRect* cropRect, uint32_t uniqueID);
+ const CropRect* cropRect);
void flatten(SkWriteBuffer&) const SK_OVERRIDE;
private:
diff --git a/samplecode/SampleFilterFuzz.cpp b/samplecode/SampleFilterFuzz.cpp
index b2c15aa7c4..77ae0d898f 100644
--- a/samplecode/SampleFilterFuzz.cpp
+++ b/samplecode/SampleFilterFuzz.cpp
@@ -380,7 +380,7 @@ static SkImageFilter* make_image_filter(bool canBeNull = true) {
case DROP_SHADOW:
filter = SkDropShadowImageFilter::Create(make_scalar(), make_scalar(), make_scalar(true),
make_scalar(true), make_color(), make_shadow_mode(), make_image_filter(),
- NULL, 0);
+ NULL);
break;
case MORPHOLOGY:
if (R(2) == 1) {
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 2837b7c84e..0cb954ceff 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -100,18 +100,20 @@ bool SkImageFilter::Common::unflatten(SkReadBuffer& buffer, int expectedCount) {
uint32_t flags = buffer.readUInt();
fCropRect = CropRect(rect, flags);
- fUniqueID = buffer.readUInt();
+ // FIXME: this is now unused; and should be made conditional on the next SkPicture version bump.
+ // See skbug.com/3559.
+ (void) buffer.readUInt();
return buffer.isValid();
}
///////////////////////////////////////////////////////////////////////////////////////////////////
-SkImageFilter::SkImageFilter(int inputCount, SkImageFilter** inputs, const CropRect* cropRect, uint32_t uniqueID)
+SkImageFilter::SkImageFilter(int inputCount, SkImageFilter** inputs, const CropRect* cropRect)
: fInputCount(inputCount),
fInputs(new SkImageFilter*[inputCount]),
fUsesSrcInput(false),
fCropRect(cropRect ? *cropRect : CropRect(SkRect(), 0x0)),
- fUniqueID(uniqueID ? uniqueID : next_image_filter_unique_id()) {
+ fUniqueID(next_image_filter_unique_id()) {
for (int i = 0; i < inputCount; ++i) {
if (NULL == inputs[i] || inputs[i]->usesSrcInput()) {
fUsesSrcInput = true;
@@ -129,7 +131,8 @@ SkImageFilter::~SkImageFilter() {
}
SkImageFilter::SkImageFilter(int inputCount, SkReadBuffer& buffer)
- : fUsesSrcInput(false) {
+ : fUsesSrcInput(false)
+ , fUniqueID(next_image_filter_unique_id()) {
Common common;
if (common.unflatten(buffer, inputCount)) {
fCropRect = common.cropRect();
@@ -141,7 +144,6 @@ SkImageFilter::SkImageFilter(int inputCount, SkReadBuffer& buffer)
fUsesSrcInput = true;
}
}
- fUniqueID = buffer.isCrossProcess() ? next_image_filter_unique_id() : common.uniqueID();
} else {
fInputCount = 0;
fInputs = NULL;
@@ -159,7 +161,9 @@ void SkImageFilter::flatten(SkWriteBuffer& buffer) const {
}
buffer.writeRect(fCropRect.rect());
buffer.writeUInt(fCropRect.flags());
- buffer.writeUInt(fUniqueID);
+ // FIXME: this is now unused; and should be removed on the next SkPicture version bump.
+ // See skbug.com/3559.
+ buffer.writeUInt(0);
}
bool SkImageFilter::filterImage(Proxy* proxy, const SkBitmap& src,
diff --git a/src/effects/SkBlurImageFilter.cpp b/src/effects/SkBlurImageFilter.cpp
index 4dcc05e904..01eeddd9ca 100644
--- a/src/effects/SkBlurImageFilter.cpp
+++ b/src/effects/SkBlurImageFilter.cpp
@@ -34,16 +34,15 @@ static SkVector mapSigma(const SkSize& localSigma, const SkMatrix& ctm) {
SkBlurImageFilter::SkBlurImageFilter(SkScalar sigmaX,
SkScalar sigmaY,
SkImageFilter* input,
- const CropRect* cropRect,
- uint32_t uniqueID)
- : INHERITED(1, &input, cropRect, uniqueID), fSigma(SkSize::Make(sigmaX, sigmaY)) {
+ const CropRect* cropRect)
+ : INHERITED(1, &input, cropRect), fSigma(SkSize::Make(sigmaX, sigmaY)) {
}
SkFlattenable* SkBlurImageFilter::CreateProc(SkReadBuffer& buffer) {
SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
SkScalar sigmaX = buffer.readScalar();
SkScalar sigmaY = buffer.readScalar();
- return Create(sigmaX, sigmaY, common.getInput(0), &common.cropRect(), common.uniqueID());
+ return Create(sigmaX, sigmaY, common.getInput(0), &common.cropRect());
}
void SkBlurImageFilter::flatten(SkWriteBuffer& buffer) const {
diff --git a/src/effects/SkColorFilterImageFilter.cpp b/src/effects/SkColorFilterImageFilter.cpp
index 210fb57b98..2eb720e5c4 100755
--- a/src/effects/SkColorFilterImageFilter.cpp
+++ b/src/effects/SkColorFilterImageFilter.cpp
@@ -16,7 +16,7 @@
#include "SkWriteBuffer.h"
SkColorFilterImageFilter* SkColorFilterImageFilter::Create(SkColorFilter* cf,
- SkImageFilter* input, const CropRect* cropRect, uint32_t uniqueID) {
+ SkImageFilter* input, const CropRect* cropRect) {
if (NULL == cf) {
return NULL;
}
@@ -28,22 +28,22 @@ SkColorFilterImageFilter* SkColorFilterImageFilter::Create(SkColorFilter* cf,
SkAutoUnref autoUnref(inputCF);
SkAutoTUnref<SkColorFilter> newCF(SkColorFilter::CreateComposeFilter(cf, inputCF));
if (newCF) {
- return SkNEW_ARGS(SkColorFilterImageFilter, (newCF, input->getInput(0), cropRect, 0));
+ return SkNEW_ARGS(SkColorFilterImageFilter, (newCF, input->getInput(0), cropRect));
}
}
- return SkNEW_ARGS(SkColorFilterImageFilter, (cf, input, cropRect, uniqueID));
+ return SkNEW_ARGS(SkColorFilterImageFilter, (cf, input, cropRect));
}
SkColorFilterImageFilter::SkColorFilterImageFilter(SkColorFilter* cf,
- SkImageFilter* input, const CropRect* cropRect, uint32_t uniqueID)
- : INHERITED(1, &input, cropRect, uniqueID), fColorFilter(SkRef(cf)) {
+ SkImageFilter* input, const CropRect* cropRect)
+ : INHERITED(1, &input, cropRect), fColorFilter(SkRef(cf)) {
}
SkFlattenable* SkColorFilterImageFilter::CreateProc(SkReadBuffer& buffer) {
SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
SkAutoTUnref<SkColorFilter> cf(buffer.readColorFilter());
- return Create(cf, common.getInput(0), &common.cropRect(), common.uniqueID());
+ return Create(cf, common.getInput(0), &common.cropRect());
}
void SkColorFilterImageFilter::flatten(SkWriteBuffer& buffer) const {
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index 25339e613c..e280817e38 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -164,7 +164,7 @@ SkDisplacementMapEffect* SkDisplacementMapEffect::Create(ChannelSelectorType xCh
SkScalar scale,
SkImageFilter* displacement,
SkImageFilter* color,
- const CropRect* cropRect, uint32_t uniqueID) {
+ const CropRect* cropRect) {
if (!channel_selector_type_is_valid(xChannelSelector) ||
!channel_selector_type_is_valid(yChannelSelector)) {
return NULL;
@@ -172,16 +172,15 @@ SkDisplacementMapEffect* SkDisplacementMapEffect::Create(ChannelSelectorType xCh
SkImageFilter* inputs[2] = { displacement, color };
return SkNEW_ARGS(SkDisplacementMapEffect, (xChannelSelector, yChannelSelector, scale,
- inputs, cropRect, uniqueID));
+ inputs, cropRect));
}
SkDisplacementMapEffect::SkDisplacementMapEffect(ChannelSelectorType xChannelSelector,
ChannelSelectorType yChannelSelector,
SkScalar scale,
SkImageFilter* inputs[2],
- const CropRect* cropRect,
- uint32_t uniqueID)
- : INHERITED(2, inputs, cropRect, uniqueID)
+ const CropRect* cropRect)
+ : INHERITED(2, inputs, cropRect)
, fXChannelSelector(xChannelSelector)
, fYChannelSelector(yChannelSelector)
, fScale(scale)
@@ -196,7 +195,7 @@ SkFlattenable* SkDisplacementMapEffect::CreateProc(SkReadBuffer& buffer) {
ChannelSelectorType xsel = (ChannelSelectorType)buffer.readInt();
ChannelSelectorType ysel = (ChannelSelectorType)buffer.readInt();
SkScalar scale = buffer.readScalar();
- return Create(xsel, ysel, scale, common.getInput(0), common.getInput(1), &common.cropRect(), common.uniqueID());
+ return Create(xsel, ysel, scale, common.getInput(0), common.getInput(1), &common.cropRect());
}
void SkDisplacementMapEffect::flatten(SkWriteBuffer& buffer) const {
diff --git a/src/effects/SkDropShadowImageFilter.cpp b/src/effects/SkDropShadowImageFilter.cpp
index 22bee9dade..c453411d80 100644
--- a/src/effects/SkDropShadowImageFilter.cpp
+++ b/src/effects/SkDropShadowImageFilter.cpp
@@ -18,8 +18,8 @@
SkDropShadowImageFilter::SkDropShadowImageFilter(SkScalar dx, SkScalar dy,
SkScalar sigmaX, SkScalar sigmaY, SkColor color,
ShadowMode shadowMode, SkImageFilter* input,
- const CropRect* cropRect, uint32_t uniqueID)
- : INHERITED(1, &input, cropRect, uniqueID)
+ const CropRect* cropRect)
+ : INHERITED(1, &input, cropRect)
, fDx(dx)
, fDy(dy)
, fSigmaX(sigmaX)
@@ -40,7 +40,7 @@ SkFlattenable* SkDropShadowImageFilter::CreateProc(SkReadBuffer& buffer) {
kDrawShadowAndForeground_ShadowMode :
static_cast<ShadowMode>(buffer.readInt());
return Create(dx, dy, sigmaX, sigmaY, color, shadowMode, common.getInput(0),
- &common.cropRect(), common.uniqueID());
+ &common.cropRect());
}
void SkDropShadowImageFilter::flatten(SkWriteBuffer& buffer) const {
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index 2454dc1b36..115776707d 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -280,7 +280,7 @@ void writePoint3(const SkPoint3& point, SkWriteBuffer& buffer) {
class SkDiffuseLightingImageFilter : public SkLightingImageFilter {
public:
static SkImageFilter* Create(SkLight* light, SkScalar surfaceScale, SkScalar kd, SkImageFilter*,
- const CropRect*, uint32_t uniqueID = 0);
+ const CropRect*);
SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDiffuseLightingImageFilter)
@@ -288,8 +288,7 @@ public:
protected:
SkDiffuseLightingImageFilter(SkLight* light, SkScalar surfaceScale,
- SkScalar kd, SkImageFilter* input, const CropRect* cropRect,
- uint32_t uniqueID);
+ SkScalar kd, SkImageFilter* input, const CropRect* cropRect);
void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE;
@@ -307,8 +306,7 @@ private:
class SkSpecularLightingImageFilter : public SkLightingImageFilter {
public:
static SkImageFilter* Create(SkLight* light, SkScalar surfaceScale,
- SkScalar ks, SkScalar shininess, SkImageFilter*, const CropRect*,
- uint32_t uniqueID = 0);
+ SkScalar ks, SkScalar shininess, SkImageFilter*, const CropRect*);
SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkSpecularLightingImageFilter)
@@ -318,8 +316,7 @@ public:
protected:
SkSpecularLightingImageFilter(SkLight* light, SkScalar surfaceScale, SkScalar ks,
- SkScalar shininess, SkImageFilter* input, const CropRect*,
- uint32_t uniqueID);
+ SkScalar shininess, SkImageFilter* input, const CropRect*);
void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE;
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE;
@@ -860,9 +857,8 @@ void SkLight::flattenLight(SkWriteBuffer& buffer) const {
///////////////////////////////////////////////////////////////////////////////
SkLightingImageFilter::SkLightingImageFilter(SkLight* light, SkScalar surfaceScale,
- SkImageFilter* input, const CropRect* cropRect,
- uint32_t uniqueID)
- : INHERITED(1, &input, cropRect, uniqueID)
+ SkImageFilter* input, const CropRect* cropRect)
+ : INHERITED(1, &input, cropRect)
, fLight(SkRef(light))
, fSurfaceScale(surfaceScale / 255)
{}
@@ -949,7 +945,7 @@ void SkLightingImageFilter::flatten(SkWriteBuffer& buffer) const {
///////////////////////////////////////////////////////////////////////////////
SkImageFilter* SkDiffuseLightingImageFilter::Create(SkLight* light, SkScalar surfaceScale,
- SkScalar kd, SkImageFilter* input, const CropRect* cropRect, uint32_t uniqueID) {
+ SkScalar kd, SkImageFilter* input, const CropRect* cropRect) {
if (NULL == light) {
return NULL;
}
@@ -961,11 +957,11 @@ SkImageFilter* SkDiffuseLightingImageFilter::Create(SkLight* light, SkScalar sur
if (kd < 0) {
return NULL;
}
- return SkNEW_ARGS(SkDiffuseLightingImageFilter, (light, surfaceScale, kd, input, cropRect, uniqueID));
+ return SkNEW_ARGS(SkDiffuseLightingImageFilter, (light, surfaceScale, kd, input, cropRect));
}
-SkDiffuseLightingImageFilter::SkDiffuseLightingImageFilter(SkLight* light, SkScalar surfaceScale, SkScalar kd, SkImageFilter* input, const CropRect* cropRect, uint32_t uniqueID)
- : SkLightingImageFilter(light, surfaceScale, input, cropRect, uniqueID),
+SkDiffuseLightingImageFilter::SkDiffuseLightingImageFilter(SkLight* light, SkScalar surfaceScale, SkScalar kd, SkImageFilter* input, const CropRect* cropRect)
+ : SkLightingImageFilter(light, surfaceScale, input, cropRect),
fKD(kd)
{
}
@@ -975,7 +971,7 @@ SkFlattenable* SkDiffuseLightingImageFilter::CreateProc(SkReadBuffer& buffer) {
SkAutoTUnref<SkLight> light(SkLight::UnflattenLight(buffer));
SkScalar surfaceScale = buffer.readScalar();
SkScalar kd = buffer.readScalar();
- return Create(light, surfaceScale, kd, common.getInput(0), &common.cropRect(), common.uniqueID());
+ return Create(light, surfaceScale, kd, common.getInput(0), &common.cropRect());
}
void SkDiffuseLightingImageFilter::flatten(SkWriteBuffer& buffer) const {
@@ -1061,7 +1057,7 @@ bool SkDiffuseLightingImageFilter::asFragmentProcessor(GrFragmentProcessor** fp,
///////////////////////////////////////////////////////////////////////////////
SkImageFilter* SkSpecularLightingImageFilter::Create(SkLight* light, SkScalar surfaceScale,
- SkScalar ks, SkScalar shininess, SkImageFilter* input, const CropRect* cropRect, uint32_t uniqueID) {
+ SkScalar ks, SkScalar shininess, SkImageFilter* input, const CropRect* cropRect) {
if (NULL == light) {
return NULL;
}
@@ -1074,11 +1070,11 @@ SkImageFilter* SkSpecularLightingImageFilter::Create(SkLight* light, SkScalar su
return NULL;
}
return SkNEW_ARGS(SkSpecularLightingImageFilter,
- (light, surfaceScale, ks, shininess, input, cropRect, uniqueID));
+ (light, surfaceScale, ks, shininess, input, cropRect));
}
-SkSpecularLightingImageFilter::SkSpecularLightingImageFilter(SkLight* light, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, SkImageFilter* input, const CropRect* cropRect, uint32_t uniqueID)
- : SkLightingImageFilter(light, surfaceScale, input, cropRect, uniqueID),
+SkSpecularLightingImageFilter::SkSpecularLightingImageFilter(SkLight* light, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, SkImageFilter* input, const CropRect* cropRect)
+ : SkLightingImageFilter(light, surfaceScale, input, cropRect),
fKS(ks),
fShininess(shininess)
{
@@ -1090,7 +1086,7 @@ SkFlattenable* SkSpecularLightingImageFilter::CreateProc(SkReadBuffer& buffer) {
SkScalar surfaceScale = buffer.readScalar();
SkScalar ks = buffer.readScalar();
SkScalar shine = buffer.readScalar();
- return Create(light, surfaceScale, ks, shine, common.getInput(0), &common.cropRect(), common.uniqueID());
+ return Create(light, surfaceScale, ks, shine, common.getInput(0), &common.cropRect());
}
void SkSpecularLightingImageFilter::flatten(SkWriteBuffer& buffer) const {
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp
index e9dd87852f..4cba043e99 100644
--- a/src/effects/SkMatrixConvolutionImageFilter.cpp
+++ b/src/effects/SkMatrixConvolutionImageFilter.cpp
@@ -30,9 +30,8 @@ SkMatrixConvolutionImageFilter::SkMatrixConvolutionImageFilter(
TileMode tileMode,
bool convolveAlpha,
SkImageFilter* input,
- const CropRect* cropRect,
- uint32_t uniqueID)
- : INHERITED(1, &input, cropRect, uniqueID),
+ const CropRect* cropRect)
+ : INHERITED(1, &input, cropRect),
fKernelSize(kernelSize),
fGain(gain),
fBias(bias),
@@ -56,8 +55,7 @@ SkMatrixConvolutionImageFilter* SkMatrixConvolutionImageFilter::Create(
TileMode tileMode,
bool convolveAlpha,
SkImageFilter* input,
- const CropRect* cropRect,
- uint32_t uniqueID) {
+ const CropRect* cropRect) {
if (kernelSize.width() < 1 || kernelSize.height() < 1) {
return NULL;
}
@@ -73,7 +71,7 @@ SkMatrixConvolutionImageFilter* SkMatrixConvolutionImageFilter::Create(
}
return SkNEW_ARGS(SkMatrixConvolutionImageFilter, (kernelSize, kernel, gain, bias,
kernelOffset, tileMode, convolveAlpha,
- input, cropRect, uniqueID));
+ input, cropRect));
}
SkFlattenable* SkMatrixConvolutionImageFilter::CreateProc(SkReadBuffer& buffer) {
@@ -99,7 +97,7 @@ SkFlattenable* SkMatrixConvolutionImageFilter::CreateProc(SkReadBuffer& buffer)
TileMode tileMode = (TileMode)buffer.readInt();
bool convolveAlpha = buffer.readBool();
return Create(kernelSize, kernel.get(), gain, bias, kernelOffset, tileMode, convolveAlpha,
- common.getInput(0), &common.cropRect(), common.uniqueID());
+ common.getInput(0), &common.cropRect());
}
void SkMatrixConvolutionImageFilter::flatten(SkWriteBuffer& buffer) const {
diff --git a/src/effects/SkMatrixImageFilter.cpp b/src/effects/SkMatrixImageFilter.cpp
index 54caca6dc3..a61867e041 100644
--- a/src/effects/SkMatrixImageFilter.cpp
+++ b/src/effects/SkMatrixImageFilter.cpp
@@ -17,18 +17,16 @@
SkMatrixImageFilter::SkMatrixImageFilter(const SkMatrix& transform,
SkFilterQuality filterQuality,
- SkImageFilter* input,
- uint32_t uniqueID)
- : INHERITED(1, &input, NULL, uniqueID),
+ SkImageFilter* input)
+ : INHERITED(1, &input),
fTransform(transform),
fFilterQuality(filterQuality) {
}
SkMatrixImageFilter* SkMatrixImageFilter::Create(const SkMatrix& transform,
SkFilterQuality filterQuality,
- SkImageFilter* input,
- uint32_t uniqueID) {
- return SkNEW_ARGS(SkMatrixImageFilter, (transform, filterQuality, input, uniqueID));
+ SkImageFilter* input) {
+ return SkNEW_ARGS(SkMatrixImageFilter, (transform, filterQuality, input));
}
SkFlattenable* SkMatrixImageFilter::CreateProc(SkReadBuffer& buffer) {
@@ -36,7 +34,7 @@ SkFlattenable* SkMatrixImageFilter::CreateProc(SkReadBuffer& buffer) {
SkMatrix matrix;
buffer.readMatrix(&matrix);
SkFilterQuality quality = static_cast<SkFilterQuality>(buffer.readInt());
- return Create(matrix, quality, common.getInput(0), common.uniqueID());
+ return Create(matrix, quality, common.getInput(0));
}
void SkMatrixImageFilter::flatten(SkWriteBuffer& buffer) const {
diff --git a/src/effects/SkMergeImageFilter.cpp b/src/effects/SkMergeImageFilter.cpp
index 7034e158e5..f68d913378 100755
--- a/src/effects/SkMergeImageFilter.cpp
+++ b/src/effects/SkMergeImageFilter.cpp
@@ -42,9 +42,8 @@ void SkMergeImageFilter::initModes(const SkXfermode::Mode modes[]) {
SkMergeImageFilter::SkMergeImageFilter(SkImageFilter* filters[], int count,
const SkXfermode::Mode modes[],
- const CropRect* cropRect,
- uint32_t uniqueID)
- : INHERITED(count, filters, cropRect, uniqueID) {
+ const CropRect* cropRect)
+ : INHERITED(count, filters, cropRect) {
SkASSERT(count >= 0);
this->initModes(modes);
}
@@ -128,9 +127,9 @@ SkFlattenable* SkMergeImageFilter::CreateProc(SkReadBuffer& buffer) {
if (!buffer.isValid()) {
return NULL;
}
- return Create(common.inputs(), count, modes.get(), &common.cropRect(), common.uniqueID());
+ return Create(common.inputs(), count, modes.get(), &common.cropRect());
}
- return Create(common.inputs(), count, NULL, &common.cropRect(), common.uniqueID());
+ return Create(common.inputs(), count, NULL, &common.cropRect());
}
void SkMergeImageFilter::flatten(SkWriteBuffer& buffer) const {
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index d2ec036ba7..32d525a42a 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -24,9 +24,8 @@
SkMorphologyImageFilter::SkMorphologyImageFilter(int radiusX,
int radiusY,
SkImageFilter* input,
- const CropRect* cropRect,
- uint32_t uniqueID)
- : INHERITED(1, &input, cropRect, uniqueID), fRadius(SkISize::Make(radiusX, radiusY)) {
+ const CropRect* cropRect)
+ : INHERITED(1, &input, cropRect), fRadius(SkISize::Make(radiusX, radiusY)) {
}
void SkMorphologyImageFilter::flatten(SkWriteBuffer& buffer) const {
@@ -254,14 +253,14 @@ SkFlattenable* SkErodeImageFilter::CreateProc(SkReadBuffer& buffer) {
SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
const int width = buffer.readInt();
const int height = buffer.readInt();
- return Create(width, height, common.getInput(0), &common.cropRect(), common.uniqueID());
+ return Create(width, height, common.getInput(0), &common.cropRect());
}
SkFlattenable* SkDilateImageFilter::CreateProc(SkReadBuffer& buffer) {
SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
const int width = buffer.readInt();
const int height = buffer.readInt();
- return Create(width, height, common.getInput(0), &common.cropRect(), common.uniqueID());
+ return Create(width, height, common.getInput(0), &common.cropRect());
}
#ifndef SK_IGNORE_TO_STRING
diff --git a/src/effects/SkOffsetImageFilter.cpp b/src/effects/SkOffsetImageFilter.cpp
index 8a17ce34ec..1944e58922 100644
--- a/src/effects/SkOffsetImageFilter.cpp
+++ b/src/effects/SkOffsetImageFilter.cpp
@@ -95,7 +95,7 @@ SkFlattenable* SkOffsetImageFilter::CreateProc(SkReadBuffer& buffer) {
SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
SkPoint offset;
buffer.readPoint(&offset);
- return Create(offset.x(), offset.y(), common.getInput(0), &common.cropRect(), common.uniqueID());
+ return Create(offset.x(), offset.y(), common.getInput(0), &common.cropRect());
}
void SkOffsetImageFilter::flatten(SkWriteBuffer& buffer) const {
@@ -104,8 +104,8 @@ void SkOffsetImageFilter::flatten(SkWriteBuffer& buffer) const {
}
SkOffsetImageFilter::SkOffsetImageFilter(SkScalar dx, SkScalar dy, SkImageFilter* input,
- const CropRect* cropRect, uint32_t uniqueID)
- : INHERITED(1, &input, cropRect, uniqueID) {
+ const CropRect* cropRect)
+ : INHERITED(1, &input, cropRect) {
fOffset.set(dx, dy);
}
diff --git a/src/effects/SkPictureImageFilter.cpp b/src/effects/SkPictureImageFilter.cpp
index d3bc15ce23..baae6f8c67 100644
--- a/src/effects/SkPictureImageFilter.cpp
+++ b/src/effects/SkPictureImageFilter.cpp
@@ -13,8 +13,8 @@
#include "SkWriteBuffer.h"
#include "SkValidationUtils.h"
-SkPictureImageFilter::SkPictureImageFilter(const SkPicture* picture, uint32_t uniqueID)
- : INHERITED(0, 0, NULL, uniqueID)
+SkPictureImageFilter::SkPictureImageFilter(const SkPicture* picture)
+ : INHERITED(0, 0, NULL)
, fPicture(SkSafeRef(picture))
, fCropRect(picture ? picture->cullRect() : SkRect::MakeEmpty())
, fPictureResolution(kDeviceSpace_PictureResolution)
@@ -22,9 +22,9 @@ SkPictureImageFilter::SkPictureImageFilter(const SkPicture* picture, uint32_t un
}
SkPictureImageFilter::SkPictureImageFilter(const SkPicture* picture, const SkRect& cropRect,
- uint32_t uniqueID, PictureResolution pictureResolution,
+ PictureResolution pictureResolution,
SkFilterQuality filterQuality)
- : INHERITED(0, 0, NULL, uniqueID)
+ : INHERITED(0, 0, NULL)
, fPicture(SkSafeRef(picture))
, fCropRect(cropRect)
, fPictureResolution(pictureResolution)
diff --git a/src/effects/SkRectShaderImageFilter.cpp b/src/effects/SkRectShaderImageFilter.cpp
index a00994e75b..cdf03131c1 100644
--- a/src/effects/SkRectShaderImageFilter.cpp
+++ b/src/effects/SkRectShaderImageFilter.cpp
@@ -23,21 +23,20 @@ SkRectShaderImageFilter* SkRectShaderImageFilter::Create(SkShader* s, const SkRe
return s ? SkNEW_ARGS(SkRectShaderImageFilter, (s, &cropRect)) : NULL;
}
-SkRectShaderImageFilter* SkRectShaderImageFilter::Create(SkShader* s, const CropRect* cropRect, uint32_t uniqueID) {
+SkRectShaderImageFilter* SkRectShaderImageFilter::Create(SkShader* s, const CropRect* cropRect) {
SkASSERT(s);
- return s ? SkNEW_ARGS(SkRectShaderImageFilter, (s, cropRect, uniqueID)) : NULL;
+ return s ? SkNEW_ARGS(SkRectShaderImageFilter, (s, cropRect)) : NULL;
}
-SkRectShaderImageFilter::SkRectShaderImageFilter(SkShader* s, const CropRect* cropRect,
- uint32_t uniqueID)
- : INHERITED(0, NULL, cropRect, uniqueID)
+SkRectShaderImageFilter::SkRectShaderImageFilter(SkShader* s, const CropRect* cropRect)
+ : INHERITED(0, NULL, cropRect)
, fShader(SkRef(s)) {
}
SkFlattenable* SkRectShaderImageFilter::CreateProc(SkReadBuffer& buffer) {
SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 0);
SkAutoTUnref<SkShader> shader(buffer.readShader());
- return Create(shader.get(), &common.cropRect(), common.uniqueID());
+ return Create(shader.get(), &common.cropRect());
}
void SkRectShaderImageFilter::flatten(SkWriteBuffer& buffer) const {
diff --git a/src/effects/SkTileImageFilter.cpp b/src/effects/SkTileImageFilter.cpp
index 669c234d95..c5cf51871d 100644
--- a/src/effects/SkTileImageFilter.cpp
+++ b/src/effects/SkTileImageFilter.cpp
@@ -17,11 +17,11 @@
#include "SkValidationUtils.h"
SkTileImageFilter* SkTileImageFilter::Create(const SkRect& srcRect, const SkRect& dstRect,
- SkImageFilter* input, uint32_t uniqueID) {
+ SkImageFilter* input) {
if (!SkIsValidRect(srcRect) || !SkIsValidRect(dstRect)) {
return NULL;
}
- return SkNEW_ARGS(SkTileImageFilter, (srcRect, dstRect, input, uniqueID));
+ return SkNEW_ARGS(SkTileImageFilter, (srcRect, dstRect, input));
}
bool SkTileImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& src,
@@ -98,7 +98,7 @@ SkFlattenable* SkTileImageFilter::CreateProc(SkReadBuffer& buffer) {
SkRect src, dst;
buffer.readRect(&src);
buffer.readRect(&dst);
- return Create(src, dst, common.getInput(0), common.uniqueID());
+ return Create(src, dst, common.getInput(0));
}
void SkTileImageFilter::flatten(SkWriteBuffer& buffer) const {
diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp
index 2ba5ec5160..c3f8487ab6 100644
--- a/src/effects/SkXfermodeImageFilter.cpp
+++ b/src/effects/SkXfermodeImageFilter.cpp
@@ -22,9 +22,8 @@
SkXfermodeImageFilter::SkXfermodeImageFilter(SkXfermode* mode,
SkImageFilter* inputs[2],
- const CropRect* cropRect,
- uint32_t uniqueID)
- : INHERITED(2, inputs, cropRect, uniqueID), fMode(mode) {
+ const CropRect* cropRect)
+ : INHERITED(2, inputs, cropRect), fMode(mode) {
SkSafeRef(fMode);
}
@@ -35,7 +34,7 @@ SkXfermodeImageFilter::~SkXfermodeImageFilter() {
SkFlattenable* SkXfermodeImageFilter::CreateProc(SkReadBuffer& buffer) {
SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 2);
SkAutoTUnref<SkXfermode> mode(buffer.readXfermode());
- return Create(mode, common.getInput(0), common.getInput(1), &common.cropRect(), common.uniqueID());
+ return Create(mode, common.getInput(0), common.getInput(1), &common.cropRect());
}
void SkXfermodeImageFilter::flatten(SkWriteBuffer& buffer) const {
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index 7d7d474b30..e9792e4b43 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -298,7 +298,7 @@ static void test_crop_rects(SkBaseDevice* device, skiatest::Reporter* reporter)
SkBlurImageFilter::Create(SK_Scalar1, SK_Scalar1, input.get(), &cropRect),
SkDropShadowImageFilter::Create(SK_Scalar1, SK_Scalar1, SK_Scalar1, SK_Scalar1,
SK_ColorGREEN, SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode,
- input.get(), &cropRect, 0),
+ input.get(), &cropRect),
SkLightingImageFilter::CreatePointLitDiffuse(location, SK_ColorGREEN, 0, 0, input.get(), &cropRect),
SkLightingImageFilter::CreatePointLitSpecular(location, SK_ColorGREEN, 0, 0, 0, input.get(), &cropRect),
SkMatrixConvolutionImageFilter::Create(kernelSize, kernel, gain, bias, SkIPoint::Make(1, 1), SkMatrixConvolutionImageFilter::kRepeat_TileMode, false, input.get(), &cropRect),
@@ -585,7 +585,7 @@ static SkImageFilter* makeDropShadow(SkImageFilter* input = NULL) {
SkIntToScalar(100), SkIntToScalar(100),
SkIntToScalar(10), SkIntToScalar(10),
SK_ColorBLUE, SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode,
- input, NULL, 0);
+ input, NULL);
}
DEF_TEST(ImageFilterBlurThenShadowBounds, reporter) {