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

Unified Diff: src/effects/SkMorphologyImageFilter.cpp

Issue 395603002: Simplify flattening to just write enough to call the factory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 4 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 | « src/effects/SkMergeImageFilter.cpp ('k') | src/effects/SkOffsetImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkMorphologyImageFilter.cpp
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 67769f29b93c2efe2468071133ec7ceb7212e0ca..bb8478c907b4865a417146e118bc4509338bbd5d 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -21,6 +21,7 @@
#include "effects/Gr1DKernelEffect.h"
#endif
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
SkMorphologyImageFilter::SkMorphologyImageFilter(SkReadBuffer& buffer)
: INHERITED(1, buffer) {
fRadius.fWidth = buffer.readInt();
@@ -28,6 +29,7 @@ SkMorphologyImageFilter::SkMorphologyImageFilter(SkReadBuffer& buffer)
buffer.validate((fRadius.fWidth >= 0) &&
(fRadius.fHeight >= 0));
}
+#endif
SkMorphologyImageFilter::SkMorphologyImageFilter(int radiusX,
int radiusY,
@@ -36,7 +38,6 @@ SkMorphologyImageFilter::SkMorphologyImageFilter(int radiusX,
: INHERITED(1, &input, cropRect), fRadius(SkISize::Make(radiusX, radiusY)) {
}
-
void SkMorphologyImageFilter::flatten(SkWriteBuffer& buffer) const {
this->INHERITED::flatten(buffer);
buffer.writeInt(fRadius.fWidth);
@@ -258,6 +259,20 @@ bool SkMorphologyImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix&
return true;
}
+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());
+}
+
+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());
+}
+
#if SK_SUPPORT_GPU
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « src/effects/SkMergeImageFilter.cpp ('k') | src/effects/SkOffsetImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698