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

Unified Diff: src/effects/SkBlurImageFilter.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/SkBlurDrawLooper.cpp ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkBlurImageFilter.cpp
diff --git a/src/effects/SkBlurImageFilter.cpp b/src/effects/SkBlurImageFilter.cpp
index 5c3ff493c27ebae1eee6ed1c301e7280b8dd8a63..71bc8114dfd9d85b3d0cab75077baab563572e37 100644
--- a/src/effects/SkBlurImageFilter.cpp
+++ b/src/effects/SkBlurImageFilter.cpp
@@ -23,6 +23,7 @@
// raster paths.
#define MAX_SIGMA SkIntToScalar(532)
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
SkBlurImageFilter::SkBlurImageFilter(SkReadBuffer& buffer)
: INHERITED(1, buffer) {
fSigma.fWidth = buffer.readScalar();
@@ -32,6 +33,7 @@ SkBlurImageFilter::SkBlurImageFilter(SkReadBuffer& buffer)
(fSigma.fWidth >= 0) &&
(fSigma.fHeight >= 0));
}
+#endif
SkBlurImageFilter::SkBlurImageFilter(SkScalar sigmaX,
SkScalar sigmaY,
@@ -41,6 +43,13 @@ SkBlurImageFilter::SkBlurImageFilter(SkScalar sigmaX,
SkASSERT(sigmaX >= 0 && sigmaY >= 0);
}
+SkFlattenable* SkBlurImageFilter::CreateProc(SkReadBuffer& buffer) {
+ SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
+ SkScalar sigmaX = buffer.readScalar();
+ SkScalar sigmaY = buffer.readScalar();
+ return Create(sigmaX, sigmaY, common.getInput(0), &common.cropRect());
+}
+
void SkBlurImageFilter::flatten(SkWriteBuffer& buffer) const {
this->INHERITED::flatten(buffer);
buffer.writeScalar(fSigma.fWidth);
« no previous file with comments | « src/effects/SkBlurDrawLooper.cpp ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698