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

Unified Diff: src/effects/SkMatrixImageFilter.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/SkMatrixConvolutionImageFilter.cpp ('k') | src/effects/SkMergeImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkMatrixImageFilter.cpp
diff --git a/src/effects/SkMatrixImageFilter.cpp b/src/effects/SkMatrixImageFilter.cpp
index c7c815a761dec37b3acb782bba71220ee4a69352..2b7786a2b542262915581d6906ff9e12c8878375 100644
--- a/src/effects/SkMatrixImageFilter.cpp
+++ b/src/effects/SkMatrixImageFilter.cpp
@@ -29,11 +29,21 @@ SkMatrixImageFilter* SkMatrixImageFilter::Create(const SkMatrix& transform,
return SkNEW_ARGS(SkMatrixImageFilter, (transform, filterLevel, input));
}
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
SkMatrixImageFilter::SkMatrixImageFilter(SkReadBuffer& buffer)
: INHERITED(1, buffer) {
buffer.readMatrix(&fTransform);
fFilterLevel = static_cast<SkPaint::FilterLevel>(buffer.readInt());
}
+#endif
+
+SkFlattenable* SkMatrixImageFilter::CreateProc(SkReadBuffer& buffer) {
+ SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1);
+ SkMatrix matrix;
+ buffer.readMatrix(&matrix);
+ SkPaint::FilterLevel level = static_cast<SkPaint::FilterLevel>(buffer.readInt());
+ return Create(matrix, level, common.getInput(0));
+}
void SkMatrixImageFilter::flatten(SkWriteBuffer& buffer) const {
this->INHERITED::flatten(buffer);
« no previous file with comments | « src/effects/SkMatrixConvolutionImageFilter.cpp ('k') | src/effects/SkMergeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698