Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: include/effects/SkMorphologyImageFilter.h

Issue 1834953002: Update Morphology image filter to store its type (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add virtual op() method Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/effects/SkMorphologyImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/effects/SkMorphologyImageFilter.h
diff --git a/include/effects/SkMorphologyImageFilter.h b/include/effects/SkMorphologyImageFilter.h
index b449b19e61df28d447e8a2f92273f6ec8e68e495..4e699a7633eaa9b924b32e675ef86e1dfdb2b14a 100644
--- a/include/effects/SkMorphologyImageFilter.h
+++ b/include/effects/SkMorphologyImageFilter.h
@@ -29,18 +29,25 @@ public:
int width, int height, int srcStride, int dstStride);
protected:
+ enum Op {
+ kErode_Op,
+ kDilate_Op,
+ };
+
+ virtual Op op() const = 0;
+
SkMorphologyImageFilter(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;
+ SkISize fRadius;
+
typedef SkImageFilter INHERITED;
};
@@ -60,8 +67,7 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDilateImageFilter)
protected:
- sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&,
- SkIPoint* offset) const override;
+ Op op() const override { return kDilate_Op; }
private:
SkDilateImageFilter(int radiusX, int radiusY, SkImageFilter* input, const CropRect* cropRect)
@@ -86,8 +92,7 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkErodeImageFilter)
protected:
- sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&,
- SkIPoint* offset) const override;
+ Op op() const override { return kErode_Op; }
private:
SkErodeImageFilter(int radiusX, int radiusY, SkImageFilter* input, const CropRect* cropRect)
« no previous file with comments | « no previous file | src/effects/SkMorphologyImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698