diff --git a/gfx/thebes/gfxFontEntry.cpp b/gfx/thebes/gfxFontEntry.cpp index 50a3e887ac42..dcf7c314f0d4 100644 --- a/gfx/thebes/gfxFontEntry.cpp +++ b/gfx/thebes/gfxFontEntry.cpp @@ -1522,7 +1522,7 @@ gfxFontFamily::FindFontForChar(GlobalFontMatch *aMatchData) rank += RANK_MATCHED_CMAP; aMatchData->mCount++; - PRLogModuleInfo *log = gfxPlatform::GetLog(eGfxLog_textrun); + LogModule* log = gfxPlatform::GetLog(eGfxLog_textrun); if (MOZ_UNLIKELY(MOZ_LOG_TEST(log, LogLevel::Debug))) { uint32_t unicodeRange = FindCharUnicodeRange(aMatchData->mCh); diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index 46c365215a27..e608c459414b 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -1801,26 +1801,16 @@ gfxPlatform::FontsPrefsChanged(const char *aPref) } -PRLogModuleInfo* +mozilla::LogModule* gfxPlatform::GetLog(eGfxLog aWhichLog) { // logs shared across gfx - static PRLogModuleInfo *sFontlistLog = nullptr; - static PRLogModuleInfo *sFontInitLog = nullptr; - static PRLogModuleInfo *sTextrunLog = nullptr; - static PRLogModuleInfo *sTextrunuiLog = nullptr; - static PRLogModuleInfo *sCmapDataLog = nullptr; - static PRLogModuleInfo *sTextPerfLog = nullptr; - - // Assume that if one is initialized, all are initialized - if (!sFontlistLog) { - sFontlistLog = PR_NewLogModule("fontlist"); - sFontInitLog = PR_NewLogModule("fontinit"); - sTextrunLog = PR_NewLogModule("textrun"); - sTextrunuiLog = PR_NewLogModule("textrunui"); - sCmapDataLog = PR_NewLogModule("cmapdata"); - sTextPerfLog = PR_NewLogModule("textperf"); - } + static LazyLogModule sFontlistLog("fontlist"); + static LazyLogModule sFontInitLog("fontinit"); + static LazyLogModule sTextrunLog("textrun"); + static LazyLogModule sTextrunuiLog("textrunui"); + static LazyLogModule sCmapDataLog("cmapdata"); + static LazyLogModule sTextPerfLog("textperf"); switch (aWhichLog) { case eGfxLog_fontlist: diff --git a/gfx/thebes/gfxPlatform.h b/gfx/thebes/gfxPlatform.h index 3ab789f10f04..899ddd9dc5c7 100644 --- a/gfx/thebes/gfxPlatform.h +++ b/gfx/thebes/gfxPlatform.h @@ -531,7 +531,7 @@ public: /** * Returns a logger if one is available and logging is enabled */ - static PRLogModuleInfo* GetLog(eGfxLog aWhichLog); + static mozilla::LogModule* GetLog(eGfxLog aWhichLog); int GetScreenDepth() const { return mScreenDepth; } mozilla::gfx::IntSize GetScreenSize() const { return mScreenSize; } diff --git a/gfx/thebes/gfxPlatformFontList.cpp b/gfx/thebes/gfxPlatformFontList.cpp index e986a37090b0..b763153de955 100644 --- a/gfx/thebes/gfxPlatformFontList.cpp +++ b/gfx/thebes/gfxPlatformFontList.cpp @@ -518,7 +518,7 @@ gfxPlatformFontList::SystemFindFontForChar(uint32_t aCh, uint32_t aNextCh, } TimeDuration elapsed = TimeStamp::Now() - start; - PRLogModuleInfo *log = gfxPlatform::GetLog(eGfxLog_textrun); + LogModule* log = gfxPlatform::GetLog(eGfxLog_textrun); if (MOZ_UNLIKELY(MOZ_LOG_TEST(log, LogLevel::Warning))) { uint32_t unicodeRange = FindCharUnicodeRange(aCh); diff --git a/gfx/thebes/gfxTextRun.cpp b/gfx/thebes/gfxTextRun.cpp index f0f4ae5a8192..63f4b6912bf1 100644 --- a/gfx/thebes/gfxTextRun.cpp +++ b/gfx/thebes/gfxTextRun.cpp @@ -2135,9 +2135,9 @@ gfxFontGroup::InitTextRun(gfxContext *aContext, } } - PRLogModuleInfo *log = (mStyle.systemFont ? - gfxPlatform::GetLog(eGfxLog_textrunui) : - gfxPlatform::GetLog(eGfxLog_textrun)); + LogModule* log = mStyle.systemFont + ? gfxPlatform::GetLog(eGfxLog_textrunui) + : gfxPlatform::GetLog(eGfxLog_textrun); // variant fallback handling may end up passing through this twice bool redo; @@ -2907,9 +2907,9 @@ void gfxFontGroup::ComputeRanges(nsTArray& aRanges, aRanges[lastRangeIndex].end = aLength; #ifndef RELEASE_BUILD - PRLogModuleInfo *log = (mStyle.systemFont ? - gfxPlatform::GetLog(eGfxLog_textrunui) : - gfxPlatform::GetLog(eGfxLog_textrun)); + LogModule* log = mStyle.systemFont + ? gfxPlatform::GetLog(eGfxLog_textrunui) + : gfxPlatform::GetLog(eGfxLog_textrun); if (MOZ_UNLIKELY(MOZ_LOG_TEST(log, LogLevel::Debug))) { nsAutoCString lang; diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp index b9a8100f9cab..bde422330955 100644 --- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -253,7 +253,7 @@ nsPresContext::nsPresContext(nsIDocument* aDocument, nsPresContextType aType) mCounterStylesDirty = true; // if text perf logging enabled, init stats struct - PRLogModuleInfo *log = gfxPlatform::GetLog(eGfxLog_textperf); + LogModule* log = gfxPlatform::GetLog(eGfxLog_textperf); if (MOZ_LOG_TEST(log, LogLevel::Warning)) { mTextPerf = new gfxTextPerfMetrics(); } diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index d393c938ed82..64804b64921f 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -1006,7 +1006,7 @@ LogTextPerfStats(gfxTextPerfMetrics* aTextPerf, const gfxTextPerfMetrics::TextCounts& aCounts, float aTime, TextPerfLogType aLogType, const char* aURL) { - PRLogModuleInfo* tpLog = gfxPlatform::GetLog(eGfxLog_textperf); + LogModule* tpLog = gfxPlatform::GetLog(eGfxLog_textperf); // ignore XUL contexts unless at debug level mozilla::LogLevel logLevel = LogLevel::Warning;