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

Unified Diff: src/effects/SkComposeImageFilter.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/SkColorMatrixFilter.cpp ('k') | src/effects/SkCornerPathEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkComposeImageFilter.cpp
diff --git a/src/effects/SkComposeImageFilter.cpp b/src/effects/SkComposeImageFilter.cpp
index 645d63372a0ccd475c72a87e7613edb1ecaede18..c0556749ace1572dc37578655cd42616e016913f 100644
--- a/src/effects/SkComposeImageFilter.cpp
+++ b/src/effects/SkComposeImageFilter.cpp
@@ -21,14 +21,6 @@ bool SkComposeImageFilter::onFilterImage(Proxy* proxy,
SkImageFilter* outer = getInput(0);
SkImageFilter* inner = getInput(1);
- if (!outer && !inner) {
- return false;
- }
-
- if (!outer || !inner) {
- return (outer ? outer : inner)->filterImage(proxy, src, ctx, result, offset);
- }
-
SkBitmap tmp;
return inner->filterImage(proxy, src, ctx, &tmp, offset) &&
outer->filterImage(proxy, tmp, ctx, result, offset);
@@ -40,19 +32,17 @@ bool SkComposeImageFilter::onFilterBounds(const SkIRect& src,
SkImageFilter* outer = getInput(0);
SkImageFilter* inner = getInput(1);
- if (!outer && !inner) {
- return false;
- }
-
- if (!outer || !inner) {
- return (outer ? outer : inner)->filterBounds(src, ctm, dst);
- }
-
SkIRect tmp;
- return inner->filterBounds(src, ctm, &tmp) &&
- outer->filterBounds(tmp, ctm, dst);
+ return inner->filterBounds(src, ctm, &tmp) && outer->filterBounds(tmp, ctm, dst);
+}
+
+SkFlattenable* SkComposeImageFilter::CreateProc(SkReadBuffer& buffer) {
+ SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 2);
+ return SkComposeImageFilter::Create(common.getInput(0), common.getInput(1));
}
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
SkComposeImageFilter::SkComposeImageFilter(SkReadBuffer& buffer)
: INHERITED(2, buffer) {
}
+#endif
« no previous file with comments | « src/effects/SkColorMatrixFilter.cpp ('k') | src/effects/SkCornerPathEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698