Bug 1573720 - Convert layers.force-active to a static pref. r=heycam
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 15 Aug 2019 05:30:37 +0000
changeset 488376 cf470b2c90c8d9b6a46559302cb2ee60ea0e02a6
parent 488375 ed710f979ba18daa62f49d25dd8d9ff19fab10d8
child 488377 1dea742635b1f839f4230e82eab1b50b72965d99
push id36440
push userncsoregi@mozilla.com
push dateFri, 16 Aug 2019 03:57:48 +0000
treeherdermozilla-central@a58b7dc85887 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1573720
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 1573720 - Convert layers.force-active to a static pref. r=heycam Differential Revision: https://phabricator.services.mozilla.com/D41916
layout/painting/nsDisplayList.cpp
modules/libpref/init/StaticPrefList.yaml
modules/libpref/init/all.js
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -3538,25 +3538,17 @@ nsDisplayItem::nsDisplayItem(nsDisplayLi
   }
   if (mFrame->Combines3DTransformWithAncestors(disp)) {
     mItemFlags += ItemFlag::Combines3DTransformWithAncestors;
   }
 }
 
 /* static */
 bool nsDisplayItem::ForceActiveLayers() {
-  static bool sForce = false;
-  static bool sForceCached = false;
-
-  if (!sForceCached) {
-    Preferences::AddBoolVarCache(&sForce, "layers.force-active", false);
-    sForceCached = true;
-  }
-
-  return sForce;
+  return StaticPrefs::layers_force_active();
 }
 
 int32_t nsDisplayItem::ZIndex() const { return mFrame->ZIndex(); }
 
 bool nsDisplayItem::ComputeVisibility(nsDisplayListBuilder* aBuilder,
                                       nsRegion* aVisibleRegion) {
   return !GetPaintRect().IsEmpty() &&
          !IsInvisibleInRect(aVisibleRegion->GetBounds());
--- a/modules/libpref/init/StaticPrefList.yaml
+++ b/modules/libpref/init/StaticPrefList.yaml
@@ -3779,16 +3779,22 @@
 #endif
   mirror: once
 
 - name: layers.flash-borders
   type: RelaxedAtomicBool
   value: false
   mirror: always
 
+# Force all possible layers to be always active layers.
+- name: layers.force-active
+  type: bool
+  value: false
+  mirror: always
+
 - name: layers.force-shmem-tiles
   type: bool
   value: false
   mirror: once
 
 - name: layers.draw-mask-debug
   type: RelaxedAtomicBool
   value: false
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -4671,19 +4671,16 @@ pref("widget.window-transforms.disabled"
   #else
     pref("gfx.direct3d11.use-double-buffering", false);
   #endif
 #endif
 
 // Copy-on-write canvas
 pref("layers.shared-buffer-provider.enabled", true);
 
-// Force all possible layers to be always active layers
-pref("layers.force-active", false);
-
 // Timeout for outbound network geolocation provider XHR
 pref("geo.wifi.xhr.timeout", 60000);
 
 // Enable/Disable the device storage API for content
 pref("device.storage.enabled", false);
 
 // Push/Pop/Replace State prefs
 pref("browser.history.maxStateObjectSize", 2097152);