Index: include/effects/SkMorphologyImageFilter.h |
diff --git a/include/effects/SkMorphologyImageFilter.h b/include/effects/SkMorphologyImageFilter.h |
index b449b19e61df28d447e8a2f92273f6ec8e68e495..36822e9f1651aef434464738cdecc6fa640552f2 100644 |
--- a/include/effects/SkMorphologyImageFilter.h |
+++ b/include/effects/SkMorphologyImageFilter.h |
@@ -29,18 +29,24 @@ public: |
int width, int height, int srcStride, int dstStride); |
protected: |
- SkMorphologyImageFilter(int radiusX, int radiusY, SkImageFilter* input, |
+ enum Op { |
+ kErode_Op, |
+ kDilate_Op, |
+ }; |
+ |
+ SkMorphologyImageFilter(Op op, int radiusX, int radiusY, SkImageFilter* input, |
const CropRect* cropRect); |
- sk_sp<SkSpecialImage> filterImageGeneric(bool dilate, |
- SkSpecialImage* source, |
- const Context&, |
- SkIPoint* offset) const; |
+ sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, |
+ const Context&, |
+ SkIPoint* offset) const override; |
void flatten(SkWriteBuffer&) const override; |
SkISize radius() const { return fRadius; } |
private: |
- SkISize fRadius; |
+ const Op fOp; |
Stephen White
2016/03/29 14:42:04
Could we just provide a virtual op() function, ove
robertphillips
2016/03/29 20:27:45
Done.
|
+ SkISize fRadius; |
+ |
typedef SkImageFilter INHERITED; |
}; |
@@ -59,13 +65,9 @@ public: |
SK_TO_STRING_OVERRIDE() |
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDilateImageFilter) |
-protected: |
- sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&, |
- SkIPoint* offset) const override; |
- |
private: |
SkDilateImageFilter(int radiusX, int radiusY, SkImageFilter* input, const CropRect* cropRect) |
- : INHERITED(radiusX, radiusY, input, cropRect) {} |
+ : INHERITED(kDilate_Op, radiusX, radiusY, input, cropRect) {} |
typedef SkMorphologyImageFilter INHERITED; |
}; |
@@ -85,13 +87,9 @@ public: |
SK_TO_STRING_OVERRIDE() |
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkErodeImageFilter) |
-protected: |
- sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&, |
- SkIPoint* offset) const override; |
- |
private: |
SkErodeImageFilter(int radiusX, int radiusY, SkImageFilter* input, const CropRect* cropRect) |
- : INHERITED(radiusX, radiusY, input, cropRect) {} |
+ : INHERITED(kErode_Op, radiusX, radiusY, input, cropRect) {} |
typedef SkMorphologyImageFilter INHERITED; |
}; |