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

Unified Diff: src/core/SkBigPicture.cpp

Issue 1939503002: remove non-static uses of SkOncePtr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: leave it Created 4 years, 8 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/core/SkBigPicture.h ('k') | src/core/SkColorTable.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBigPicture.cpp
diff --git a/src/core/SkBigPicture.cpp b/src/core/SkBigPicture.cpp
index 70f68db337d0c2a7db931da6ec57d7b5d9e946aa..da3d3a841808da5339ff82a64d04d08b705d984d 100644
--- a/src/core/SkBigPicture.cpp
+++ b/src/core/SkBigPicture.cpp
@@ -58,7 +58,8 @@ void SkBigPicture::partialPlayback(SkCanvas* canvas,
}
const SkBigPicture::Analysis& SkBigPicture::analysis() const {
- return *fAnalysis.get([&]{ return new Analysis(*fRecord); });
+ fAnalysisOnce([this] { fAnalysis.init(*fRecord); });
+ return fAnalysis;
}
SkRect SkBigPicture::cullRect() const { return fCullRect; }
@@ -80,8 +81,8 @@ SkPicture const* const* SkBigPicture::drawablePicts() const {
return fDrawablePicts ? fDrawablePicts->begin() : nullptr;
}
-SkBigPicture::Analysis::Analysis(const SkRecord& record) {
- TRACE_EVENT0("disabled-by-default-skia", "SkBigPicture::Analysis::Analysis()");
+void SkBigPicture::Analysis::init(const SkRecord& record) {
+ TRACE_EVENT0("disabled-by-default-skia", "SkBigPicture::Analysis::init()");
SkTextHunter text;
SkBitmapHunter bitmap;
SkPathCounter path;
« no previous file with comments | « src/core/SkBigPicture.h ('k') | src/core/SkColorTable.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698