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
This commit is contained in:
parent
249af15fb8
commit
4fc5b8811e
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user