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

Unified Diff: src/core/SkPicture.cpp

Issue 551853002: Turn on the save-layer optimization. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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 | src/core/SkRecordOpts.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPicture.cpp
diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp
index f595f74e4e06164f76c357214f9ed817c0e9822d..408901bebe814608a7380a969515245d0f8df54c 100644
--- a/src/core/SkPicture.cpp
+++ b/src/core/SkPicture.cpp
@@ -639,18 +639,21 @@ uint32_t SkPicture::uniqueID() const {
return fUniqueID;
}
+static SkRecord* optimized(SkRecord* r) {
+ SkRecordOptimize(r);
+ return r;
+}
+
// fRecord OK
SkPicture::SkPicture(SkScalar width, SkScalar height, SkRecord* record, SkBBoxHierarchy* bbh)
: fCullWidth(width)
, fCullHeight(height)
- , fRecord(record)
+ , fRecord(optimized(record))
, fBBH(SkSafeRef(bbh))
- , fAnalysis(*record) {
- // TODO: move optimization before we construct fAnalysis?
- SkRecordOptimize(record);
+ , fAnalysis(*fRecord) {
// TODO: delay as much of this work until just before first playback?
if (fBBH.get()) {
- SkRecordFillBounds(*record, fBBH.get());
+ SkRecordFillBounds(*fRecord, fBBH.get());
}
this->needsNewGenID();
}
« no previous file with comments | « no previous file | src/core/SkRecordOpts.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698