Bug 1162748 - Remove instances of #ifdef PR_LOGGING in graphics. r=froydnj
authorEric Rahm <erahm@mozilla.com>
Fri, 08 May 2015 14:37:01 -0700
changeset 274439 3464d56d154dc36a8c99158abef447310867cf7e
parent 274438 b969ae256202f04f3d61618619a7216055163c70
child 274440 790507f83bf3406e7a8fb6f90b6a1a5583f4f98e
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1162748
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1162748 - Remove instances of #ifdef PR_LOGGING in graphics. r=froydnj PR_LOGGING is now always defined, we can remove #ifdefs checking for it.
gfx/2d/Factory.cpp
gfx/2d/Logging.h
gfx/layers/LayersTypes.h
gfx/layers/ipc/LayerTransactionParent.cpp
gfx/thebes/gfxDWriteFontList.cpp
gfx/thebes/gfxFT2FontList.cpp
gfx/thebes/gfxFont.cpp
gfx/thebes/gfxFontEntry.cpp
gfx/thebes/gfxFontUtils.cpp
gfx/thebes/gfxFontUtils.h
gfx/thebes/gfxGDIFontList.cpp
gfx/thebes/gfxMacPlatformFontList.mm
gfx/thebes/gfxPlatform.cpp
gfx/thebes/gfxPlatformFontList.cpp
gfx/thebes/gfxTextRun.cpp
gfx/thebes/gfxUserFontSet.cpp
gfx/thebes/gfxUserFontSet.h
--- a/gfx/2d/Factory.cpp
+++ b/gfx/2d/Factory.cpp
@@ -47,26 +47,24 @@
 #include "SourceSurfaceRawData.h"
 
 #include "DrawEventRecorder.h"
 
 #include "Logging.h"
 
 #include "mozilla/CheckedInt.h"
 
-#if defined(PR_LOGGING)
 GFX2D_API PRLogModuleInfo *
 GetGFX2DLog()
 {
   static PRLogModuleInfo *sLog;
   if (!sLog)
     sLog = PR_NewLogModule("gfx2d");
   return sLog;
 }
-#endif
 
 // The following code was largely taken from xpcom/glue/SSE.cpp and
 // made a little simpler.
 enum CPUIDRegister { eax = 0, ebx = 1, ecx = 2, edx = 3 };
 
 #ifdef HAVE_CPUID_H
 
 #if !(defined(__SSE2__) || defined(_M_X64) || \
--- a/gfx/2d/Logging.h
+++ b/gfx/2d/Logging.h
@@ -17,30 +17,17 @@
 
 #if defined(MOZ_WIDGET_GONK) || defined(MOZ_WIDGET_ANDROID)
 #include "nsDebug.h"
 #endif
 #include "Point.h"
 #include "BaseRect.h"
 #include "Matrix.h"
 
-#ifdef WIN32
-// This file gets included from nsGlobalWindow.cpp, which doesn't like
-// having windows.h included in it. Since OutputDebugStringA is the only
-// thing we need from windows.h, we just declare it here directly.
-// Note: the function's documented signature is
-//  WINBASEAPI void WINAPI OutputDebugStringA(LPCSTR lpOutputString)
-// but if we don't include windows.h, the macros WINBASEAPI, WINAPI, and 
-// LPCSTR are not defined, so we need to replace them with their expansions.
-extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA(const char* lpOutputString);
-#endif
-
-#if defined(PR_LOGGING)
 extern GFX2D_API PRLogModuleInfo *GetGFX2DLog();
-#endif
 
 namespace mozilla {
 namespace gfx {
 
 // Attempting to be consistent with prlog values, but that isn't critical
 // (and note that 5 has a special meaning - see the description
 // with sGfxLogLevel)
 const int LOG_CRITICAL = 1;
@@ -50,36 +37,32 @@ const int LOG_DEBUG_PRLOG = 4;
 const int LOG_EVERYTHING = 5; // This needs to be the highest value
 
 #if defined(DEBUG)
 const int LOG_DEFAULT = LOG_EVERYTHING;
 #else
 const int LOG_DEFAULT = LOG_CRITICAL;
 #endif
 
-#if defined(PR_LOGGING)
-
 inline PRLogModuleLevel PRLogLevelForLevel(int aLevel) {
   switch (aLevel) {
   case LOG_CRITICAL:
     return PR_LOG_ERROR;
   case LOG_WARNING:
     return PR_LOG_WARNING;
   case LOG_DEBUG:
     return PR_LOG_DEBUG;
   case LOG_DEBUG_PRLOG:
     return PR_LOG_DEBUG;
   case LOG_EVERYTHING:
     return PR_LOG_ALWAYS;
   }
   return PR_LOG_DEBUG;
 }
 
-#endif
-
 class PreferenceAccess
 {
 public:
   virtual ~PreferenceAccess();
 
   // This should connect the variable aVar to be updated whenever a preference
   // aName is modified.  aDefault would be used if the preference is undefined,
   // so that we always get the valid value for aVar.
@@ -142,29 +125,25 @@ private:
 /// we will still send a printf.
 struct BasicLogger
 {
   // For efficiency, this method exists and copies the logic of the
   // OutputMessage below.  If making any changes here, also make it
   // in the appropriate places in that method.
   static bool ShouldOutputMessage(int aLevel) {
     if (PreferenceAccess::sGfxLogLevel >= aLevel) {
-#if defined(WIN32) && !defined(PR_LOGGING)
+#if defined(MOZ_WIDGET_GONK) || defined(MOZ_WIDGET_ANDROID)
       return true;
-#elif defined(MOZ_WIDGET_GONK) || defined(MOZ_WIDGET_ANDROID)
-      return true;
-#elif defined(PR_LOGGING)
+#else
       if (PR_LOG_TEST(GetGFX2DLog(), PRLogLevelForLevel(aLevel))) {
         return true;
       } else if ((PreferenceAccess::sGfxLogLevel >= LOG_DEBUG_PRLOG) ||
                  (aLevel < LOG_DEBUG)) {
         return true;
       }
-#else
-      return true;
 #endif
     }
     return false;
   }
 
   static void OutputMessage(const std::string &aString,
                             int aLevel,
                             bool aNoNewline) {
@@ -173,29 +152,25 @@ struct BasicLogger
     // is in the build, but disabled, we will printf if the preferences
     // requires us to log something (see sGfxLogLevel for the special
     // treatment of LOG_DEBUG and LOG_DEBUG_PRLOG)
     //
     // If making any logic changes to this method, you should probably
     // make the corresponding change in the ShouldOutputMessage method
     // above.
     if (PreferenceAccess::sGfxLogLevel >= aLevel) {
-#if defined(WIN32) && !defined(PR_LOGGING)
-      ::OutputDebugStringA((aNoNewline ? aString : aString+"\n").c_str());
-#elif defined(MOZ_WIDGET_GONK) || defined(MOZ_WIDGET_ANDROID)
+#if defined(MOZ_WIDGET_GONK) || defined(MOZ_WIDGET_ANDROID)
       printf_stderr("%s%s", aString.c_str(), aNoNewline ? "" : "\n");
-#elif defined(PR_LOGGING)
+#else
       if (PR_LOG_TEST(GetGFX2DLog(), PRLogLevelForLevel(aLevel))) {
         PR_LogPrint("%s%s", aString.c_str(), aNoNewline ? "" : "\n");
       } else if ((PreferenceAccess::sGfxLogLevel >= LOG_DEBUG_PRLOG) ||
                  (aLevel < LOG_DEBUG)) {
         printf("%s%s", aString.c_str(), aNoNewline ? "" : "\n");
       }
-#else
-      printf("%s%s", aString.c_str(), aNoNewline ? "" : "\n");
 #endif
     }
   }
 };
 
 struct CriticalLogger {
   static void OutputMessage(const std::string &aString, int aLevel, bool aNoNewline);
 };
--- a/gfx/layers/LayersTypes.h
+++ b/gfx/layers/LayersTypes.h
@@ -10,30 +10,25 @@
 #include "nsPoint.h"                    // for nsIntPoint
 #include "nsRegion.h"
 
 #include "mozilla/TypedEnumBits.h"
 
 #ifdef MOZ_WIDGET_GONK
 #include <ui/GraphicBuffer.h>
 #endif
-#if defined(DEBUG) || defined(PR_LOGGING)
-#  include <stdio.h>            // FILE
-#  include "prlog.h"            // for PR_LOG
-#  ifndef MOZ_LAYERS_HAVE_LOG
-#    define MOZ_LAYERS_HAVE_LOG
-#  endif
-#  define MOZ_LAYERS_LOG(_args)                             \
+#include <stdio.h>            // FILE
+#include "prlog.h"            // for PR_LOG
+#ifndef MOZ_LAYERS_HAVE_LOG
+#  define MOZ_LAYERS_HAVE_LOG
+#endif
+#define MOZ_LAYERS_LOG(_args)                             \
   PR_LOG(LayerManager::GetLog(), PR_LOG_DEBUG, _args)
-#  define MOZ_LAYERS_LOG_IF_SHADOWABLE(layer, _args)         \
+#define MOZ_LAYERS_LOG_IF_SHADOWABLE(layer, _args)         \
   do { if (layer->AsShadowableLayer()) { PR_LOG(LayerManager::GetLog(), PR_LOG_DEBUG, _args); } } while (0)
-#else
-#  define MOZ_LAYERS_LOG(_args)
-#  define MOZ_LAYERS_LOG_IF_SHADOWABLE(layer, _args)
-#endif  // if defined(DEBUG) || defined(PR_LOGGING)
 
 #define INVALID_OVERLAY -1
 
 namespace android {
 class GraphicBuffer;
 }
 
 namespace mozilla {
--- a/gfx/layers/ipc/LayerTransactionParent.cpp
+++ b/gfx/layers/ipc/LayerTransactionParent.cpp
@@ -621,21 +621,19 @@ LayerTransactionParent::RecvUpdate(Infal
     TimeDuration latency = TimeStamp::Now() - aTransactionStart;
     if (latency > TimeDuration::FromMilliseconds(visualWarningTrigger)) {
       float severity = (latency - TimeDuration::FromMilliseconds(visualWarningTrigger)).ToMilliseconds() /
                          (4 * visualWarningTrigger);
       if (severity > 1.f) {
         severity = 1.f;
       }
       mLayerManager->VisualFrameWarning(severity);
-#ifdef PR_LOGGING
       PR_LogPrint("LayerTransactionParent::RecvUpdate transaction from process %d took %f ms",
                   OtherPid(),
                   latency.ToMilliseconds());
-#endif
     }
   }
 
   profiler_tracing("Paint", "LayerTransaction", TRACING_INTERVAL_END);
   return true;
 }
 
 bool
--- a/gfx/thebes/gfxDWriteFontList.cpp
+++ b/gfx/thebes/gfxDWriteFontList.cpp
@@ -207,28 +207,26 @@ gfxDWriteFontFamily::FindStyleVariations
             hr = GetDirectWriteFaceName(font, FULLNAME_ID, fullname);
             if (FAILED(hr)) {
                 skipFaceNames = true;
             } else if (fullname.Length() > 0) {
                 fp->AddFullname(fe, fullname);
             }
         }
 
-#ifdef PR_LOGGING
         if (LOG_FONTLIST_ENABLED()) {
             LOG_FONTLIST(("(fontlist) added (%s) to family (%s)"
                  " with style: %s weight: %d stretch: %d psname: %s fullname: %s",
                  NS_ConvertUTF16toUTF8(fe->Name()).get(),
                  NS_ConvertUTF16toUTF8(Name()).get(),
                  (fe->IsItalic()) ? "italic" : "normal",
                  fe->Weight(), fe->Stretch(),
                  NS_ConvertUTF16toUTF8(psname).get(),
                  NS_ConvertUTF16toUTF8(fullname).get()));
         }
-#endif
     }
 
     // assume that if no error, all postscript/fullnames were initialized
     if (!skipFaceNames) {
         mFaceNamesInitialized = true;
     }
 
     if (!mAvailableFonts.Length()) {
@@ -551,28 +549,26 @@ gfxDWriteFontEntry::ReadCMAP(FontInfoDat
         }
         gfxPlatformFontList *pfl = gfxPlatformFontList::PlatformFontList();
         mCharacterMap = pfl->FindCharMap(charmap);
     } else {
         // if error occurred, initialize to null cmap
         mCharacterMap = new gfxCharacterMap();
     }
 
-#ifdef PR_LOGGING
     LOG_FONTLIST(("(fontlist-cmap) name: %s, size: %d hash: %8.8x%s\n",
                   NS_ConvertUTF16toUTF8(mName).get(),
                   charmap->SizeOfIncludingThis(moz_malloc_size_of),
                   charmap->mHash, mCharacterMap == charmap ? " new" : ""));
     if (LOG_CMAPDATA_ENABLED()) {
         char prefix[256];
         sprintf(prefix, "(cmapdata) name: %.220s",
                 NS_ConvertUTF16toUTF8(mName).get());
         charmap->Dump(prefix, eGfxLog_cmapdata);
     }
-#endif
 
     return rv;
 }
 
 gfxFont *
 gfxDWriteFontEntry::CreateFontInstance(const gfxFontStyle* aFontStyle,
                                        bool aNeedsBold)
 {
@@ -1019,27 +1015,25 @@ gfxDWriteFontList::DelayedInitFontList()
         if (allUltraBold) {
 
             // add faces to Gill Sans MT
             for (i = 0; i < faces.Length(); i++) {
                 // change the entry's family name to match its adoptive family
                 faces[i]->mFamilyName = gillSansMTFamily->Name();
                 gillSansMTFamily->AddFontEntry(faces[i]);
 
-#ifdef PR_LOGGING
                 if (LOG_FONTLIST_ENABLED()) {
                     gfxFontEntry *fe = faces[i];
                     LOG_FONTLIST(("(fontlist) moved (%s) to family (%s)"
                          " with style: %s weight: %d stretch: %d",
                          NS_ConvertUTF16toUTF8(fe->Name()).get(),
                          NS_ConvertUTF16toUTF8(gillSansMTFamily->Name()).get(),
                          (fe->IsItalic()) ? "italic" : "normal",
                          fe->Weight(), fe->Stretch()));
                 }
-#endif
             }
 
             // remove Gills Sans
             mFontFamilies.Remove(nameGillSans);
         }
     }
 
     nsAdoptingCString classicFamilies =
--- a/gfx/thebes/gfxFT2FontList.cpp
+++ b/gfx/thebes/gfxFT2FontList.cpp
@@ -45,26 +45,24 @@
 #include "mozilla/Preferences.h"
 #include "mozilla/scache/StartupCache.h"
 #include <fcntl.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
 
 using namespace mozilla;
 
-#ifdef PR_LOGGING
 static PRLogModuleInfo *
 GetFontInfoLog()
 {
     static PRLogModuleInfo *sLog;
     if (!sLog)
         sLog = PR_NewLogModule("fontInfoLog");
     return sLog;
 }
-#endif /* PR_LOGGING */
 
 #undef LOG
 #define LOG(args) PR_LOG(GetFontInfoLog(), PR_LOG_DEBUG, args)
 #define LOG_ENABLED() PR_LOG_TEST(GetFontInfoLog(), PR_LOG_DEBUG)
 
 static cairo_user_data_key_t sFTUserFontDataKey;
 
 static __inline void
@@ -1050,26 +1048,24 @@ gfxFT2FontList::AddFaceToList(const nsCS
             }
         }
         fe->mStandardFace = (aStdFile == kStandard);
         family->AddFontEntry(fe);
 
         fe->CheckForBrokenFont(family);
 
         AppendToFaceList(aFaceList, name, fe);
-#ifdef PR_LOGGING
         if (LOG_ENABLED()) {
             LOG(("(fontinit) added (%s) to family (%s)"
                  " with style: %s weight: %d stretch: %d",
                  NS_ConvertUTF16toUTF8(fe->Name()).get(),
                  NS_ConvertUTF16toUTF8(family->Name()).get(),
                  fe->IsItalic() ? "italic" : "normal",
                  fe->Weight(), fe->Stretch()));
         }
-#endif
     }
 }
 
 void
 gfxFT2FontList::AppendFacesFromOmnijarEntry(nsZipArchive* aArchive,
                                             const nsCString& aEntryName,
                                             FontNameCache *aCache,
                                             bool aJarChanged)
--- a/gfx/thebes/gfxFont.cpp
+++ b/gfx/thebes/gfxFont.cpp
@@ -67,23 +67,21 @@ uint32_t gFontCount = 0;
 uint32_t gGlyphExtentsCount = 0;
 uint32_t gGlyphExtentsWidthsTotalSize = 0;
 uint32_t gGlyphExtentsSetupEagerSimple = 0;
 uint32_t gGlyphExtentsSetupEagerTight = 0;
 uint32_t gGlyphExtentsSetupLazyTight = 0;
 uint32_t gGlyphExtentsSetupFallBackToTight = 0;
 #endif
 
-#ifdef PR_LOGGING
 #define LOG_FONTINIT(args) PR_LOG(gfxPlatform::GetLog(eGfxLog_fontinit), \
                                   PR_LOG_DEBUG, args)
 #define LOG_FONTINIT_ENABLED() PR_LOG_TEST( \
                                         gfxPlatform::GetLog(eGfxLog_fontinit), \
                                         PR_LOG_DEBUG)
-#endif // PR_LOGGING
 
 
 /*
  * gfxFontCache - global cache of gfxFont instances.
  * Expires unused fonts after a short interval;
  * notifies fonts to age their cached shaped-word records;
  * observes memory-pressure notification and tells fonts to clear their
  * shaped-word caches to free up memory.
@@ -1077,23 +1075,21 @@ static const hb_tag_t defaultFeatures[] 
     HB_TAG('v','j','m','o')
 };
 
 void
 gfxFont::CheckForFeaturesInvolvingSpace()
 {
     mFontEntry->mHasSpaceFeaturesInitialized = true;
 
-#ifdef PR_LOGGING
     bool log = LOG_FONTINIT_ENABLED();
     TimeStamp start;
     if (MOZ_UNLIKELY(log)) {
         start = TimeStamp::Now();
     }
-#endif
 
     bool result = false;
 
     uint32_t spaceGlyph = GetSpaceGlyph();
     if (!spaceGlyph) {
         return;
     }
 
@@ -1180,17 +1176,16 @@ gfxFont::CheckForFeaturesInvolvingSpace(
         }
         mFontEntry->mHasSpaceFeaturesKerning = hasKerning;
         mFontEntry->mHasSpaceFeaturesNonKerning = hasNonKerning;
     }
 
     hb_face_destroy(face);
     mFontEntry->mHasSpaceFeatures = result;
 
-#ifdef PR_LOGGING
     if (MOZ_UNLIKELY(log)) {
         TimeDuration elapsed = TimeStamp::Now() - start;
         LOG_FONTINIT((
             "(fontinit-spacelookups) font: %s - "
             "subst default: %8.8x %8.8x %8.8x %8.8x "
             "subst non-default: %8.8x %8.8x %8.8x %8.8x "
             "kerning: %s non-kerning: %s time: %6.3f\n",
             NS_ConvertUTF16toUTF8(mFontEntry->Name()).get(),
@@ -1202,17 +1197,16 @@ gfxFont::CheckForFeaturesInvolvingSpace(
             mFontEntry->mNonDefaultSubSpaceFeatures[2],
             mFontEntry->mNonDefaultSubSpaceFeatures[1],
             mFontEntry->mNonDefaultSubSpaceFeatures[0],
             (mFontEntry->mHasSpaceFeaturesKerning ? "true" : "false"),
             (mFontEntry->mHasSpaceFeaturesNonKerning ? "true" : "false"),
             elapsed.ToMilliseconds()
         ));
     }
-#endif
 }
 
 bool
 gfxFont::HasSubstitutionRulesWithSpaceLookups(int32_t aRunScript)
 {
     NS_ASSERTION(GetFontEntry()->mHasSpaceFeaturesInitialized,
                  "need to initialize space lookup flags");
     NS_ASSERTION(aRunScript < MOZ_NUM_SCRIPT_CODES, "weird script code");
--- a/gfx/thebes/gfxFontEntry.cpp
+++ b/gfx/thebes/gfxFontEntry.cpp
@@ -1471,30 +1471,29 @@ gfxFontFamily::FindFontForChar(GlobalFon
                          needsBold);
 
     if (fe && !fe->SkipDuringSystemFallback()) {
         int32_t rank = 0;
 
         if (fe->HasCharacter(aMatchData->mCh)) {
             rank += RANK_MATCHED_CMAP;
             aMatchData->mCount++;
-#ifdef PR_LOGGING
+
             PRLogModuleInfo *log = gfxPlatform::GetLog(eGfxLog_textrun);
 
             if (MOZ_UNLIKELY(PR_LOG_TEST(log, PR_LOG_DEBUG))) {
                 uint32_t unicodeRange = FindCharUnicodeRange(aMatchData->mCh);
                 uint32_t script = GetScriptCode(aMatchData->mCh);
                 PR_LOG(log, PR_LOG_DEBUG,\
                        ("(textrun-systemfallback-fonts) char: u+%6.6x "
                         "unicode-range: %d script: %d match: [%s]\n",
                         aMatchData->mCh,
                         unicodeRange, script,
                         NS_ConvertUTF16toUTF8(fe->Name()).get()));
             }
-#endif
         }
 
         aMatchData->mCmapsTested++;
         if (rank == 0) {
             return;
         }
 
          // omitting from original windows code -- family name, lang group, pitch
--- a/gfx/thebes/gfxFontUtils.cpp
+++ b/gfx/thebes/gfxFontUtils.cpp
@@ -20,23 +20,19 @@
 #include "nsIUUIDGenerator.h"
 #include "nsIUnicodeDecoder.h"
 
 #include "harfbuzz/hb.h"
 
 #include "plbase64.h"
 #include "prlog.h"
 
-#ifdef PR_LOGGING
-
 #define LOG(log, args) PR_LOG(gfxPlatform::GetLog(log), \
                                PR_LOG_DEBUG, args)
 
-#endif // PR_LOGGING
-
 #define UNICODE_BMP_LIMIT 0x10000
 
 using namespace mozilla;
 
 #pragma pack(1)
 
 typedef struct {
     AutoSwap_PRUint16 format;
@@ -58,17 +54,16 @@ typedef struct {
 typedef struct {
     AutoSwap_PRUint32 startCharCode;
     AutoSwap_PRUint32 endCharCode;
     AutoSwap_PRUint32 startGlyphId;
 } Format12Group;
 
 #pragma pack()
 
-#if PR_LOGGING
 void
 gfxSparseBitSet::Dump(const char* aPrefix, eGfxLog aWhichLog) const
 {
     NS_ASSERTION(mBlocks.DebugGetHeader(), "mHdr is null, this is bad");
     uint32_t b, numBlocks = mBlocks.Length();
 
     for (b = 0; b < numBlocks; b++) {
         Block *block = mBlocks[b];
@@ -86,17 +81,16 @@ gfxSparseBitSet::Dump(const char* aPrefi
                 index += sprintf(&outStr[index], "%2.2x", flipped);
             }
             if (i + 4 != 32) index += sprintf(&outStr[index], " ");
         }
         index += sprintf(&outStr[index], "]");
         LOG(aWhichLog, ("%s", outStr));
     }
 }
-#endif
 
 nsresult
 gfxFontUtils::ReadCMAPTableFormat10(const uint8_t *aBuf, uint32_t aLength,
                                     gfxSparseBitSet& aCharacterMap)
 {
     // Ensure table is large enough that we can safely read the header
     NS_ENSURE_TRUE(aLength >= sizeof(Format10CmapHeader),
                     NS_ERROR_GFX_CMAP_MALFORMED);
--- a/gfx/thebes/gfxFontUtils.h
+++ b/gfx/thebes/gfxFontUtils.h
@@ -76,20 +76,18 @@ public:
         if (blockIndex >= mBlocks.Length())
             return false;
         Block *block = mBlocks[blockIndex];
         if (!block)
             return false;
         return ((block->mBits[(aIndex>>3) & (BLOCK_SIZE - 1)]) & (1 << (aIndex & 0x7))) != 0;
     }
 
-#if PR_LOGGING
     // dump out contents of bitmap
     void Dump(const char* aPrefix, eGfxLog aWhichLog) const;
-#endif
 
     bool TestRange(uint32_t aStart, uint32_t aEnd) {
         uint32_t startBlock, endBlock, blockLen;
         
         // start point is beyond the end of the block array? return false immediately
         startBlock = aStart >> BLOCK_INDEX_SHIFT;
         blockLen = mBlocks.Length();
         if (startBlock >= blockLen) return false;
--- a/gfx/thebes/gfxGDIFontList.cpp
+++ b/gfx/thebes/gfxGDIFontList.cpp
@@ -35,29 +35,26 @@ using namespace mozilla;
 
 #define ROUND(x) floor((x) + 0.5)
 
 
 #ifndef CLEARTYPE_QUALITY
 #define CLEARTYPE_QUALITY 5
 #endif
 
-#ifdef PR_LOGGING
 #define LOG_FONTLIST(args) PR_LOG(gfxPlatform::GetLog(eGfxLog_fontlist), \
                                PR_LOG_DEBUG, args)
 #define LOG_FONTLIST_ENABLED() PR_LOG_TEST( \
                                    gfxPlatform::GetLog(eGfxLog_fontlist), \
                                    PR_LOG_DEBUG)
 
 #define LOG_CMAPDATA_ENABLED() PR_LOG_TEST( \
                                    gfxPlatform::GetLog(eGfxLog_cmapdata), \
                                    PR_LOG_DEBUG)
 
-#endif // PR_LOGGING
-
 static __inline void
 BuildKeyNameFromFontName(nsAString &aName)
 {
     if (aName.Length() >= LF_FACESIZE)
         aName.Truncate(LF_FACESIZE - 1);
     ToLowerCase(aName);
 }
 
@@ -190,28 +187,26 @@ GDIFontEntry::ReadCMAP(FontInfoData *aFo
     } else {
         // if error occurred, initialize to null cmap
         mCharacterMap = new gfxCharacterMap();
         // For fonts where we failed to read the character map,
         // we can take a slow path to look up glyphs character by character
         mCharacterMap->mBuildOnTheFly = true;
     }
 
-#ifdef PR_LOGGING
     LOG_FONTLIST(("(fontlist-cmap) name: %s, size: %d hash: %8.8x%s\n",
                   NS_ConvertUTF16toUTF8(mName).get(),
                   charmap->SizeOfIncludingThis(moz_malloc_size_of),
                   charmap->mHash, mCharacterMap == charmap ? " new" : ""));
     if (LOG_CMAPDATA_ENABLED()) {
         char prefix[256];
         sprintf(prefix, "(cmapdata) name: %.220s",
                 NS_ConvertUTF16toUTF8(mName).get());
         charmap->Dump(prefix, eGfxLog_cmapdata);
     }
-#endif
 
     return rv;
 }
 
 bool
 GDIFontEntry::IsSymbolFont()
 {
     // initialize cmap first
@@ -496,26 +491,24 @@ GDIFontFamily::FamilyAddStylesProc(const
         for (uint32_t i = 0; i < 4; ++i) {
             DWORD range = nmetrics->ntmFontSig.fsUsb[i];
             for (uint32_t k = 0; k < 32; ++k) {
                 fe->mUnicodeRanges.set(x++, (range & (1 << k)) != 0);
             }
         }
     }
 
-#ifdef PR_LOGGING
     if (LOG_FONTLIST_ENABLED()) {
         LOG_FONTLIST(("(fontlist) added (%s) to family (%s)"
              " with style: %s weight: %d stretch: %d",
              NS_ConvertUTF16toUTF8(fe->Name()).get(), 
              NS_ConvertUTF16toUTF8(ff->Name()).get(), 
              (logFont.lfItalic == 0xff) ? "italic" : "normal",
              logFont.lfWeight, fe->Stretch()));
     }
-#endif
     return 1;
 }
 
 void
 GDIFontFamily::FindStyleVariations(FontInfoData *aFontInfoData)
 {
     if (mHasStyles)
         return;
--- a/gfx/thebes/gfxMacPlatformFontList.mm
+++ b/gfx/thebes/gfxMacPlatformFontList.mm
@@ -124,29 +124,25 @@ static void GetStringForNSString(const N
 }
 
 static NSString* GetNSStringForString(const nsAString& aSrc)
 {
     return [NSString stringWithCharacters:reinterpret_cast<const unichar*>(aSrc.BeginReading())
                                    length:aSrc.Length()];
 }
 
-#ifdef PR_LOGGING
-
 #define LOG_FONTLIST(args) PR_LOG(gfxPlatform::GetLog(eGfxLog_fontlist), \
                                PR_LOG_DEBUG, args)
 #define LOG_FONTLIST_ENABLED() PR_LOG_TEST( \
                                    gfxPlatform::GetLog(eGfxLog_fontlist), \
                                    PR_LOG_DEBUG)
 #define LOG_CMAPDATA_ENABLED() PR_LOG_TEST( \
                                    gfxPlatform::GetLog(eGfxLog_cmapdata), \
                                    PR_LOG_DEBUG)
 
-#endif // PR_LOGGING
-
 #pragma mark-
 
 // Complex scripts will not render correctly unless appropriate AAT or OT
 // layout tables are present.
 // For OpenType, we also check that the GSUB table supports the relevant
 // script tag, to avoid using things like Arial Unicode MS for Lao (it has
 // the characters, but lacks OpenType support).
 
@@ -233,28 +229,26 @@ MacOSFontEntry::ReadCMAP(FontInfoData *a
     if (mHasCmapTable) {
         gfxPlatformFontList *pfl = gfxPlatformFontList::PlatformFontList();
         mCharacterMap = pfl->FindCharMap(charmap);
     } else {
         // if error occurred, initialize to null cmap
         mCharacterMap = new gfxCharacterMap();
     }
 
-#ifdef PR_LOGGING
     LOG_FONTLIST(("(fontlist-cmap) name: %s, size: %d hash: %8.8x%s\n",
                   NS_ConvertUTF16toUTF8(mName).get(),
                   charmap->SizeOfIncludingThis(moz_malloc_size_of),
                   charmap->mHash, mCharacterMap == charmap ? " new" : ""));
     if (LOG_CMAPDATA_ENABLED()) {
         char prefix[256];
         sprintf(prefix, "(cmapdata) name: %.220s",
                 NS_ConvertUTF16toUTF8(mName).get());
         charmap->Dump(prefix, eGfxLog_cmapdata);
     }
-#endif
 
     return rv;
 }
 
 gfxFont*
 MacOSFontEntry::CreateFontInstance(const gfxFontStyle *aFontStyle, bool aNeedsBold)
 {
     return new gfxMacFont(this, aFontStyle, aNeedsBold);
@@ -537,28 +531,26 @@ gfxMacFontFamily::FindStyleVariations(Fo
             [facename hasSuffix:@"Oblique"])
         {
             fontEntry->mItalic = true;
         }
         if (macTraits & NSFixedPitchFontMask) {
             fontEntry->mFixedPitch = true;
         }
 
-#ifdef PR_LOGGING
         if (LOG_FONTLIST_ENABLED()) {
             LOG_FONTLIST(("(fontlist) added (%s) to family (%s)"
                  " with style: %s weight: %d stretch: %d"
                  " (apple-weight: %d macTraits: %8.8x)",
                  NS_ConvertUTF16toUTF8(fontEntry->Name()).get(), 
                  NS_ConvertUTF16toUTF8(Name()).get(), 
                  fontEntry->IsItalic() ? "italic" : "normal",
                  cssWeight, fontEntry->Stretch(),
                  appKitWeight, macTraits));
         }
-#endif
 
         // insert into font entry array of family
         AddFontEntry(fontEntry);
     }
 
     SortAvailableFonts();
     SetHasStyles(true);
 
@@ -747,47 +739,41 @@ gfxMacPlatformFontList::InitFontList()
 void
 gfxMacPlatformFontList::InitSingleFaceList()
 {
     nsAutoTArray<nsString, 10> singleFaceFonts;
     gfxFontUtils::GetPrefsFontList("font.single-face-list", singleFaceFonts);
 
     uint32_t numFonts = singleFaceFonts.Length();
     for (uint32_t i = 0; i < numFonts; i++) {
-#ifdef PR_LOGGING
         LOG_FONTLIST(("(fontlist-singleface) face name: %s\n",
                       NS_ConvertUTF16toUTF8(singleFaceFonts[i]).get()));
-#endif
         gfxFontEntry *fontEntry = LookupLocalFont(singleFaceFonts[i],
                                                   400, 0,
                                                   NS_FONT_STYLE_NORMAL);
         if (fontEntry) {
             nsAutoString familyName, key;
             familyName = singleFaceFonts[i];
             GenerateFontListKey(familyName, key);
-#ifdef PR_LOGGING
             LOG_FONTLIST(("(fontlist-singleface) family name: %s, key: %s\n",
                           NS_ConvertUTF16toUTF8(familyName).get(),
                           NS_ConvertUTF16toUTF8(key).get()));
-#endif
 
             // add only if doesn't exist already
             if (!mFontFamilies.GetWeak(key)) {
                 gfxFontFamily *familyEntry =
                     new gfxSingleFaceMacFontFamily(familyName);
                 // LookupLocalFont sets this, need to clear
                 fontEntry->mIsLocalUserFont = false;
                 familyEntry->AddFontEntry(fontEntry);
                 familyEntry->SetHasStyles(true);
                 mFontFamilies.Put(key, familyEntry);
-#ifdef PR_LOGGING
                 LOG_FONTLIST(("(fontlist-singleface) added new family\n",
                               NS_ConvertUTF16toUTF8(familyName).get(),
                               NS_ConvertUTF16toUTF8(key).get()));
-#endif
             }
         }
     }
 }
 
 bool
 gfxMacPlatformFontList::GetStandardFamilyName(const nsAString& aFontName, nsAString& aFamilyName)
 {
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -2078,17 +2078,16 @@ gfxPlatform::FontsPrefsChanged(const cha
     }
 }
 
 
 PRLogModuleInfo*
 gfxPlatform::GetLog(eGfxLog aWhichLog)
 {
     // logs shared across gfx
-#ifdef PR_LOGGING
     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
@@ -2120,19 +2119,16 @@ gfxPlatform::GetLog(eGfxLog aWhichLog)
     case eGfxLog_textperf:
         return sTextPerfLog;
         break;
     default:
         break;
     }
 
     return nullptr;
-#else
-    return nullptr;
-#endif
 }
 
 int
 gfxPlatform::GetScreenDepth() const
 {
     NS_WARNING("GetScreenDepth not implemented on this platform -- returning 0!");
     return 0;
 }
--- a/gfx/thebes/gfxPlatformFontList.cpp
+++ b/gfx/thebes/gfxPlatformFontList.cpp
@@ -18,31 +18,27 @@
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/gfx/2D.h"
 
 using namespace mozilla;
 
-#ifdef PR_LOGGING
-
 #define LOG_FONTLIST(args) PR_LOG(gfxPlatform::GetLog(eGfxLog_fontlist), \
                                PR_LOG_DEBUG, args)
 #define LOG_FONTLIST_ENABLED() PR_LOG_TEST( \
                                    gfxPlatform::GetLog(eGfxLog_fontlist), \
                                    PR_LOG_DEBUG)
 #define LOG_FONTINIT(args) PR_LOG(gfxPlatform::GetLog(eGfxLog_fontinit), \
                                PR_LOG_DEBUG, args)
 #define LOG_FONTINIT_ENABLED() PR_LOG_TEST( \
                                    gfxPlatform::GetLog(eGfxLog_fontinit), \
                                    PR_LOG_DEBUG)
 
-#endif // PR_LOGGING
-
 gfxPlatformFontList *gfxPlatformFontList::sPlatformFontList = nullptr;
 
 // Character ranges that require complex-script shaping support in the font,
 // and so should be masked out by ReadCMAP if the necessary layout tables
 // are not present.
 // Currently used by the Mac and FT2 implementations only, but probably should
 // be supported on Windows as well.
 const gfxFontEntry::ScriptRange gfxPlatformFontList::sComplexScriptRanges[] = {
@@ -263,24 +259,22 @@ gfxPlatformFontList::InitOtherFamilyName
 
     if (!otherNamesData.mTimedOut) {
         mOtherFamilyNamesInitialized = true;
     }
     TimeStamp end = TimeStamp::Now();
     Telemetry::AccumulateTimeDelta(Telemetry::FONTLIST_INITOTHERFAMILYNAMES,
                                    start, end);
 
-#ifdef PR_LOGGING
     if (LOG_FONTINIT_ENABLED()) {
         TimeDuration elapsed = end - start;
         LOG_FONTINIT(("(fontinit) InitOtherFamilyNames took %8.2f ms %s",
                       elapsed.ToMilliseconds(),
                       (otherNamesData.mTimedOut ? "timeout" : "")));
     }
-#endif
 }
 
 #define OTHERNAMES_TIMEOUT 200
 
 PLDHashOperator
 gfxPlatformFontList::InitOtherFamilyNamesProc(nsStringHashKey::KeyType aKey,
                                               nsRefPtr<gfxFontFamily>& aFamilyEntry,
                                               void* userArg)
@@ -323,25 +317,23 @@ gfxPlatformFontList::SearchFamiliesForFa
     faceNameListsData.mFirstChar = ToLowerCase(aFaceName.CharAt(0));
     mFontFamilies.Enumerate(gfxPlatformFontList::ReadFaceNamesProc,
                             &faceNameListsData);
     lookup = FindFaceName(aFaceName);
 
     TimeStamp end = TimeStamp::Now();
     Telemetry::AccumulateTimeDelta(Telemetry::FONTLIST_INITFACENAMELISTS,
                                    start, end);
-#ifdef PR_LOGGING
     if (LOG_FONTINIT_ENABLED()) {
         TimeDuration elapsed = end - start;
         LOG_FONTINIT(("(fontinit) SearchFamiliesForFaceName took %8.2f ms %s %s",
                       elapsed.ToMilliseconds(),
                       (lookup ? "found name" : ""),
                       (faceNameListsData.mTimedOut ? "timeout" : "")));
     }
-#endif
 
     return lookup;
 }
 
 // time limit for loading facename lists (ms)
 #define NAMELIST_TIMEOUT  200
 
 PLDHashOperator
@@ -581,34 +573,32 @@ gfxPlatformFontList::SystemFindFontForCh
     uint32_t cmapCount = 0;
     if (!fontEntry) {
         common = false;
         fontEntry = GlobalFontFallback(aCh, aRunScript, aStyle, cmapCount,
                                        &fallbackFamily);
     }
     TimeDuration elapsed = TimeStamp::Now() - start;
 
-#ifdef PR_LOGGING
     PRLogModuleInfo *log = gfxPlatform::GetLog(eGfxLog_textrun);
 
     if (MOZ_UNLIKELY(PR_LOG_TEST(log, PR_LOG_WARNING))) {
         uint32_t unicodeRange = FindCharUnicodeRange(aCh);
         int32_t script = mozilla::unicode::GetScriptCode(aCh);
         PR_LOG(log, PR_LOG_WARNING,\
                ("(textrun-systemfallback-%s) char: u+%6.6x "
                  "unicode-range: %d script: %d match: [%s]"
                 " time: %dus cmaps: %d\n",
                 (common ? "common" : "global"), aCh,
                  unicodeRange, script,
                 (fontEntry ? NS_ConvertUTF16toUTF8(fontEntry->Name()).get() :
                     "<none>"),
                 int32_t(elapsed.ToMicroseconds()),
                 cmapCount));
     }
-#endif
 
     // no match? add to set of non-matching codepoints
     if (!fontEntry) {
         mCodepointsWithNoFonts.set(aCh);
     } else if (aCh == 0xFFFD && fontEntry && fallbackFamily) {
         mReplacementCharFallbackFamily = fallbackFamily;
     }
  
@@ -813,50 +803,44 @@ gfxPlatformFontList::SetPrefFontFamilyEn
 void 
 gfxPlatformFontList::AddOtherFamilyName(gfxFontFamily *aFamilyEntry, nsAString& aOtherFamilyName)
 {
     nsAutoString key;
     GenerateFontListKey(aOtherFamilyName, key);
 
     if (!mOtherFamilyNames.GetWeak(key)) {
         mOtherFamilyNames.Put(key, aFamilyEntry);
-#ifdef PR_LOGGING
         LOG_FONTLIST(("(fontlist-otherfamily) canonical family: %s, "
                       "other family: %s\n",
                       NS_ConvertUTF16toUTF8(aFamilyEntry->Name()).get(),
                       NS_ConvertUTF16toUTF8(aOtherFamilyName).get()));
-#endif
         if (mBadUnderlineFamilyNames.Contains(key))
             aFamilyEntry->SetBadUnderlineFamily();
     }
 }
 
 void
 gfxPlatformFontList::AddFullname(gfxFontEntry *aFontEntry, nsAString& aFullname)
 {
     if (!mExtraNames->mFullnames.GetWeak(aFullname)) {
         mExtraNames->mFullnames.Put(aFullname, aFontEntry);
-#ifdef PR_LOGGING
         LOG_FONTLIST(("(fontlist-fullname) name: %s, fullname: %s\n",
                       NS_ConvertUTF16toUTF8(aFontEntry->Name()).get(),
                       NS_ConvertUTF16toUTF8(aFullname).get()));
-#endif
     }
 }
 
 void
 gfxPlatformFontList::AddPostscriptName(gfxFontEntry *aFontEntry, nsAString& aPostscriptName)
 {
     if (!mExtraNames->mPostscriptNames.GetWeak(aPostscriptName)) {
         mExtraNames->mPostscriptNames.Put(aPostscriptName, aFontEntry);
-#ifdef PR_LOGGING
         LOG_FONTLIST(("(fontlist-postscript) name: %s, psname: %s\n",
                       NS_ConvertUTF16toUTF8(aFontEntry->Name()).get(),
                       NS_ConvertUTF16toUTF8(aPostscriptName).get()));
-#endif
     }
 }
 
 bool
 gfxPlatformFontList::GetStandardFamilyName(const nsAString& aFontName, nsAString& aFamilyName)
 {
     aFamilyName.Truncate();
     gfxFontFamily *ff = FindFamily(aFontName);
@@ -962,23 +946,21 @@ gfxPlatformFontList::LoadFontInfo()
             endIndex = i + 1;
             break;
         }
     }
 
     mStartIndex = endIndex;
     bool done = mStartIndex >= mNumFamilies;
 
-#ifdef PR_LOGGING
     if (LOG_FONTINIT_ENABLED()) {
         TimeDuration elapsed = TimeStamp::Now() - start;
         LOG_FONTINIT(("(fontinit) fontloader load pass %8.2f ms done %s\n",
                       elapsed.ToMilliseconds(), (done ? "true" : "false")));
     }
-#endif
 
     if (done) {
         mOtherFamilyNamesInitialized = true;
         mFaceNameListsInitialized = true;
     }
 
     return done;
 }
@@ -1052,31 +1034,29 @@ gfxPlatformFontList::CleanupLoader()
                                             &othernamesdata);
         mOtherNamesMissed = nullptr;
         if (othernamesdata.mFoundName) {
             forceReflow = true;
             ForceGlobalReflow();
         }
     }
 
-#ifdef PR_LOGGING
     if (LOG_FONTINIT_ENABLED() && mFontInfo) {
         LOG_FONTINIT(("(fontinit) fontloader load thread took %8.2f ms "
                       "%d families %d fonts %d cmaps "
                       "%d facenames %d othernames %s %s",
                       mLoadTime.ToMilliseconds(),
                       mFontInfo->mLoadStats.families,
                       mFontInfo->mLoadStats.fonts,
                       mFontInfo->mLoadStats.cmaps,
                       mFontInfo->mLoadStats.facenames,
                       mFontInfo->mLoadStats.othernames,
                       (rebuilt ? "(userfont sets rebuilt)" : ""),
                       (forceReflow ? "(global reflow)" : "")));
     }
-#endif
 
     gfxFontInfoLoader::CleanupLoader();
 }
 
 void
 gfxPlatformFontList::GetPrefsAndStartLoader()
 {
     mIncrement =
--- a/gfx/thebes/gfxTextRun.cpp
+++ b/gfx/thebes/gfxTextRun.cpp
@@ -2194,30 +2194,27 @@ gfxFontGroup::InitTextRun(gfxContext *aC
             }
             if (transformedString) {
                 transformedString[i] = newCh;
             }
             prevIsArabic = IS_ARABIC_CHAR(newCh);
         }
     }
 
-#ifdef PR_LOGGING
     PRLogModuleInfo *log = (mStyle.systemFont ?
                             gfxPlatform::GetLog(eGfxLog_textrunui) :
                             gfxPlatform::GetLog(eGfxLog_textrun));
-#endif
 
     // variant fallback handling may end up passing through this twice
     bool redo;
     do {
         redo = false;
 
         if (sizeof(T) == sizeof(uint8_t) && !transformedString) {
 
-#ifdef PR_LOGGING
             if (MOZ_UNLIKELY(PR_LOG_TEST(log, PR_LOG_WARNING))) {
                 nsAutoCString lang;
                 mStyle.language->ToUTF8String(lang);
                 nsAutoString families;
                 mFamilyList.ToString(families);
                 nsAutoCString str((const char*)aString, aLength);
                 PR_LOG(log, PR_LOG_WARNING,\
                        ("(%s) fontgroup: [%s] default: %s lang: %s script: %d "
@@ -2233,17 +2230,16 @@ gfxFontGroup::InitTextRun(gfxContext *aC
                         uint32_t(mStyle.weight), uint32_t(mStyle.stretch),
                         (mStyle.style & NS_FONT_STYLE_ITALIC ? "italic" :
                         (mStyle.style & NS_FONT_STYLE_OBLIQUE ? "oblique" :
                                                                 "normal")),
                         mStyle.size,
                         sizeof(T),
                         str.get()));
             }
-#endif
 
             // the text is still purely 8-bit; bypass the script-run itemizer
             // and treat it as a single Latin run
             InitScriptRun(aContext, aTextRun, aString,
                           0, aLength, MOZ_SCRIPT_LATIN, aMFR);
         } else {
             const char16_t *textPtr;
             if (transformedString) {
@@ -2257,17 +2253,16 @@ gfxFontGroup::InitTextRun(gfxContext *aC
             // split into script runs so that script can potentially influence
             // the font matching process below
             gfxScriptItemizer scriptRuns(textPtr, aLength);
 
             uint32_t runStart = 0, runLimit = aLength;
             int32_t runScript = MOZ_SCRIPT_LATIN;
             while (scriptRuns.Next(runStart, runLimit, runScript)) {
 
-    #ifdef PR_LOGGING
                 if (MOZ_UNLIKELY(PR_LOG_TEST(log, PR_LOG_WARNING))) {
                     nsAutoCString lang;
                     mStyle.language->ToUTF8String(lang);
                     nsAutoString families;
                     mFamilyList.ToString(families);
                     uint32_t runLen = runLimit - runStart;
                     PR_LOG(log, PR_LOG_WARNING,\
                            ("(%s) fontgroup: [%s] default: %s lang: %s script: %d "
@@ -2283,17 +2278,16 @@ gfxFontGroup::InitTextRun(gfxContext *aC
                             uint32_t(mStyle.weight), uint32_t(mStyle.stretch),
                             (mStyle.style & NS_FONT_STYLE_ITALIC ? "italic" :
                             (mStyle.style & NS_FONT_STYLE_OBLIQUE ? "oblique" :
                                                                     "normal")),
                             mStyle.size,
                             sizeof(T),
                             NS_ConvertUTF16toUTF8(textPtr + runStart, runLen).get()));
                 }
-    #endif
 
                 InitScriptRun(aContext, aTextRun, textPtr + runStart,
                               runStart, runLimit - runStart, runScript, aMFR);
             }
         }
 
         // if shaping was aborted due to lack of feature support, clear out
         // glyph runs and redo shaping with fallback forced on
--- a/gfx/thebes/gfxUserFontSet.cpp
+++ b/gfx/thebes/gfxUserFontSet.cpp
@@ -19,26 +19,24 @@
 #include "mozilla/gfx/2D.h"
 #include "gfxPlatformFontList.h"
 
 #include "opentype-sanitiser.h"
 #include "ots-memory-stream.h"
 
 using namespace mozilla;
 
-#ifdef PR_LOGGING
 PRLogModuleInfo*
 gfxUserFontSet::GetUserFontsLog()
 {
     static PRLogModuleInfo* sLog;
     if (!sLog)
         sLog = PR_NewLogModule("userfonts");
     return sLog;
 }
-#endif /* PR_LOGGING */
 
 #define LOG(args) PR_LOG(gfxUserFontSet::GetUserFontsLog(), PR_LOG_DEBUG, args)
 #define LOG_ENABLED() PR_LOG_TEST(gfxUserFontSet::GetUserFontsLog(), PR_LOG_DEBUG)
 
 static uint64_t sFontSetGeneration = 0;
 
 // Based on ots::ExpandingMemoryStream from ots-memory-stream.h,
 // adapted to use Mozilla allocators and to allow the final
@@ -496,25 +494,23 @@ gfxUserFontEntry::LoadNextSrc()
                         }
 
                     } else {
                         // otherwise load font async
                         rv = mFontSet->StartLoad(this, &currSrc);
                         bool loadOK = NS_SUCCEEDED(rv);
 
                         if (loadOK) {
-#ifdef PR_LOGGING
                             if (LOG_ENABLED()) {
                                 nsAutoCString fontURI;
                                 currSrc.mURI->GetSpec(fontURI);
                                 LOG(("userfonts (%p) [src %d] loading uri: (%s) for (%s)\n",
                                      mFontSet, mSrcIndex, fontURI.get(),
                                      NS_ConvertUTF16toUTF8(mFamilyName).get()));
                             }
-#endif
                             return;
                         } else {
                             mFontSet->LogMessage(this,
                                                  "download failed",
                                                  nsIScriptError::errorFlag,
                                                  rv);
                         }
                     }
@@ -641,41 +637,37 @@ gfxUserFontEntry::LoadPlatformFont(const
 
         // copy OpenType feature/language settings from the userfont entry to the
         // newly-created font entry
         fe->mFeatureSettings.AppendElements(mFeatureSettings);
         fe->mLanguageOverride = mLanguageOverride;
         fe->mFamilyName = mFamilyName;
         StoreUserFontData(fe, mFontSet->GetPrivateBrowsing(), originalFullName,
                           &metadata, metaOrigLen, compression);
-#ifdef PR_LOGGING
         if (LOG_ENABLED()) {
             nsAutoCString fontURI;
             mSrcList[mSrcIndex].mURI->GetSpec(fontURI);
             LOG(("userfonts (%p) [src %d] loaded uri: (%s) for (%s) (%p) gen: %8.8x\n",
                  mFontSet, mSrcIndex, fontURI.get(),
                  NS_ConvertUTF16toUTF8(mFamilyName).get(),
                  this,
                  uint32_t(mFontSet->mGeneration)));
         }
-#endif
         mPlatformFontEntry = fe;
         SetLoadState(STATUS_LOADED);
         gfxUserFontSet::UserFontCache::CacheFont(fe);
     } else {
-#ifdef PR_LOGGING
         if (LOG_ENABLED()) {
             nsAutoCString fontURI;
             mSrcList[mSrcIndex].mURI->GetSpec(fontURI);
             LOG(("userfonts (%p) [src %d] failed uri: (%s) for (%s)"
                  " error making platform font\n",
                  mFontSet, mSrcIndex, fontURI.get(),
                  NS_ConvertUTF16toUTF8(mFamilyName).get()));
         }
-#endif
     }
 
     // The downloaded data can now be discarded; the font entry is using the
     // sanitized copy
     free((void*)aFontData);
 
     return fe != nullptr;
 }
@@ -843,25 +835,23 @@ gfxUserFontSet::FindExistingUserFontEntr
 
 void
 gfxUserFontSet::AddUserFontEntry(const nsAString& aFamilyName,
                                  gfxUserFontEntry* aUserFontEntry)
 {
     gfxUserFontFamily* family = GetFamily(aFamilyName);
     family->AddFontEntry(aUserFontEntry);
 
-#ifdef PR_LOGGING
     if (LOG_ENABLED()) {
         LOG(("userfonts (%p) added to \"%s\" (%p) style: %s weight: %d "
              "stretch: %d",
              this, NS_ConvertUTF16toUTF8(aFamilyName).get(), aUserFontEntry,
              (aUserFontEntry->IsItalic() ? "italic" : "normal"),
              aUserFontEntry->Weight(), aUserFontEntry->Stretch()));
     }
-#endif
 }
 
 gfxUserFontEntry*
 gfxUserFontSet::FindUserFontEntryAndLoad(gfxFontFamily* aFamily,
                                          const gfxFontStyle& aFontStyle,
                                          bool& aNeedsBold,
                                          bool& aWaitForUserFont)
 {
--- a/gfx/thebes/gfxUserFontSet.h
+++ b/gfx/thebes/gfxUserFontSet.h
@@ -462,19 +462,17 @@ public:
 
         static nsTHashtable<Entry>* sUserFonts;
     };
 
     void SetLocalRulesUsed() {
         mLocalRulesUsed = true;
     }
 
-#ifdef PR_LOGGING
     static PRLogModuleInfo* GetUserFontsLog();
-#endif
 
 protected:
     // Protected destructor, to discourage deletion outside of Release():
     virtual ~gfxUserFontSet();
 
     // Return whether the font set is associated with a private-browsing tab.
     virtual bool GetPrivateBrowsing() = 0;