Bug 1536128 - Make apz.printtree work on non-debug builds. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 18 Mar 2019 18:42:04 +0000
changeset 464906 195e208318babe02ee96b45a688ba44317536af2
parent 464905 8cc6d8a40f542d0150284e4c0cfc8355034d09b2
child 464907 93efe527cad27e2b48df8c1e9787d489da1dfff1
push id35727
push userdvarga@mozilla.com
push dateTue, 19 Mar 2019 09:48:59 +0000
treeherdermozilla-central@70baa37ae1eb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1536128
milestone68.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 1536128 - Make apz.printtree work on non-debug builds. r=botond This eliminates the need to additionally modify gfx.logging.level on non-debug builds to make apz.printtree output show up. Differential Revision: https://phabricator.services.mozilla.com/D23880
gfx/2d/CaptureCommandList.h
gfx/2d/DrawCommand.h
gfx/2d/DrawCommands.h
gfx/2d/DrawTargetCapture.cpp
gfx/2d/Logging.h
gfx/layers/apz/src/APZCTreeManager.cpp
gfx/layers/apz/src/APZCTreeManager.h
--- a/gfx/2d/CaptureCommandList.h
+++ b/gfx/2d/CaptureCommandList.h
@@ -103,17 +103,17 @@ class CaptureCommandList {
     }
 
    private:
     CaptureCommandList& mParent;
     uint8_t* mCurrent;
     uint8_t* mEnd;
   };
 
-  void Log(TreeLog& aStream) {
+  void Log(TreeLog<>& aStream) {
     for (iterator iter(*this); !iter.Done(); iter.Next()) {
       DrawingCommand* cmd = iter.Get();
       cmd->Log(aStream);
       aStream << "\n";
     }
   }
 
  private:
--- a/gfx/2d/DrawCommand.h
+++ b/gfx/2d/DrawCommand.h
@@ -53,15 +53,15 @@ enum class CommandType : int8_t {
 class DrawingCommand {
  public:
   virtual ~DrawingCommand() {}
 
   virtual CommandType GetType() const = 0;
   virtual void ExecuteOnDT(DrawTarget* aDT,
                            const Matrix* aTransform = nullptr) const = 0;
   virtual void CloneInto(CaptureCommandList* aList) = 0;
-  virtual void Log(TreeLog& aLog) const = 0;
+  virtual void Log(TreeLog<>& aLog) const = 0;
 };
 
 }  // namespace gfx
 }  // namespace mozilla
 
 #endif /* MOZILLA_GFX_DRAWCOMMAND_H_ */
--- a/gfx/2d/DrawCommands.h
+++ b/gfx/2d/DrawCommands.h
@@ -120,17 +120,17 @@ class DrawSurfaceCommand : public Drawin
     CLONE_INTO(DrawSurfaceCommand)
     (mSurface, mDest, mSource, mSurfOptions, mOptions);
   }
 
   void ExecuteOnDT(DrawTarget* aDT, const Matrix*) const override {
     aDT->DrawSurface(mSurface, mDest, mSource, mSurfOptions, mOptions);
   }
 
-  void Log(TreeLog& aStream) const override {
+  void Log(TreeLog<>& aStream) const override {
     aStream << "[DrawSurface surf=" << mSurface;
     aStream << " dest=" << mDest;
     aStream << " src=" << mSource;
     aStream << " surfOpt=" << mSurfOptions;
     aStream << " opt=" << mOptions;
     aStream << "]";
   }
 
@@ -166,17 +166,17 @@ class DrawSurfaceWithShadowCommand : pub
     (mSurface, mDest, mColor, mOffset, mSigma, mOperator);
   }
 
   void ExecuteOnDT(DrawTarget* aDT, const Matrix*) const override {
     aDT->DrawSurfaceWithShadow(mSurface, mDest, mColor, mOffset, mSigma,
                                mOperator);
   }
 
-  void Log(TreeLog& aStream) const override {
+  void Log(TreeLog<>& aStream) const override {
     aStream << "[DrawSurfaceWithShadow surf=" << mSurface;
     aStream << " dest=" << mDest;
     aStream << " color=" << mColor;
     aStream << " offset=" << mOffset;
     aStream << " sigma=" << mSigma;
     aStream << " op=" << mOperator;
     aStream << "]";
   }
@@ -218,17 +218,17 @@ class DrawFilterCommand : public Drawing
       // handled by the painting code, but here there's not much we can do.
       if (!filter) {
         return;
       }
     }
     aDT->DrawFilter(filter, mSourceRect, mDestPoint, mOptions);
   }
 
-  void Log(TreeLog& aStream) const override {
+  void Log(TreeLog<>& aStream) const override {
     aStream << "[DrawFilter surf=" << mFilter;
     aStream << " src=" << mSourceRect;
     aStream << " dest=" << mDestPoint;
     aStream << " opt=" << mOptions;
     aStream << "]";
   }
 
   static const bool AffectsSnapshot = true;
@@ -250,17 +250,17 @@ class ClearRectCommand : public DrawingC
   void CloneInto(CaptureCommandList* aList) override {
     CLONE_INTO(ClearRectCommand)(mRect);
   }
 
   void ExecuteOnDT(DrawTarget* aDT, const Matrix*) const override {
     aDT->ClearRect(mRect);
   }
 
-  void Log(TreeLog& aStream) const override {
+  void Log(TreeLog<>& aStream) const override {
     aStream << "[ClearRect rect=" << mRect << "]";
   }
 
   static const bool AffectsSnapshot = true;
   static const CommandType Type = CommandType::CLEARRECT;
 
  private:
   Rect mRect;
@@ -286,17 +286,17 @@ class CopySurfaceCommand : public Drawin
     Point dest(Float(mDestination.x), Float(mDestination.y));
     if (aTransform) {
       dest = aTransform->TransformPoint(dest);
     }
     aDT->CopySurface(mSurface, mSourceRect,
                      IntPoint(uint32_t(dest.x), uint32_t(dest.y)));
   }
 
-  void Log(TreeLog& aStream) const override {
+  void Log(TreeLog<>& aStream) const override {
     aStream << "[CopySurface surf=" << mSurface;
     aStream << " src=" << mSourceRect;
     aStream << " dest=" << mDestination;
     aStream << "]";
   }
 
   static const bool AffectsSnapshot = true;
   static const CommandType Type = CommandType::COPYSURFACE;
@@ -318,17 +318,17 @@ class CopyRectCommand : public DrawingCo
     CLONE_INTO(CopyRectCommand)(mSourceRect, mDestination);
   }
 
   virtual void ExecuteOnDT(DrawTarget* aDT,
                            const Matrix* aTransform) const override {
     aDT->CopyRect(mSourceRect, mDestination);
   }
 
-  void Log(TreeLog& aStream) const override {
+  void Log(TreeLog<>& aStream) const override {
     aStream << "[CopyRect src=" << mSourceRect;
     aStream << " dest=" << mDestination;
     aStream << "]";
   }
 
   static const bool AffectsSnapshot = true;
   static const CommandType Type = CommandType::COPYRECT;
 
@@ -348,17 +348,17 @@ class FillRectCommand : public DrawingCo
   void CloneInto(CaptureCommandList* aList) override {
     CLONE_INTO(FillRectCommand)(mRect, mPattern, mOptions);
   }
 
   void ExecuteOnDT(DrawTarget* aDT, const Matrix*) const override {
     aDT->FillRect(mRect, mPattern, mOptions);
   }
 
-  void Log(TreeLog& aStream) const override {
+  void Log(TreeLog<>& aStream) const override {
     aStream << "[FillRect rect=" << mRect;
     aStream << " pattern=" << mPattern.Get();
     aStream << " opt=" << mOptions;
     aStream << "]";
   }
 
   static const bool AffectsSnapshot = true;
   static const CommandType Type = CommandType::FILLRECT;
@@ -380,17 +380,17 @@ class FillRoundedRectCommand : public Dr
   void CloneInto(CaptureCommandList* aList) override {
     CLONE_INTO(FillRoundedRectCommand)(mRect, mPattern, mOptions);
   }
 
   void ExecuteOnDT(DrawTarget* aDT, const Matrix*) const override {
     aDT->FillRoundedRect(mRect, mPattern, mOptions);
   }
 
-  void Log(TreeLog& aStream) const override {
+  void Log(TreeLog<>& aStream) const override {
     aStream << "[FillRoundedRect rect=" << mRect.rect;
     aStream << " pattern=" << mPattern.Get();
     aStream << " opt=" << mOptions;
     aStream << "]";
   }
 
   static const bool AffectsSnapshot = true;
   static const CommandType Type = CommandType::FILLROUNDEDRECT;
@@ -416,17 +416,17 @@ class StrokeRectCommand : public StrokeO
   void CloneInto(CaptureCommandList* aList) override {
     CLONE_INTO(StrokeRectCommand)(mRect, mPattern, mStrokeOptions, mOptions);
   }
 
   void ExecuteOnDT(DrawTarget* aDT, const Matrix*) const override {
     aDT->StrokeRect(mRect, mPattern, mStrokeOptions, mOptions);
   }
 
-  void Log(TreeLog& aStream) const override {
+  void Log(TreeLog<>& aStream) const override {
     aStream << "[StrokeRect rect=" << mRect;
     aStream << " pattern=" << mPattern.Get();
     aStream << " opt=" << mOptions;
     aStream << "]";
   }
 
   static const bool AffectsSnapshot = true;
   static const CommandType Type = CommandType::STROKERECT;
@@ -455,17 +455,17 @@ class StrokeLineCommand : public StrokeO
     CLONE_INTO(StrokeLineCommand)
     (mStart, mEnd, mPattern, mStrokeOptions, mOptions);
   }
 
   void ExecuteOnDT(DrawTarget* aDT, const Matrix*) const override {
     aDT->StrokeLine(mStart, mEnd, mPattern, mStrokeOptions, mOptions);
   }
 
-  void Log(TreeLog& aStream) const override {
+  void Log(TreeLog<>& aStream) const override {
     aStream << "[StrokeLine start=" << mStart;
     aStream << " end=" << mEnd;
     aStream << " pattern=" << mPattern.Get();
     aStream << " opt=" << mOptions;
     aStream << "]";
   }
 
   static const bool AffectsSnapshot = true;
@@ -491,17 +491,17 @@ class FillCommand : public DrawingComman
   void CloneInto(CaptureCommandList* aList) override {
     CLONE_INTO(FillCommand)(mPath, mPattern, mOptions);
   }
 
   void ExecuteOnDT(DrawTarget* aDT, const Matrix*) const override {
     aDT->Fill(mPath, mPattern, mOptions);
   }
 
-  void Log(TreeLog& aStream) const override {
+  void Log(TreeLog<>& aStream) const override {
     aStream << "[FillCommand path=" << mPath;
     aStream << " pattern=" << mPattern.Get();
     aStream << " opt=" << mOptions;
     aStream << "]";
   }
 
   static const bool AffectsSnapshot = true;
   static const CommandType Type = CommandType::FILL;
@@ -527,17 +527,17 @@ class StrokeCommand : public StrokeOptio
   void CloneInto(CaptureCommandList* aList) override {
     CLONE_INTO(StrokeCommand)(mPath, mPattern, mStrokeOptions, mOptions);
   }
 
   void ExecuteOnDT(DrawTarget* aDT, const Matrix*) const override {
     aDT->Stroke(mPath, mPattern, mStrokeOptions, mOptions);
   }
 
-  void Log(TreeLog& aStream) const override {
+  void Log(TreeLog<>& aStream) const override {
     aStream << "[Stroke path=" << mPath;
     aStream << " pattern=" << mPattern.Get();
     aStream << " opt=" << mOptions;
     aStream << "]";
   }
 
   static const bool AffectsSnapshot = true;
   static const CommandType Type = CommandType::STROKE;
@@ -572,17 +572,17 @@ class FillGlyphsCommand : public Drawing
 
   void ExecuteOnDT(DrawTarget* aDT, const Matrix*) const override {
     GlyphBuffer buf;
     buf.mNumGlyphs = mGlyphs.size();
     buf.mGlyphs = &mGlyphs.front();
     aDT->FillGlyphs(mFont, buf, mPattern, mOptions);
   }
 
-  void Log(TreeLog& aStream) const override {
+  void Log(TreeLog<>& aStream) const override {
     aStream << "[FillGlyphs font=" << mFont;
     aStream << " glyphCount=" << mGlyphs.size();
     aStream << " pattern=" << mPattern.Get();
     aStream << " opt=" << mOptions;
     aStream << "]";
   }
 
   static const bool AffectsSnapshot = true;
@@ -625,17 +625,17 @@ class StrokeGlyphsCommand : public Strok
 
   void ExecuteOnDT(DrawTarget* aDT, const Matrix*) const override {
     GlyphBuffer buf;
     buf.mNumGlyphs = mGlyphs.size();
     buf.mGlyphs = &mGlyphs.front();
     aDT->StrokeGlyphs(mFont, buf, mPattern, mStrokeOptions, mOptions);
   }
 
-  void Log(TreeLog& aStream) const override {
+  void Log(TreeLog<>& aStream) const override {
     aStream << "[StrokeGlyphs font=" << mFont;
     aStream << " glyphCount=" << mGlyphs.size();
     aStream << " pattern=" << mPattern.Get();
     aStream << " opt=" << mOptions;
     aStream << "]";
   }
 
   static const bool AffectsSnapshot = true;
@@ -659,17 +659,17 @@ class MaskCommand : public DrawingComman
   void CloneInto(CaptureCommandList* aList) override {
     CLONE_INTO(MaskCommand)(mSource, mMask, mOptions);
   }
 
   void ExecuteOnDT(DrawTarget* aDT, const Matrix*) const override {
     aDT->Mask(mSource, mMask, mOptions);
   }
 
-  void Log(TreeLog& aStream) const override {
+  void Log(TreeLog<>& aStream) const override {
     aStream << "[Mask source=" << mSource.Get();
     aStream << " mask=" << mMask.Get();
     aStream << " opt=" << mOptions;
     aStream << "]";
   }
 
   static const bool AffectsSnapshot = true;
   static const CommandType Type = CommandType::MASK;
@@ -694,17 +694,17 @@ class MaskSurfaceCommand : public Drawin
   void CloneInto(CaptureCommandList* aList) override {
     CLONE_INTO(MaskSurfaceCommand)(mSource, mMask, mOffset, mOptions);
   }
 
   void ExecuteOnDT(DrawTarget* aDT, const Matrix*) const override {
     aDT->MaskSurface(mSource, mMask, mOffset, mOptions);
   }
 
-  void Log(TreeLog& aStream) const override {
+  void Log(TreeLog<>& aStream) const override {
     aStream << "[Mask source=" << mSource.Get();
     aStream << " mask=" << mMask;
     aStream << " offset=" << &mOffset;
     aStream << " opt=" << mOptions;
     aStream << "]";
   }
 
   static const bool AffectsSnapshot = true;
@@ -727,17 +727,17 @@ class PushClipCommand : public DrawingCo
   void CloneInto(CaptureCommandList* aList) override {
     CLONE_INTO(PushClipCommand)(mPath);
   }
 
   void ExecuteOnDT(DrawTarget* aDT, const Matrix*) const override {
     aDT->PushClip(mPath);
   }
 
-  void Log(TreeLog& aStream) const override {
+  void Log(TreeLog<>& aStream) const override {
     aStream << "[PushClip path=" << mPath << "]";
   }
 
   static const bool AffectsSnapshot = false;
   static const CommandType Type = CommandType::PUSHCLIP;
 
  private:
   RefPtr<Path> mPath;
@@ -752,17 +752,17 @@ class PushClipRectCommand : public Drawi
   void CloneInto(CaptureCommandList* aList) override {
     CLONE_INTO(PushClipRectCommand)(mRect);
   }
 
   void ExecuteOnDT(DrawTarget* aDT, const Matrix*) const override {
     aDT->PushClipRect(mRect);
   }
 
-  void Log(TreeLog& aStream) const override {
+  void Log(TreeLog<>& aStream) const override {
     aStream << "[PushClipRect rect=" << mRect << "]";
   }
 
   static const bool AffectsSnapshot = false;
   static const CommandType Type = CommandType::PUSHCLIPRECT;
 
  private:
   Rect mRect;
@@ -787,17 +787,17 @@ class PushLayerCommand : public DrawingC
     (mOpaque, mOpacity, mMask, mMaskTransform, mBounds, mCopyBackground);
   }
 
   void ExecuteOnDT(DrawTarget* aDT, const Matrix*) const override {
     aDT->PushLayer(mOpaque, mOpacity, mMask, mMaskTransform, mBounds,
                    mCopyBackground);
   }
 
-  void Log(TreeLog& aStream) const override {
+  void Log(TreeLog<>& aStream) const override {
     aStream << "[PushLayer opaque=" << mOpaque;
     aStream << " opacity=" << mOpacity;
     aStream << " mask=" << mMask;
     aStream << " maskTransform=" << mMaskTransform;
     aStream << " bounds=" << mBounds;
     aStream << " copyBackground=" << mCopyBackground;
     aStream << "]";
   }
@@ -823,17 +823,17 @@ class PopClipCommand : public DrawingCom
   void CloneInto(CaptureCommandList* aList) override {
     CLONE_INTO(PopClipCommand)();
   }
 
   void ExecuteOnDT(DrawTarget* aDT, const Matrix*) const override {
     aDT->PopClip();
   }
 
-  void Log(TreeLog& aStream) const override { aStream << "[PopClip]"; }
+  void Log(TreeLog<>& aStream) const override { aStream << "[PopClip]"; }
 
   static const bool AffectsSnapshot = false;
   static const CommandType Type = CommandType::POPCLIP;
 };
 
 class PopLayerCommand : public DrawingCommand {
  public:
   PopLayerCommand() {}
@@ -843,17 +843,17 @@ class PopLayerCommand : public DrawingCo
   void CloneInto(CaptureCommandList* aList) override {
     CLONE_INTO(PopLayerCommand)();
   }
 
   void ExecuteOnDT(DrawTarget* aDT, const Matrix*) const override {
     aDT->PopLayer();
   }
 
-  void Log(TreeLog& aStream) const override { aStream << "[PopLayer]"; }
+  void Log(TreeLog<>& aStream) const override { aStream << "[PopLayer]"; }
 
   static const bool AffectsSnapshot = true;
   static const CommandType Type = CommandType::POPLAYER;
 };
 
 class SetTransformCommand : public DrawingCommand {
   friend class DrawTargetCaptureImpl;
 
@@ -871,17 +871,17 @@ class SetTransformCommand : public Drawi
                            const Matrix* aMatrix) const override {
     if (aMatrix) {
       aDT->SetTransform(mTransform * (*aMatrix));
     } else {
       aDT->SetTransform(mTransform);
     }
   }
 
-  void Log(TreeLog& aStream) const override {
+  void Log(TreeLog<>& aStream) const override {
     aStream << "[SetTransform transform=" << mTransform << "]";
   }
 
   static const bool AffectsSnapshot = false;
   static const CommandType Type = CommandType::SETTRANSFORM;
 
  private:
   Matrix mTransform;
@@ -902,17 +902,17 @@ class SetPermitSubpixelAACommand : publi
     CLONE_INTO(SetPermitSubpixelAACommand)(mPermitSubpixelAA);
   }
 
   virtual void ExecuteOnDT(DrawTarget* aDT,
                            const Matrix* aMatrix) const override {
     aDT->SetPermitSubpixelAA(mPermitSubpixelAA);
   }
 
-  void Log(TreeLog& aStream) const override {
+  void Log(TreeLog<>& aStream) const override {
     aStream << "[SetPermitSubpixelAA permitSubpixelAA=" << mPermitSubpixelAA
             << "]";
   }
 
   static const bool AffectsSnapshot = false;
   static const CommandType Type = CommandType::SETPERMITSUBPIXELAA;
 
  private:
@@ -928,17 +928,17 @@ class FlushCommand : public DrawingComma
   void CloneInto(CaptureCommandList* aList) override {
     CLONE_INTO(FlushCommand)();
   }
 
   void ExecuteOnDT(DrawTarget* aDT, const Matrix*) const override {
     aDT->Flush();
   }
 
-  void Log(TreeLog& aStream) const override { aStream << "[Flush]"; }
+  void Log(TreeLog<>& aStream) const override { aStream << "[Flush]"; }
 
   static const bool AffectsSnapshot = false;
   static const CommandType Type = CommandType::FLUSH;
 };
 
 class BlurCommand : public DrawingCommand {
  public:
   explicit BlurCommand(const AlphaBoxBlur& aBlur) : mBlur(aBlur) {}
@@ -948,17 +948,17 @@ class BlurCommand : public DrawingComman
   void CloneInto(CaptureCommandList* aList) override {
     CLONE_INTO(BlurCommand)(mBlur);
   }
 
   void ExecuteOnDT(DrawTarget* aDT, const Matrix*) const override {
     aDT->Blur(mBlur);
   }
 
-  void Log(TreeLog& aStream) const override { aStream << "[Blur]"; }
+  void Log(TreeLog<>& aStream) const override { aStream << "[Blur]"; }
 
   static const bool AffectsSnapshot = true;
   static const CommandType Type = CommandType::BLUR;
 
  private:
   AlphaBoxBlur mBlur;
 };
 
@@ -971,17 +971,17 @@ class PadEdgesCommand : public DrawingCo
   void CloneInto(CaptureCommandList* aList) override {
     CLONE_INTO(PadEdgesCommand)(IntRegion(mRegion));
   }
 
   void ExecuteOnDT(DrawTarget* aDT, const Matrix*) const override {
     aDT->PadEdges(mRegion);
   }
 
-  void Log(TreeLog& aStream) const override { aStream << "[PADEDGES]"; }
+  void Log(TreeLog<>& aStream) const override { aStream << "[PADEDGES]"; }
 
   static const bool AffectsSnapshot = true;
   static const CommandType Type = CommandType::PADEDGES;
 
  private:
   IntRegion mRegion;
 };
 
--- a/gfx/2d/DrawTargetCapture.cpp
+++ b/gfx/2d/DrawTargetCapture.cpp
@@ -357,17 +357,17 @@ already_AddRefed<FilterNode> DrawTargetC
   } else {
     return mRefDT->CreateFilter(aType);
   }
 }
 
 bool DrawTargetCaptureImpl::IsEmpty() const { return mCommands.IsEmpty(); }
 
 void DrawTargetCaptureImpl::Dump() {
-  TreeLog output;
+  TreeLog<> output;
   output << "DrawTargetCapture(" << (void*)(this) << ")\n";
-  TreeAutoIndent indent(output);
+  TreeAutoIndent<> indent(output);
   mCommands.Log(output);
   output << "\n";
 }
 
 }  // namespace gfx
 }  // namespace mozilla
--- a/gfx/2d/Logging.h
+++ b/gfx/2d/Logging.h
@@ -857,16 +857,17 @@ inline bool MOZ2D_warn_if_impl(bool aCon
       MOZ2D_warn_if_impl(condition, #condition, __FILE__, __LINE__)
 #  else
 #    define MOZ2D_WARN_IF(condition) (bool)(condition)
 #  endif
 #endif
 
 const int INDENT_PER_LEVEL = 2;
 
+template<int Level = LOG_DEBUG>
 class TreeLog {
  public:
   explicit TreeLog(const std::string& aPrefix = "")
       : mLog(int(LogOptions::NoNewline)),
         mPrefix(aPrefix),
         mDepth(0),
         mStartOfLine(true),
         mConditionedOnPref(false),
@@ -901,17 +902,17 @@ class TreeLog {
   }
 
   void ConditionOnPrefFunction(bool (*aPrefFunction)()) {
     mConditionedOnPref = true;
     mPrefFunction = aPrefFunction;
   }
 
  private:
-  Log<LOG_DEBUG> mLog;
+  Log<Level> mLog;
   std::string mPrefix;
   uint32_t mDepth;
   bool mStartOfLine;
   bool mConditionedOnPref;
   bool (*mPrefFunction)();
 
   template <typename T>
   static bool EndsInNewline(const T& aObject) {
@@ -924,31 +925,32 @@ class TreeLog {
 
   static bool EndsInNewline(char aChar) { return aChar == '\n'; }
 
   static bool EndsInNewline(const char* aString) {
     return EndsInNewline(std::string(aString));
   }
 };
 
+template<int Level = LOG_DEBUG>
 class TreeAutoIndent {
  public:
-  explicit TreeAutoIndent(TreeLog& aTreeLog) : mTreeLog(aTreeLog) {
+  explicit TreeAutoIndent(TreeLog<Level>& aTreeLog) : mTreeLog(aTreeLog) {
     mTreeLog.IncreaseIndent();
   }
 
   TreeAutoIndent(const TreeAutoIndent& aTreeAutoIndent)
       : mTreeLog(aTreeAutoIndent.mTreeLog) {
     mTreeLog.IncreaseIndent();
   }
 
   TreeAutoIndent& operator=(const TreeAutoIndent& aTreeAutoIndent) = delete;
 
   ~TreeAutoIndent() { mTreeLog.DecreaseIndent(); }
 
  private:
-  TreeLog& mTreeLog;
+  TreeLog<Level>& mTreeLog;
 };
 
 }  // namespace gfx
 }  // namespace mozilla
 
 #endif /* MOZILLA_GFX_LOGGING_H_ */
--- a/gfx/layers/apz/src/APZCTreeManager.cpp
+++ b/gfx/layers/apz/src/APZCTreeManager.cpp
@@ -390,17 +390,17 @@ APZCTreeManager::UpdateHitTestingTreeImp
                                });
   mRootNode = nullptr;
   mUsingAsyncZoomContainer = false;
   int asyncZoomContainerNestingDepth = 0;
   bool haveMultipleAsyncZoomContainers = false;
   bool haveRootContentOutsideAsyncZoomContainer = false;
 
   if (aRoot) {
-    std::stack<gfx::TreeAutoIndent> indents;
+    std::stack<gfx::TreeAutoIndent<LOG_DEFAULT>> indents;
     std::stack<AncestorTransform> ancestorTransforms;
     HitTestingTreeNode* parent = nullptr;
     HitTestingTreeNode* next = nullptr;
     LayersId layersId = aRootLayerTreeId;
     ancestorTransforms.push(AncestorTransform());
     state.mParentHasPerspective.push(false);
 
     mApzcTreeLog << "[start]\n";
@@ -469,17 +469,17 @@ APZCTreeManager::UpdateHitTestingTreeImp
           parent = node;
           next = nullptr;
 
           // Update the layersId if we have a new one
           if (Maybe<LayersId> newLayersId = aLayerMetrics.GetReferentId()) {
             layersId = *newLayersId;
           }
 
-          indents.push(gfx::TreeAutoIndent(mApzcTreeLog));
+          indents.push(gfx::TreeAutoIndent<LOG_DEFAULT>(mApzcTreeLog));
           state.mParentHasPerspective.push(
               aLayerMetrics.TransformIsPerspective());
         },
         [&](ScrollNode aLayerMetrics) {
           if (aLayerMetrics.IsAsyncZoomContainer()) {
             --asyncZoomContainerNestingDepth;
           }
 
--- a/gfx/layers/apz/src/APZCTreeManager.h
+++ b/gfx/layers/apz/src/APZCTreeManager.h
@@ -879,17 +879,17 @@ class APZCTreeManager : public IAPZCTree
   /* Tracks the number of touch points we are tracking that are currently on
    * the screen. */
   TouchCounter mTouchCounter;
   /* Stores the current mouse position in screen coordinates.
    */
   ScreenPoint mCurrentMousePosition;
   /* For logging the APZC tree for debugging (enabled by the apz.printtree
    * pref). */
-  gfx::TreeLog mApzcTreeLog;
+  gfx::TreeLog<gfx::LOG_DEFAULT> mApzcTreeLog;
 
   class CheckerboardFlushObserver;
   friend class CheckerboardFlushObserver;
   RefPtr<CheckerboardFlushObserver> mFlushObserver;
 
   // Map from layers id to APZTestData. Accesses and mutations must be
   // protected by the mTestDataLock.
   std::unordered_map<LayersId, UniquePtr<APZTestData>, LayersId::HashFn>