Bug 1019766 - Avoid including gfxPrefs.h from nsLayoutUtils.h. r=kats
authorBotond Ballo <botond@mozilla.com>
Tue, 03 Jun 2014 14:13:05 -0400
changeset 205652 bf5c893c2733ff727fa82e3b08534bb8a0a148de
parent 205651 6148fa86eddf62130641aa3fb6bc0bb871f2c8a4
child 205653 b82adb960c543fd559fe201b8dd69a96e22eda25
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1019766
milestone32.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 1019766 - Avoid including gfxPrefs.h from nsLayoutUtils.h. r=kats
layout/base/nsLayoutUtils.cpp
layout/base/nsLayoutUtils.h
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -6657,16 +6657,21 @@ nsLayoutUtils::DoLogTestDataForPaint(nsI
 {
   nsRefPtr<LayerManager> lm = aPresShell->GetPresContext()->GetRootPresContext()
       ->GetPresShell()->GetLayerManager();
   if (lm && lm->GetBackendType() == LayersBackend::LAYERS_CLIENT) {
     static_cast<ClientLayerManager*>(lm.get())->LogTestDataForCurrentPaint(aScrollId, aKey, aValue);
   }
 }
 
+/* static */ bool
+nsLayoutUtils::IsAPZTestLoggingEnabled()
+{
+  return gfxPrefs::APZTestLoggingEnabled();
+}
 
 nsLayoutUtils::SurfaceFromElementResult::SurfaceFromElementResult()
   // Use safe default values here
   : mIsWriteOnly(true)
   , mIsStillLoading(false)
   , mCORSUsed(false)
   , mIsPremultiplied(true)
 {
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -22,17 +22,16 @@
 #include "nsStyleCoord.h"
 #include "nsStyleConsts.h"
 #include "nsGkAtoms.h"
 #include "nsRuleNode.h"
 #include "imgIContainer.h"
 #include "mozilla/gfx/2D.h"
 #include "Units.h"
 #include "mozilla/ToString.h"
-#include "gfxPrefs.h"
 
 #include <limits>
 #include <algorithm>
 
 class nsIFormControlFrame;
 class nsPresContext;
 class nsIContent;
 class nsIAtom;
@@ -2197,32 +2196,32 @@ public:
    * @param aScrollId Identifies the scroll frame to which the data pertains.
    * @param aKey The key under which to log the data.
    * @param aValue The value of the data to be logged.
    */
   static void LogTestDataForPaint(nsIPresShell* aPresShell,
                                   ViewID aScrollId,
                                   const std::string& aKey,
                                   const std::string& aValue) {
-    if (gfxPrefs::APZTestLoggingEnabled()) {
+    if (IsAPZTestLoggingEnabled()) {
       DoLogTestDataForPaint(aPresShell, aScrollId, aKey, aValue);
     }
   }
 
   /**
    * A convenience overload of LogTestDataForPaint() that accepts any type
    * as the value, and passes it through mozilla::ToString() to obtain a string
    * value. The type passed must support streaming to an std::ostream.
    */
   template <typename Value>
   static void LogTestDataForPaint(nsIPresShell* aPresShell,
                                   ViewID aScrollId,
                                   const std::string& aKey,
                                   const Value& aValue) {
-    if (gfxPrefs::APZTestLoggingEnabled()) {
+    if (IsAPZTestLoggingEnabled()) {
       DoLogTestDataForPaint(aPresShell, aScrollId, aKey,
           mozilla::ToString(aValue));
     }
   }
 
  /**
    * Get the display port for |aScrollFrame|'s content. If |aScrollFrame|
    * WantsAsyncScroll() and we don't have a scrollable displayport yet (as
@@ -2257,16 +2256,18 @@ private:
 
   /**
    * Helper function for LogTestDataForPaint().
    */
   static void DoLogTestDataForPaint(nsIPresShell* aPresShell,
                                     ViewID aScrollId,
                                     const std::string& aKey,
                                     const std::string& aValue);
+
+  static bool IsAPZTestLoggingEnabled();
 };
 
 MOZ_FINISH_NESTED_ENUM_CLASS(nsLayoutUtils::RepaintMode)
 
 template<typename PointType, typename RectType, typename CoordType>
 /* static */ bool
 nsLayoutUtils::PointIsCloserToRect(PointType aPoint, const RectType& aRect,
                                    CoordType& aClosestXDistance,