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

Unified Diff: src/core/SkPicture.cpp

Issue 1135363002: Defer execution of SkPicture::Analysis::Analysis Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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 | « include/core/SkPicture.h ('k') | no next file » | 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 c0148793542a7f84c8aff65175bcb345a5d6f9aa..7577c6c263a0d42d7a6cf8fde0582d7f31747739 100644
--- a/src/core/SkPicture.cpp
+++ b/src/core/SkPicture.cpp
@@ -190,6 +190,12 @@ struct SkPicture::PathCounter {
};
SkPicture::Analysis::Analysis(const SkRecord& record) {
+ fIsAnalyzed = false;
+}
+
+void SkPicture::Analysis::performAnalysis(const SkRecord& record) {
+ SkASSERT(!fIsAnalyzed);
+
fWillPlaybackBitmaps = WillPlaybackBitmaps(record);
PathCounter counter;
@@ -206,6 +212,7 @@ SkPicture::Analysis::Analysis(const SkRecord& record) {
break;
}
}
+ fIsAnalyzed = true;
}
bool SkPicture::Analysis::suitableForGpuRasterization(const char** reason,
@@ -439,7 +446,9 @@ void SkPicture::flatten(SkWriteBuffer& buffer) const {
}
#if SK_SUPPORT_GPU
-bool SkPicture::suitableForGpuRasterization(GrContext*, const char **reason) const {
+bool SkPicture::suitableForGpuRasterization(GrContext*, const char **reason) {
+ if (!fAnalysis.isAnalyzed())
+ fAnalysis.performAnalysis(*fRecord);
return fAnalysis.suitableForGpuRasterization(reason, 0);
}
#endif
« no previous file with comments | « include/core/SkPicture.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698