aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/effects/SkMorphologyImageFilter.h
diff options
context:
space:
mode:
authorGravatar senorblanco <senorblanco@chromium.org>2014-08-26 12:27:12 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-26 12:27:12 -0700
commit5e5f948b6b363dbfc8c076d8ff0c6b8e9ea99958 (patch)
tree1f3b8fdb8dc30a897119f3ce25e347cdaad94391 /include/effects/SkMorphologyImageFilter.h
parent21aed57023bad4b04076c59e37097c7563efc028 (diff)
Reimplement deserialization of SkImageFilter's uniqueID.
9fa60d ("Simplify flattening to just write enough ... ") simplified just a tad too much. In particular, it disabled deserialization of SkImageFilter's uniqueID, which in turn caused the failure of SkImageFilter's cache, which caused a large regression in Chrome's SVG filter performance. The medium-term fix is to switch to the new SkRecordDraw SkPicture backend, which will make the unique IDs unnecessary. This change is an "in case of emergecy" CL, in the event that there are problems switching on the new backend in Chrome. For that reason, it's minimalist: only the filters used by Chrome are modified, and whitespace changes are kept to a minimum. In this way, it should be easy to revert once the new backend goes in. R=reed@google.com Author: senorblanco@chromium.org Review URL: https://codereview.chromium.org/503833002
Diffstat (limited to 'include/effects/SkMorphologyImageFilter.h')
-rw-r--r--include/effects/SkMorphologyImageFilter.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/include/effects/SkMorphologyImageFilter.h b/include/effects/SkMorphologyImageFilter.h
index 499d6a8c26..3f2be45cc5 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);
+ const CropRect* cropRect, uint32_t uniqueID);
bool filterImageGeneric(Proc procX, Proc procY,
Proxy*, const SkBitmap& src, const Context&,
SkBitmap* result, SkIPoint* offset) const;
@@ -56,11 +56,12 @@ class SK_API SkDilateImageFilter : public SkMorphologyImageFilter {
public:
static SkDilateImageFilter* Create(int radiusX, int radiusY,
SkImageFilter* input = NULL,
- const CropRect* cropRect = NULL) {
+ const CropRect* cropRect = NULL,
+ uint32_t uniqueID = 0) {
if (radiusX < 0 || radiusY < 0) {
return NULL;
}
- return SkNEW_ARGS(SkDilateImageFilter, (radiusX, radiusY, input, cropRect));
+ return SkNEW_ARGS(SkDilateImageFilter, (radiusX, radiusY, input, cropRect, uniqueID));
}
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
@@ -73,8 +74,8 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDilateImageFilter)
protected:
- SkDilateImageFilter(int radiusX, int radiusY, SkImageFilter* input, const CropRect* cropRect)
- : INHERITED(radiusX, radiusY, input, cropRect) {}
+ 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
@@ -87,11 +88,12 @@ class SK_API SkErodeImageFilter : public SkMorphologyImageFilter {
public:
static SkErodeImageFilter* Create(int radiusX, int radiusY,
SkImageFilter* input = NULL,
- const CropRect* cropRect = NULL) {
+ const CropRect* cropRect = NULL,
+ uint32_t uniqueID = 0) {
if (radiusX < 0 || radiusY < 0) {
return NULL;
}
- return SkNEW_ARGS(SkErodeImageFilter, (radiusX, radiusY, input, cropRect));
+ return SkNEW_ARGS(SkErodeImageFilter, (radiusX, radiusY, input, cropRect, uniqueID));
}
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
@@ -104,8 +106,8 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkErodeImageFilter)
protected:
- SkErodeImageFilter(int radiusX, int radiusY, SkImageFilter* input, const CropRect* cropRect)
- : INHERITED(radiusX, radiusY, input, cropRect) {}
+ 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