Bug 1182361 p2 - count generic lookups. r=heycam

This commit is contained in:
John Daggett 2015-09-29 10:51:28 +09:00
parent 56fee2b299
commit 7e613837d7
3 changed files with 9 additions and 0 deletions

View File

@ -409,6 +409,7 @@ public:
uint32_t fallbackSystem;
uint32_t textrunConst;
uint32_t textrunDestr;
uint32_t genericLookups;
};
uint32_t reflowCount;
@ -442,6 +443,7 @@ public:
cumulative.fallbackSystem += current.fallbackSystem;
cumulative.textrunConst += current.textrunConst;
cumulative.textrunDestr += current.textrunDestr;
cumulative.genericLookups += current.genericLookups;
memset(&current, 0, sizeof(current));
}
};

View File

@ -1564,6 +1564,9 @@ gfxFontGroup::FindGenericFonts(FontFamilyType aGenericType,
nsAutoTArray<nsString, 5> resolvedGenerics;
ResolveGenericFontNames(aGenericType, aLanguage, resolvedGenerics);
uint32_t g = 0, numGenerics = resolvedGenerics.Length();
if (mTextPerf) {
mTextPerf->current.genericLookups++;
}
for (g = 0; g < numGenerics; g++) {
FindPlatformFont(resolvedGenerics[g], false);
}

View File

@ -1047,6 +1047,7 @@ LogTextPerfStats(gfxTextPerfMetrics* aTextPerf,
"word-cache-space: %d word-cache-long: %d "
"pref-fallbacks: %d system-fallbacks: %d "
"textruns-const: %d textruns-destr: %d "
"generic-lookups: %d "
"cumulative-textruns-destr: %d\n",
prefix, aTextPerf->reflowCount, aCounts.numChars,
(aURL ? aURL : ""),
@ -1056,6 +1057,7 @@ LogTextPerfStats(gfxTextPerfMetrics* aTextPerf,
aCounts.wordCacheSpaceRules, aCounts.wordCacheLong,
aCounts.fallbackPrefs, aCounts.fallbackSystem,
aCounts.textrunConst, aCounts.textrunDestr,
aCounts.genericLookups,
aTextPerf->cumulative.textrunDestr));
} else {
MOZ_LOG(tpLog, logLevel,
@ -1066,6 +1068,7 @@ LogTextPerfStats(gfxTextPerfMetrics* aTextPerf,
"word-cache-space: %d word-cache-long: %d "
"pref-fallbacks: %d system-fallbacks: %d "
"textruns-const: %d textruns-destr: %d "
"generic-lookups: %d "
"cumulative-textruns-destr: %d\n",
prefix, aTextPerf->reflowCount, aCounts.numChars,
aCounts.numContentTextRuns, aCounts.numChromeTextRuns,
@ -1074,6 +1077,7 @@ LogTextPerfStats(gfxTextPerfMetrics* aTextPerf,
aCounts.wordCacheSpaceRules, aCounts.wordCacheLong,
aCounts.fallbackPrefs, aCounts.fallbackSystem,
aCounts.textrunConst, aCounts.textrunDestr,
aCounts.genericLookups,
aTextPerf->cumulative.textrunDestr));
}
}