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

Unified Diff: gm/imagefiltersbase.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: 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 | « no previous file | gm/imagefiltersgraph.cpp » ('j') | include/core/SkImageFilter.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/imagefiltersbase.cpp
diff --git a/gm/imagefiltersbase.cpp b/gm/imagefiltersbase.cpp
index bbcb7ce2b567a6dc7e370c8de77d4c55da6963ca..f0637118e0c5e5bda28d978c29a926ce6f7b2bf4 100644
--- a/gm/imagefiltersbase.cpp
+++ b/gm/imagefiltersbase.cpp
@@ -30,13 +30,19 @@ protected:
return false;
}
- FailImageFilter(SkReadBuffer& buffer)
- : INHERITED(0, buffer) {}
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
+ FailImageFilter(SkReadBuffer& buffer) : INHERITED(0, buffer) {}
+#endif
private:
typedef SkImageFilter INHERITED;
};
+SkFlattenable* FailImageFilter::CreateProc(SkReadBuffer& buffer) {
+ SK_IMAGEFILTER_UNFLATTEN_COMMON(0);
+ return FailImageFilter::Create();
+}
+
// register the filter with the flattenable registry
static SkFlattenable::Registrar gFailImageFilterReg("FailImageFilter",
FailImageFilter::CreateProc,
@@ -58,13 +64,19 @@ protected:
return true;
}
- IdentityImageFilter(SkReadBuffer& buffer)
- : INHERITED(1, buffer) {}
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
+ IdentityImageFilter(SkReadBuffer& buffer) : INHERITED(1, buffer) {}
+#endif
private:
typedef SkImageFilter INHERITED;
};
+SkFlattenable* IdentityImageFilter::CreateProc(SkReadBuffer& buffer) {
+ SK_IMAGEFILTER_UNFLATTEN_COMMON(1);
+ return IdentityImageFilter::Create(common.inputAt(0));
+}
+
// register the filter with the flattenable registry
static SkFlattenable::Registrar gIdentityImageFilterReg("IdentityImageFilter",
IdentityImageFilter::CreateProc,
« no previous file with comments | « no previous file | gm/imagefiltersgraph.cpp » ('j') | include/core/SkImageFilter.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698