SkPicture::PathCounter is O(N^2) for pictures nested N deep. Fix that.
We've already done the analysis for child pictures. Don't do it again.
BUG=skia:
R=fmalita@google.com, mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/573833002
diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp
index c999397..19ff36d 100644
--- a/src/core/SkPicture.cpp
+++ b/src/core/SkPicture.cpp
@@ -142,14 +142,11 @@
// 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) {