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

Unified Diff: src/effects/SkLayerRasterizer.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/SkLayerDrawLooper.cpp ('k') | src/effects/SkLerpXfermode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkLayerRasterizer.cpp
diff --git a/src/effects/SkLayerRasterizer.cpp b/src/effects/SkLayerRasterizer.cpp
index 9b7bdca3f4b7fb198ff0d4ec1949144d17aac055..b331a0363df90bcabed0bc47abb124157e8f3cae 100644
--- a/src/effects/SkLayerRasterizer.cpp
+++ b/src/effects/SkLayerRasterizer.cpp
@@ -148,12 +148,18 @@ bool SkLayerRasterizer::onRasterize(const SkPath& path, const SkMatrix& matrix,
return true;
}
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
SkLayerRasterizer::SkLayerRasterizer(SkReadBuffer& buffer)
: SkRasterizer(buffer), fLayers(ReadLayers(buffer)) {}
+#endif
+
+SkFlattenable* SkLayerRasterizer::CreateProc(SkReadBuffer& buffer) {
+ return SkNEW_ARGS(SkLayerRasterizer, (ReadLayers(buffer)));
+}
SkDeque* SkLayerRasterizer::ReadLayers(SkReadBuffer& buffer) {
int count = buffer.readInt();
-
+
SkDeque* layers = SkNEW_ARGS(SkDeque, (sizeof(SkLayerRasterizer_Rec)));
for (int i = 0; i < count; i++) {
SkLayerRasterizer_Rec* rec = (SkLayerRasterizer_Rec*)layers->push_back();
« no previous file with comments | « src/effects/SkLayerDrawLooper.cpp ('k') | src/effects/SkLerpXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698