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

Unified Diff: src/core/SkPicture.cpp

Issue 573833002: SkPicture::PathCounter is O(N^2) for pictures nested N deep. Fix that. (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 | 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 c99939703c6ae8ce3614fb139400b189bb416695..19ff36d5a61583ffac3f58ce92d8955c6496acd2 100644
--- a/src/core/SkPicture.cpp
+++ b/src/core/SkPicture.cpp
@@ -142,14 +142,11 @@ struct SkPicture::PathCounter {
// Recurse into nested pictures.
void operator()(const SkRecords::DrawPicture& op) {
- // If you're not also SkRecord-backed, tough luck. Get on the bandwagon.
- if (op.picture->fRecord.get() == NULL) {
- return;
- }
- const SkRecord& nested = *op.picture->fRecord;
- for (unsigned i = 0; i < nested.count(); i++) {
- nested.visit<void>(i, *this);
- }
+ const SkPicture::Analysis& analysis = op.picture->fAnalysis;
+ numPaintWithPathEffectUses += analysis.fNumPaintWithPathEffectUses;
+ numFastPathDashEffects += analysis.fNumFastPathDashEffects;
+ numAAConcavePaths += analysis.fNumAAConcavePaths;
+ numAAHairlineConcavePaths += analysis.fNumAAHairlineConcavePaths;
}
void checkPaint(const SkPaint* paint) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698