Bug 1573268 - Convert layout.interruptible-reflow.enabled to static pref. r=njn
authorKristen Wright <kwright@mozilla.com>
Wed, 14 Aug 2019 00:01:27 +0000
changeset 488024 33dd94200b51e9b96f88c38b36ca2028e70b597d
parent 488023 b7bef0d94937b477989e9775ad981d84577ef97b
child 488025 c657ac21f56a770e35b92501679c559fc4e5a054
push id36434
push usercbrindusan@mozilla.com
push dateThu, 15 Aug 2019 09:44:30 +0000
treeherdermozilla-central@144fbfb409b7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn
bugs1573268
milestone70.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 1573268 - Convert layout.interruptible-reflow.enabled to static pref. r=njn Converts layout.interruptible-reflow.enabled to a static pref and updates its usage. Differential Revision: https://phabricator.services.mozilla.com/D41849
layout/base/nsLayoutUtils.cpp
layout/base/nsLayoutUtils.h
layout/base/nsPresContext.cpp
modules/libpref/init/StaticPrefList.yaml
modules/libpref/init/all.js
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -179,18 +179,16 @@ using mozilla::dom::HTMLMediaElement_Bin
 // TODO: remove, see bug 598468.
 bool nsLayoutUtils::gPreventAssertInCompareTreePosition = false;
 #endif  // DEBUG
 
 typedef ScrollableLayerGuid::ViewID ViewID;
 typedef nsStyleTransformMatrix::TransformReferenceBox TransformReferenceBox;
 
 /* static */
-bool nsLayoutUtils::sInterruptibleReflowEnabled;
-/* static */
 bool nsLayoutUtils::sSVGTransformBoxEnabled;
 /* static */
 uint32_t nsLayoutUtils::sIdlePeriodDeadlineLimit;
 /* static */
 uint32_t nsLayoutUtils::sQuiescentFramesBeforeIdlePeriod;
 
 static ViewID sScrollIdCounter = ScrollableLayerGuid::START_SCROLL_ID;
 
@@ -7960,18 +7958,16 @@ size_t nsLayoutUtils::SizeOfTextRunsForF
       total += SizeOfTextRunsForFrames(e.get(), aMallocSizeOf, clear);
     }
   }
   return total;
 }
 
 /* static */
 void nsLayoutUtils::Initialize() {
-  Preferences::AddBoolVarCache(&sInterruptibleReflowEnabled,
-                               "layout.interruptible-reflow.enabled");
   Preferences::AddBoolVarCache(&sSVGTransformBoxEnabled,
                                "svg.transform-box.enabled");
   Preferences::AddUintVarCache(&sIdlePeriodDeadlineLimit,
                                "layout.idle_period.time_limit",
                                DEFAULT_IDLE_PERIOD_TIME_LIMIT);
   Preferences::AddUintVarCache(&sQuiescentFramesBeforeIdlePeriod,
                                "layout.idle_period.required_quiescent_frames",
                                DEFAULT_QUIESCENT_FRAMES);
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -2393,20 +2393,16 @@ class nsLayoutUtils {
                                                const nsSize& aDisplaySize);
 
   /**
    * Checks whether we want to use the GPU to scale images when
    * possible.
    */
   static bool GPUImageScalingEnabled();
 
-  static bool InterruptibleReflowEnabled() {
-    return sInterruptibleReflowEnabled;
-  }
-
   /**
    * Unions the overflow areas of the children of aFrame with aOverflowAreas.
    * aSkipChildLists specifies any child lists that should be skipped.
    * kSelectPopupList and kPopupList are always skipped.
    */
   static void UnionChildOverflow(
       nsIFrame* aFrame, nsOverflowAreas& aOverflowAreas,
       mozilla::layout::FrameChildListIDs aSkipChildLists =
@@ -2993,17 +2989,16 @@ class nsLayoutUtils {
 
   /**
    * Generate the motion path transform result.
    **/
   static mozilla::Maybe<mozilla::MotionPathData> ResolveMotionPath(
       const nsIFrame* aFrame);
 
  private:
-  static bool sInterruptibleReflowEnabled;
   static bool sSVGTransformBoxEnabled;
   static uint32_t sIdlePeriodDeadlineLimit;
   static uint32_t sQuiescentFramesBeforeIdlePeriod;
 
   /**
    * Helper function for LogTestDataForPaint().
    */
   static void DoLogTestDataForPaint(mozilla::layers::LayerManager* aManager,
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -71,16 +71,17 @@
 #include "nsFrameLoader.h"
 #include "nsContentUtils.h"
 #include "nsPIWindowRoot.h"
 #include "mozilla/Preferences.h"
 #include "gfxTextRun.h"
 #include "nsFontFaceUtils.h"
 #include "nsLayoutStylesheetCache.h"
 #include "mozilla/ServoBindings.h"
+#include "mozilla/StaticPrefs_layout.h"
 #include "mozilla/StaticPrefs_zoom.h"
 #include "mozilla/StyleSheet.h"
 #include "mozilla/StyleSheetInlines.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/dom/Performance.h"
 #include "mozilla/dom/PerformanceTiming.h"
 #include "mozilla/layers/APZThreadUtils.h"
 
@@ -2223,17 +2224,17 @@ void nsPresContext::ReflowStarted(bool a
 #ifdef NOISY_INTERRUPTIBLE_REFLOW
   if (!aInterruptible) {
     printf("STARTING NONINTERRUPTIBLE REFLOW\n");
   }
 #endif
   // We don't support interrupting in paginated contexts, since page
   // sequences only handle initial reflow
   mInterruptsEnabled = aInterruptible && !IsPaginated() &&
-                       nsLayoutUtils::InterruptibleReflowEnabled();
+                       StaticPrefs::layout_interruptible_reflow_enabled();
 
   // Don't set mHasPendingInterrupt based on HavePendingInputEvent() here.  If
   // we ever change that, then we need to update the code in
   // PresShell::DoReflow to only add the just-reflown root to dirty roots if
   // it's actually dirty.  Otherwise we can end up adding a root that has no
   // interruptible descendants, just because we detected an interrupt at reflow
   // start.
   mHasPendingInterrupt = false;
--- a/modules/libpref/init/StaticPrefList.yaml
+++ b/modules/libpref/init/StaticPrefList.yaml
@@ -4644,16 +4644,24 @@
   value: @IS_EARLY_BETA_OR_EARLIER@
   mirror: always
 
 - name: layout.frame_rate
   type: RelaxedAtomicInt32
   value: -1
   mirror: always
 
+# Enable/disable interruptible reflow, which allows reflows to stop
+# before completion (and display the partial results) when user events
+# are pending.
+- name: layout.interruptible-reflow.enabled
+  type: bool
+  value: true
+  mirror: always
+
 - name: layout.min-active-layer-size
   type: int32_t
   value: 64
   mirror: always
 
 - name: layout.paint_rects_separately
   type: bool
   value: true
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -2954,21 +2954,16 @@ pref("layout.css.scroll-behavior.damping
 // 1 = end-side in document/content direction
 // 2 = right
 // 3 = left
 pref("layout.scrollbar.side", 0);
 
 // pref to stop overlay scrollbars from fading out, for testing purposes
 pref("layout.testing.overlay-scrollbars.always-visible", false);
 
-// Enable/disable interruptible reflow, which allows reflows to stop
-// before completion (and display the partial results) when user events
-// are pending.
-pref("layout.interruptible-reflow.enabled", true);
-
 // pref to control browser frame rate, in Hz. A value <= 0 means choose
 // automatically based on knowledge of the platform (or 60Hz if no platform-
 // specific information is available).
 pref("layout.frame_rate", -1);
 
 // pref to dump the display list to the log. Useful for debugging drawing.
 pref("layout.display-list.dump", false);
 pref("layout.display-list.dump-content", false);