зеркало из https://github.com/mozilla/gecko-dev.git
bug 707959 - followup, move font cache telemetry into gfxFontCache::Lookup. r=roc
This commit is contained in:
Родитель
a93dfad7db
Коммит
00936eebda
|
@ -70,9 +70,6 @@
|
|||
#include "prinit.h"
|
||||
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
static PRLogModuleInfo *gFontLog = PR_NewLogModule("ft2fonts");
|
||||
|
||||
|
@ -617,7 +614,6 @@ gfxFT2Font::GetOrMakeFont(FT2FontEntry *aFontEntry, const gfxFontStyle *aStyle,
|
|||
bool aNeedsBold)
|
||||
{
|
||||
nsRefPtr<gfxFont> font = gfxFontCache::GetCache()->Lookup(aFontEntry, aStyle);
|
||||
Telemetry::Accumulate(Telemetry::FONT_CACHE_HIT, font != nsnull);
|
||||
if (!font) {
|
||||
cairo_scaled_font_t *scaledFont = aFontEntry->CreateScaledFont(aStyle);
|
||||
font = new gfxFT2Font(scaledFont, aFontEntry, aStyle, aNeedsBold);
|
||||
|
|
|
@ -205,7 +205,6 @@ gfxFontEntry::FindOrMakeFont(const gfxFontStyle *aStyle, bool aNeedsBold)
|
|||
// the font entry name is the psname, not the family name
|
||||
nsRefPtr<gfxFont> font = gfxFontCache::GetCache()->Lookup(this, aStyle);
|
||||
|
||||
Telemetry::Accumulate(Telemetry::FONT_CACHE_HIT, font != nsnull);
|
||||
if (!font) {
|
||||
gfxFont *newFont = CreateFontInstance(aStyle, aNeedsBold);
|
||||
if (!newFont)
|
||||
|
@ -1071,6 +1070,8 @@ gfxFontCache::Lookup(const gfxFontEntry *aFontEntry,
|
|||
{
|
||||
Key key(aFontEntry, aStyle);
|
||||
HashEntry *entry = mFonts.GetEntry(key);
|
||||
|
||||
Telemetry::Accumulate(Telemetry::FONT_CACHE_HIT, entry != nsnull);
|
||||
if (!entry)
|
||||
return nsnull;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче