Bug 1550422 - P15. Move Skip and Once gfxPrefs to StaticPrefs. r?jrmuizel! draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 15 May 2019 21:18:29 +1000
changeset 2008592 3e8772162de640369f151f83282f6fa8c2d7401a
parent 2008591 24a3cfcfbbf8f8c24bb97cf5e60d6879673fd00a
child 2008593 ee4d2b82c5c17c8c6711693022cc91efb75532ba
push id363925
push userjyavenard@mozilla.com
push dateSat, 18 May 2019 07:53:18 +0000
treeherdertry@5082cd581229 [default view] [failures only]
reviewersjrmuizel
bugs1550422
milestone68.0a1
Bug 1550422 - P15. Move Skip and Once gfxPrefs to StaticPrefs. r?jrmuizel! Differential Revision: https://phabricator.services.mozilla.com/D31259
dom/media/platforms/wmf/DXVA2Manager.cpp
dom/media/platforms/wmf/WMFDecoderModule.cpp
gfx/2d/HelpersWinFonts.h
gfx/2d/ScaledFontBase.cpp
gfx/gl/GLContext.cpp
gfx/gl/GLLibraryEGL.cpp
gfx/gl/GLScreenBuffer.cpp
gfx/gl/GfxTexturesReporter.cpp
gfx/ipc/GPUChild.cpp
gfx/ipc/GPUParent.cpp
gfx/ipc/GPUProcessHost.cpp
gfx/ipc/GPUProcessManager.cpp
gfx/layers/D3D11ShareHandleImage.cpp
gfx/layers/Layers.cpp
gfx/layers/PaintThread.cpp
gfx/layers/RotatedBuffer.cpp
gfx/layers/apz/src/APZCTreeManager.cpp
gfx/layers/apz/src/AsyncPanZoomController.cpp
gfx/layers/apz/src/AsyncPanZoomController.h
gfx/layers/apz/src/GestureEventListener.cpp
gfx/layers/apz/src/GestureEventListener.h
gfx/layers/apz/src/InputBlockState.h
gfx/layers/apz/src/SimpleVelocityTracker.cpp
gfx/layers/client/ClientLayerManager.cpp
gfx/layers/client/ClientLayerManager.h
gfx/layers/client/ClientTiledPaintedLayer.cpp
gfx/layers/client/MultiTiledContentClient.cpp
gfx/layers/client/SingleTiledContentClient.h
gfx/layers/client/TextureClient.cpp
gfx/layers/client/TextureClientPool.cpp
gfx/layers/client/TiledContentClient.cpp
gfx/layers/client/TiledContentClient.h
gfx/layers/composite/ContainerLayerComposite.cpp
gfx/layers/d3d11/CompositorD3D11.cpp
gfx/layers/d3d11/DeviceAttachmentsD3D11.cpp
gfx/layers/d3d11/MLGDeviceD3D11.cpp
gfx/layers/ipc/CompositorBench.cpp
gfx/layers/ipc/CompositorBridgeChild.cpp
gfx/layers/ipc/CompositorBridgeParent.cpp
gfx/layers/ipc/CompositorManagerChild.cpp
gfx/layers/ipc/CompositorVsyncScheduler.cpp
gfx/layers/ipc/LayerTransactionParent.cpp
gfx/layers/mlgpu/MLGDevice.cpp
gfx/layers/mlgpu/RenderViewMLGPU.cpp
gfx/layers/opengl/CompositorOGL.cpp
gfx/layers/wr/WebRenderBridgeChild.cpp
gfx/layers/wr/WebRenderBridgeParent.cpp
gfx/src/DriverCrashGuard.cpp
gfx/tests/gtest/TestGfxPrefs.cpp
gfx/thebes/D3D11Checks.cpp
gfx/thebes/DeviceManagerDx.cpp
gfx/thebes/gfxAndroidPlatform.cpp
gfx/thebes/gfxPlatform.cpp
gfx/thebes/gfxPlatform.h
gfx/thebes/gfxPlatformFontList.cpp
gfx/thebes/gfxPlatformGtk.cpp
gfx/thebes/gfxPrefs.h
gfx/thebes/gfxUtils.cpp
gfx/thebes/gfxWindowsPlatform.cpp
gfx/vr/VRManager.cpp
gfx/vr/gfxVRExternal.cpp
gfx/vr/gfxVRPuppet.cpp
gfx/vr/ipc/VRProcessManager.cpp
gfx/vr/ipc/VRProcessParent.cpp
gfx/vr/service/OSVRSession.cpp
gfx/vr/service/OculusSession.cpp
gfx/vr/service/OpenVRSession.cpp
gfx/vr/service/VRService.cpp
gfx/vr/service/VRService.h
gfx/vr/service/VRServiceManager.cpp
image/AnimationSurfaceProvider.cpp
image/DecodePool.cpp
image/DecodedSurfaceProvider.cpp
image/FrameAnimator.cpp
image/FrameAnimator.h
image/RasterImage.cpp
image/SurfaceCache.cpp
image/imgLoader.cpp
image/test/gtest/TestSurfaceCache.cpp
layout/base/PresShell.cpp
layout/base/ZoomConstraintsClient.cpp
layout/base/nsLayoutUtils.cpp
layout/generic/nsGfxScrollFrame.cpp
layout/painting/FrameLayerBuilder.cpp
layout/painting/nsDisplayList.cpp
modules/libpref/StaticPrefs.h
modules/libpref/init/StaticPrefList.h
modules/libpref/init/all.js
widget/GfxInfoBase.cpp
widget/nsBaseWidget.cpp
--- a/dom/media/platforms/wmf/DXVA2Manager.cpp
+++ b/dom/media/platforms/wmf/DXVA2Manager.cpp
@@ -10,17 +10,16 @@
 #include "DriverCrashGuard.h"
 #include "GfxDriverInfo.h"
 #include "ImageContainer.h"
 #include "MFTDecoder.h"
 #include "MediaTelemetryConstants.h"
 #include "VideoUtils.h"
 #include "WMFUtils.h"
 #include "gfxCrashReporterUtils.h"
-#include "gfxPrefs.h"
 #include "gfxWindowsPlatform.h"
 #include "mfapi.h"
 #include "mozilla/StaticPrefs.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/gfx/DeviceManagerDx.h"
 #include "mozilla/layers/D3D11ShareHandleImage.h"
 #include "mozilla/layers/ImageBridgeChild.h"
 #include "mozilla/layers/TextureD3D11.h"
@@ -675,32 +674,33 @@ D3D11DXVA2Manager::Init(layers::KnowsCom
 
   if (layers::ImageBridgeChild::GetSingleton() || !aKnowsCompositor) {
     // There's no proper KnowsCompositor for ImageBridge currently (and it
     // implements the interface), so just use that if it's available.
     mTextureClientAllocator = new D3D11RecycleAllocator(
         layers::ImageBridgeChild::GetSingleton().get(), mDevice,
         gfx::SurfaceFormat::NV12);
 
-    if (ImageBridgeChild::GetSingleton() && gfxPrefs::PDMWMFUseSyncTexture() &&
+    if (ImageBridgeChild::GetSingleton() &&
+        StaticPrefs::PDMWMFUseSyncTexture() &&
         mDevice != DeviceManagerDx::Get()->GetCompositorDevice()) {
       // We use a syncobject to avoid the cost of the mutex lock when
       // compositing, and because it allows color conversion ocurring directly
       // from this texture DXVA does not seem to accept IDXGIKeyedMutex textures
       // as input.
       mSyncObject = layers::SyncObjectClient::CreateSyncObjectClient(
           layers::ImageBridgeChild::GetSingleton()
               ->GetTextureFactoryIdentifier()
               .mSyncHandle,
           mDevice);
     }
   } else {
     mTextureClientAllocator = new D3D11RecycleAllocator(
         aKnowsCompositor, mDevice, gfx::SurfaceFormat::NV12);
-    if (gfxPrefs::PDMWMFUseSyncTexture()) {
+    if (StaticPrefs::PDMWMFUseSyncTexture()) {
       // We use a syncobject to avoid the cost of the mutex lock when
       // compositing, and because it allows color conversion ocurring directly
       // from this texture DXVA does not seem to accept IDXGIKeyedMutex textures
       // as input.
       mSyncObject = layers::SyncObjectClient::CreateSyncObjectClient(
           aKnowsCompositor->GetTextureFactoryIdentifier().mSyncHandle, mDevice);
     }
   }
--- a/dom/media/platforms/wmf/WMFDecoderModule.cpp
+++ b/dom/media/platforms/wmf/WMFDecoderModule.cpp
@@ -12,17 +12,16 @@
 #include "MFTDecoder.h"
 #include "MP4Decoder.h"
 #include "MediaInfo.h"
 #include "VPXDecoder.h"
 #include "WMF.h"
 #include "WMFAudioMFTManager.h"
 #include "WMFMediaDataDecoder.h"
 #include "WMFVideoMFTManager.h"
-#include "gfxPrefs.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/StaticMutex.h"
 #include "mozilla/StaticPrefs.h"
 #include "mozilla/WindowsVersion.h"
 #include "mozilla/gfx/gfxVars.h"
 #include "mozilla/mscom/EnsureMTA.h"
 #include "nsAutoPtr.h"
@@ -85,17 +84,17 @@ void WMFDecoderModule::Init() {
     testForVPx = sDXVAEnabled = true;
   } else {
     // Only allow DXVA in the UI process if we aren't in e10s Firefox
     testForVPx = sDXVAEnabled = !mozilla::BrowserTabsRemoteAutostart();
   }
 
   sDXVAEnabled = sDXVAEnabled && gfx::gfxVars::CanUseHardwareVideoDecoding();
   testForVPx = testForVPx && gfx::gfxVars::CanUseHardwareVideoDecoding();
-  if (testForVPx && gfxPrefs::MediaWmfVp9Enabled()) {
+  if (testForVPx && StaticPrefs::MediaWmfVp9Enabled()) {
     gfx::WMFVPXVideoCrashGuard guard;
     if (!guard.Crashed()) {
       sUsableVPXMFT = CanCreateMFTDecoder(CLSID_WebmMfVpxDec);
     }
   }
 }
 
 /* static */
--- a/gfx/2d/HelpersWinFonts.h
+++ b/gfx/2d/HelpersWinFonts.h
@@ -1,26 +1,26 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "gfxPrefs.h"
+#include "mozilla/StaticPrefs.h"
 
 namespace mozilla {
 namespace gfx {
 
 extern BYTE sSystemTextQuality;
 
 static BYTE GetSystemTextQuality() { return sSystemTextQuality; }
 
 static AntialiasMode GetSystemDefaultAAMode() {
   AntialiasMode defaultMode = AntialiasMode::SUBPIXEL;
-  if (gfxPrefs::DisableAllTextAA()) {
+  if (StaticPrefs::DisableAllTextAA()) {
     return AntialiasMode::NONE;
   }
 
   switch (GetSystemTextQuality()) {
     case CLEARTYPE_QUALITY:
       defaultMode = AntialiasMode::SUBPIXEL;
       break;
     case ANTIALIASED_QUALITY:
--- a/gfx/2d/ScaledFontBase.cpp
+++ b/gfx/2d/ScaledFontBase.cpp
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ScaledFontBase.h"
 
-#include "gfxPrefs.h"
+#include "mozilla/StaticPrefs.h"
 
 #ifdef USE_SKIA
 #  include "PathSkia.h"
 #  include "skia/include/core/SkFont.h"
 #endif
 
 #ifdef USE_CAIRO
 #  include "PathCairo.h"
@@ -31,17 +31,17 @@ Atomic<uint32_t> UnscaledFont::sDeletion
 
 UnscaledFont::~UnscaledFont() { sDeletionCounter++; }
 
 Atomic<uint32_t> ScaledFont::sDeletionCounter(0);
 
 ScaledFont::~ScaledFont() { sDeletionCounter++; }
 
 AntialiasMode ScaledFont::GetDefaultAAMode() {
-  if (gfxPrefs::DisableAllTextAA()) {
+  if (StaticPrefs::DisableAllTextAA()) {
     return AntialiasMode::NONE;
   }
 
   return AntialiasMode::DEFAULT;
 }
 
 ScaledFontBase::~ScaledFontBase() {
 #ifdef USE_SKIA
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -29,17 +29,17 @@
 #include "nsPrintfCString.h"
 #include "nsThreadUtils.h"
 #include "prenv.h"
 #include "prlink.h"
 #include "ScopedGLHelpers.h"
 #include "SharedSurfaceGL.h"
 #include "GfxTexturesReporter.h"
 #include "gfx2DGlue.h"
-#include "gfxPrefs.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/IntegerPrintfMacros.h"
 #include "mozilla/gfx/Logging.h"
 
 #include "OGLShaderProgram.h"  // for ShaderProgramType
 
 #include "mozilla/DebugOnly.h"
 
 #ifdef XP_MACOSX
@@ -269,17 +269,17 @@ uint8_t GLContext::ChooseDebugFlags(cons
 GLContext::GLContext(CreateContextFlags flags, const SurfaceCaps& caps,
                      GLContext* sharedContext, bool isOffscreen,
                      bool useTLSIsCurrent)
     : mUseTLSIsCurrent(ShouldUseTLSIsCurrent(useTLSIsCurrent)),
       mIsOffscreen(isOffscreen),
       mDebugFlags(ChooseDebugFlags(flags)),
       mSharedContext(sharedContext),
       mCaps(caps),
-      mWorkAroundDriverBugs(gfxPrefs::WorkAroundDriverBugs()) {
+      mWorkAroundDriverBugs(StaticPrefs::WorkAroundDriverBugs()) {
   mOwningThreadId = PlatformThread::CurrentId();
   MOZ_ALWAYS_TRUE(sCurrentContext.init());
   sCurrentContext.set(0);
 }
 
 GLContext::~GLContext() {
   NS_ASSERTION(
       IsDestroyed(),
--- a/gfx/gl/GLLibraryEGL.cpp
+++ b/gfx/gl/GLLibraryEGL.cpp
@@ -7,16 +7,17 @@
 #include "gfxConfig.h"
 #include "gfxCrashReporterUtils.h"
 #include "gfxUtils.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Assertions.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/Tokenizer.h"
 #include "mozilla/ScopeExit.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/Unused.h"
 #include "mozilla/webrender/RenderThread.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsIGfxInfo.h"
 #include "nsPrintfCString.h"
 #ifdef XP_WIN
 #  include "mozilla/gfx/DeviceManagerDx.h"
@@ -81,17 +82,17 @@ PRLibrary* LoadApitraceLibrary() {
   // on other platforms. We look for it in /data/local
   // as that's writeable by all users.
   path = "/data/local/tmp/egltrace.so";
 #endif
   if (!path) return nullptr;
 
   // Initialization of gfx prefs here is only needed during the unit tests...
   gfxPrefs::GetSingleton();
-  if (!gfxPrefs::UseApitrace()) {
+  if (!StaticPrefs::UseApitrace()) {
     return nullptr;
   }
 
   static PRLibrary* sApitraceLibrary = nullptr;
   if (sApitraceLibrary) return sApitraceLibrary;
 
   nsAutoCString logFile;
   Preferences::GetCString("gfx.apitrace.logfile", logFile);
--- a/gfx/gl/GLScreenBuffer.cpp
+++ b/gfx/gl/GLScreenBuffer.cpp
@@ -2,17 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "GLScreenBuffer.h"
 
 #include <cstring>
 #include "CompositorTypes.h"
-#include "gfxPrefs.h"
+#include "mozilla/StaticPrefs.h"
 #include "GLContext.h"
 #include "GLBlitHelper.h"
 #include "GLReadTexImageHelper.h"
 #include "SharedSurfaceEGL.h"
 #include "SharedSurfaceGL.h"
 #include "ScopedGLHelpers.h"
 #include "gfx2DGlue.h"
 #include "../layers/ipc/ShadowLayers.h"
@@ -64,21 +64,21 @@ UniquePtr<SurfaceFactory> GLScreenBuffer
     GLContext* gl, const SurfaceCaps& caps,
     KnowsCompositor* compositorConnection, const layers::TextureFlags& flags) {
   LayersIPCChannel* ipcChannel = compositorConnection->GetTextureForwarder();
   const layers::LayersBackend backend =
       compositorConnection->GetCompositorBackendType();
   const bool useANGLE = compositorConnection->GetCompositorUseANGLE();
 
   const bool useGl =
-      !gfxPrefs::WebGLForceLayersReadback() &&
+      !StaticPrefs::WebGLForceLayersReadback() &&
       (backend == layers::LayersBackend::LAYERS_OPENGL ||
        (backend == layers::LayersBackend::LAYERS_WR && !useANGLE));
   const bool useD3D =
-      !gfxPrefs::WebGLForceLayersReadback() &&
+      !StaticPrefs::WebGLForceLayersReadback() &&
       (backend == layers::LayersBackend::LAYERS_D3D11 ||
        (backend == layers::LayersBackend::LAYERS_WR && useANGLE));
 
   UniquePtr<SurfaceFactory> factory = nullptr;
   if (useGl) {
 #if defined(XP_MACOSX)
     factory = SurfaceFactory_IOSurface::Create(gl, caps, ipcChannel, flags);
 #elif defined(MOZ_X11)
--- a/gfx/gl/GfxTexturesReporter.cpp
+++ b/gfx/gl/GfxTexturesReporter.cpp
@@ -3,17 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include <string>
 #include <sstream>
 #include "nsExceptionHandler.h"
 #include "GfxTexturesReporter.h"
-#include "gfxPrefs.h"
+#include "mozilla/StaticPrefs.h"
 
 using namespace mozilla;
 using namespace mozilla::gl;
 
 NS_IMPL_ISUPPORTS(GfxTexturesReporter, nsIMemoryReporter)
 
 Atomic<size_t> GfxTexturesReporter::sAmount(0);
 Atomic<size_t> GfxTexturesReporter::sPeakAmount(0);
@@ -54,25 +54,25 @@ std::string FormatBytes(size_t amount) {
 /* static */
 void GfxTexturesReporter::UpdateAmount(MemoryUse action, size_t amount) {
   if (action == MemoryFreed) {
     MOZ_RELEASE_ASSERT(
         amount <= sAmount,
         "GFX: Current texture usage greater than update amount.");
     sAmount -= amount;
 
-    if (gfxPrefs::GfxLoggingTextureUsageEnabled()) {
+    if (StaticPrefs::GfxLoggingTextureUsageEnabled()) {
       printf_stderr("Current texture usage: %s\n",
                     FormatBytes(sAmount).c_str());
     }
   } else {
     sAmount += amount;
     if (sAmount > sPeakAmount) {
       sPeakAmount.exchange(sAmount);
-      if (gfxPrefs::GfxLoggingPeakTextureUsageEnabled()) {
+      if (StaticPrefs::GfxLoggingPeakTextureUsageEnabled()) {
         printf_stderr("Peak texture usage: %s\n",
                       FormatBytes(sPeakAmount).c_str());
       }
     }
   }
 
   CrashReporter::AnnotateTexturesSize(sAmount);
 }
--- a/gfx/ipc/GPUChild.cpp
+++ b/gfx/ipc/GPUChild.cpp
@@ -4,16 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #include "GPUChild.h"
 #include "gfxConfig.h"
 #include "gfxPrefs.h"
 #include "GPUProcessHost.h"
 #include "GPUProcessManager.h"
 #include "VRProcessManager.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/TelemetryIPC.h"
 #include "mozilla/dom/CheckerboardReportService.h"
 #include "mozilla/dom/MemoryReportRequest.h"
 #include "mozilla/gfx/gfxVars.h"
 #if defined(XP_WIN)
 #  include "mozilla/gfx/DeviceManagerDx.h"
 #endif
@@ -153,33 +154,33 @@ mozilla::ipc::IPCResult GPUChild::RecvIn
                                                       aShmem, aThreadId);
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult GPUChild::RecvCreateVRProcess() {
   // Make sure create VR process at the main process
   MOZ_ASSERT(XRE_IsParentProcess());
-  if (gfxPrefs::VRProcessEnabled()) {
+  if (StaticPrefs::VRProcessEnabled()) {
     VRProcessManager::Initialize();
     VRProcessManager* vr = VRProcessManager::Get();
     MOZ_ASSERT(vr, "VRProcessManager must be initialized first.");
 
     if (vr) {
       vr->LaunchVRProcess();
     }
   }
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult GPUChild::RecvShutdownVRProcess() {
   // Make sure stopping VR process at the main process
   MOZ_ASSERT(XRE_IsParentProcess());
-  if (gfxPrefs::VRProcessEnabled()) {
+  if (StaticPrefs::VRProcessEnabled()) {
     VRProcessManager::Shutdown();
   }
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult GPUChild::RecvNotifyUiObservers(
     const nsCString& aTopic) {
--- a/gfx/ipc/GPUParent.cpp
+++ b/gfx/ipc/GPUParent.cpp
@@ -10,16 +10,17 @@
 #include "gfxConfig.h"
 #include "gfxCrashReporterUtils.h"
 #include "gfxPlatform.h"
 #include "gfxPrefs.h"
 #include "GLContextProvider.h"
 #include "GPUProcessHost.h"
 #include "GPUProcessManager.h"
 #include "mozilla/Assertions.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/VideoDecoderManagerChild.h"
 #include "mozilla/VideoDecoderManagerParent.h"
 #include "mozilla/dom/MemoryReportRequest.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/gfx/gfxVars.h"
 #include "mozilla/image/ImageMemoryReporter.h"
@@ -482,17 +483,17 @@ mozilla::ipc::IPCResult GPUParent::RecvR
       },
       [&](const uint32_t& aGeneration) {
         return GetSingleton()->SendFinishMemoryReport(aGeneration);
       });
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult GPUParent::RecvShutdownVR() {
-  if (gfxPrefs::VRProcessEnabled()) {
+  if (StaticPrefs::VRProcessEnabled()) {
     VRGPUChild::Shutdown();
   }
   return IPC_OK();
 }
 
 void GPUParent::ActorDestroy(ActorDestroyReason aWhy) {
   if (AbnormalShutdown == aWhy) {
     NS_WARNING("Shutting down GPU process early due to a crash!");
--- a/gfx/ipc/GPUProcessHost.cpp
+++ b/gfx/ipc/GPUProcessHost.cpp
@@ -1,20 +1,20 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "GPUProcessHost.h"
 #include "chrome/common/process_watcher.h"
-#include "gfxPrefs.h"
 #include "mozilla/gfx/Logging.h"
 #include "nsITimer.h"
 #include "mozilla/Preferences.h"
+#include "mozilla/StaticPrefs.h"
 #include "VRGPUChild.h"
 #include "ProcessUtils.h"
 
 namespace mozilla {
 namespace gfx {
 
 using namespace ipc;
 
@@ -57,17 +57,17 @@ bool GPUProcessHost::Launch(StringVector
   return true;
 }
 
 bool GPUProcessHost::WaitForLaunch() {
   if (mLaunchPhase == LaunchPhase::Complete) {
     return !!mGPUChild;
   }
 
-  int32_t timeoutMs = gfxPrefs::GPUProcessTimeoutMs();
+  int32_t timeoutMs = StaticPrefs::GPUProcessTimeoutMs();
 
   // If one of the following environment variables are set we can effectively
   // ignore the timeout - as we can guarantee the compositor process will be
   // terminated
   if (PR_GetEnv("MOZ_DEBUG_CHILD_PROCESS") ||
       PR_GetEnv("MOZ_DEBUG_CHILD_PAUSE")) {
     timeoutMs = 0;
   }
--- a/gfx/ipc/GPUProcessManager.cpp
+++ b/gfx/ipc/GPUProcessManager.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "GPUProcessManager.h"
 
-#include "gfxPrefs.h"
 #include "GPUProcessHost.h"
 #include "GPUProcessListener.h"
 #include "mozilla/MemoryReportingProcess.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Sprintf.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/StaticPrefs.h"
 #include "mozilla/VideoDecoderManagerChild.h"
@@ -380,18 +379,18 @@ void GPUProcessManager::OnProcessLaunchC
   CrashReporter::AnnotateCrashReport(
       CrashReporter::Annotation::GPUProcessLaunchCount,
       static_cast<int>(mNumProcessAttempts));
 }
 
 static bool ShouldLimitDeviceResets(uint32_t count, int32_t deltaMilliseconds) {
   // We decide to limit by comparing the amount of resets that have happened
   // and time since the last reset to two prefs.
-  int32_t timeLimit = gfxPrefs::DeviceResetThresholdMilliseconds();
-  int32_t countLimit = gfxPrefs::DeviceResetLimitCount();
+  int32_t timeLimit = StaticPrefs::DeviceResetThresholdMilliseconds();
+  int32_t countLimit = StaticPrefs::DeviceResetLimitCount();
 
   bool hasTimeLimit = timeLimit >= 0;
   bool hasCountLimit = countLimit >= 0;
 
   bool triggeredTime = deltaMilliseconds < timeLimit;
   bool triggeredCount = count > (uint32_t)countLimit;
 
   // If we have both prefs set then it needs to trigger both limits,
--- a/gfx/layers/D3D11ShareHandleImage.cpp
+++ b/gfx/layers/D3D11ShareHandleImage.cpp
@@ -5,18 +5,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "D3D11ShareHandleImage.h"
 #include <memory>
 #include "DXVA2Manager.h"
 #include "WMF.h"
 #include "d3d11.h"
 #include "gfxImageSurface.h"
-#include "gfxPrefs.h"
 #include "gfxWindowsPlatform.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/gfx/DeviceManagerDx.h"
 #include "mozilla/layers/CompositableClient.h"
 #include "mozilla/layers/CompositableForwarder.h"
 #include "mozilla/layers/TextureClient.h"
 #include "mozilla/layers/TextureD3D11.h"
 
 namespace mozilla {
 namespace layers {
@@ -251,17 +251,17 @@ already_AddRefed<TextureClient> D3D11Rec
   // we could not reuse old D3D11Textures. It could cause video flickering.
   RefPtr<ID3D11Device> device = gfx::DeviceManagerDx::Get()->GetImageDevice();
   if (!!mImageDevice && mImageDevice != device) {
     ShrinkToMinimumSize();
   }
   mImageDevice = device;
 
   TextureAllocationFlags allocFlags = TextureAllocationFlags::ALLOC_DEFAULT;
-  if (gfxPrefs::PDMWMFUseSyncTexture() ||
+  if (StaticPrefs::PDMWMFUseSyncTexture() ||
       mDevice == DeviceManagerDx::Get()->GetCompositorDevice()) {
     // If our device is the compositor device, we don't need any synchronization
     // in practice.
     allocFlags = TextureAllocationFlags::ALLOC_MANUAL_SYNCHRONIZATION;
   }
 
   D3D11TextureClientAllocationHelper helper(mUsableSurfaceFormat, aColorSpace,
                                             aSize, allocFlags, mDevice,
--- a/gfx/layers/Layers.cpp
+++ b/gfx/layers/Layers.cpp
@@ -12,21 +12,21 @@
 #include "ImageLayers.h"       // for ImageLayer
 #include "LayerSorter.h"       // for SortLayersBy3DZOrder
 #include "LayersLogging.h"     // for AppendToString
 #include "LayerUserData.h"
 #include "ReadbackLayer.h"   // for ReadbackLayer
 #include "UnitTransforms.h"  // for ViewAs
 #include "gfxEnv.h"
 #include "gfxPlatform.h"  // for gfxPlatform
-#include "gfxPrefs.h"
 #include "gfxUtils.h"  // for gfxUtils, etc
 #include "gfx2DGlue.h"
 #include "mozilla/DebugOnly.h"  // for DebugOnly
 #include "mozilla/IntegerPrintfMacros.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/Telemetry.h"  // for Accumulate
 #include "mozilla/ToString.h"
 #include "mozilla/gfx/2D.h"        // for DrawTarget
 #include "mozilla/gfx/BaseSize.h"  // for BaseSize
 #include "mozilla/gfx/Matrix.h"    // for Matrix4x4
 #include "mozilla/gfx/Polygon.h"   // for Polygon
 #include "mozilla/layers/AsyncCanvasRenderer.h"
 #include "mozilla/layers/BSPTree.h"             // for BSPTree
@@ -134,17 +134,17 @@ LayerManager::CreatePersistentBufferProv
 
 already_AddRefed<ImageContainer> LayerManager::CreateImageContainer(
     ImageContainer::Mode flag) {
   RefPtr<ImageContainer> container = new ImageContainer(flag);
   return container.forget();
 }
 
 bool LayerManager::AreComponentAlphaLayersEnabled() {
-  return gfxPrefs::ComponentAlphaEnabled();
+  return StaticPrefs::ComponentAlphaEnabled();
 }
 
 /*static*/
 void LayerManager::LayerUserDataDestroy(void* data) {
   delete static_cast<LayerUserData*>(data);
 }
 
 UniquePtr<LayerUserData> LayerManager::RemoveUserData(void* aKey) {
--- a/gfx/layers/PaintThread.cpp
+++ b/gfx/layers/PaintThread.cpp
@@ -5,23 +5,23 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "PaintThread.h"
 
 #include <algorithm>
 
 #include "base/task.h"
 #include "gfxPlatform.h"
-#include "gfxPrefs.h"
 #include "GeckoProfiler.h"
 #include "mozilla/layers/CompositorBridgeChild.h"
 #include "mozilla/layers/ShadowLayers.h"
 #include "mozilla/layers/SyncObject.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/Preferences.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/SharedThreadPool.h"
 #include "mozilla/SyncRunnable.h"
 #include "nsIPropertyBag2.h"
 #include "nsServiceManagerUtils.h"
 #include "prsystem.h"
 
 // Uncomment the following line to dispatch sync runnables when
 // painting so that rasterization happens synchronously from
@@ -43,17 +43,17 @@ PaintThread::PaintThread() {}
 
 void PaintThread::Release() {}
 
 void PaintThread::AddRef() {}
 
 /* static */
 int32_t PaintThread::CalculatePaintWorkerCount() {
   int32_t cpuCores = PR_GetNumberOfProcessors();
-  int32_t workerCount = gfxPrefs::LayersOMTPPaintWorkers();
+  int32_t workerCount = StaticPrefs::LayersOMTPPaintWorkers();
 
   // If not manually specified, default to (cpuCores * 3) / 4, and clamp
   // between 1 and 4. If a user wants more, they can manually specify it
   if (workerCount < 1) {
     workerCount = std::min(std::max((cpuCores * 3) / 4, 1), 4);
   }
 
   return workerCount;
--- a/gfx/layers/RotatedBuffer.cpp
+++ b/gfx/layers/RotatedBuffer.cpp
@@ -7,29 +7,29 @@
 #include "RotatedBuffer.h"
 #include <sys/types.h>              // for int32_t
 #include <algorithm>                // for max
 #include "BasicImplData.h"          // for BasicImplData
 #include "BasicLayersImpl.h"        // for ToData
 #include "GeckoProfiler.h"          // for AUTO_PROFILER_LABEL
 #include "Layers.h"                 // for PaintedLayer, Layer, etc
 #include "gfxPlatform.h"            // for gfxPlatform
-#include "gfxPrefs.h"               // for gfxPrefs
 #include "gfxUtils.h"               // for gfxUtils
 #include "mozilla/ArrayUtils.h"     // for ArrayLength
 #include "mozilla/gfx/BasePoint.h"  // for BasePoint
 #include "mozilla/gfx/BaseRect.h"   // for BaseRect
 #include "mozilla/gfx/BaseSize.h"   // for BaseSize
 #include "mozilla/gfx/Matrix.h"     // for Matrix
 #include "mozilla/gfx/Point.h"      // for Point, IntPoint
 #include "mozilla/gfx/Rect.h"       // for Rect, IntRect
 #include "mozilla/gfx/Types.h"      // for ExtendMode::ExtendMode::CLAMP, etc
 #include "mozilla/layers/ShadowLayers.h"   // for ShadowableLayer
 #include "mozilla/layers/TextureClient.h"  // for TextureClient
 #include "mozilla/Move.h"                  // for Move
+#include "mozilla/StaticPrefs.h"           // for StaticPrefs
 #include "mozilla/gfx/Point.h"             // for IntSize
 #include "gfx2DGlue.h"
 #include "nsLayoutUtils.h"  // for invalidation debugging
 #include "PaintThread.h"
 
 namespace mozilla {
 
 using namespace gfx;
@@ -71,17 +71,17 @@ Rect RotatedBuffer::GetSourceRectangle(X
 }
 
 void RotatedBuffer::BeginCapture() {
   RefPtr<gfx::DrawTarget> target = GetBufferTarget();
 
   MOZ_ASSERT(!mCapture);
   MOZ_ASSERT(target);
   mCapture = Factory::CreateCaptureDrawTargetForTarget(
-      target, gfxPrefs::LayersOMTPCaptureLimit());
+      target, StaticPrefs::LayersOMTPCaptureLimit());
 }
 
 RefPtr<gfx::DrawTargetCapture> RotatedBuffer::EndCapture() {
   MOZ_ASSERT(mCapture);
   return std::move(mCapture);
 }
 
 /**
--- a/gfx/layers/apz/src/APZCTreeManager.cpp
+++ b/gfx/layers/apz/src/APZCTreeManager.cpp
@@ -599,17 +599,17 @@ APZCTreeManager::UpdateHitTestingTreeImp
   CollectTransformsForChromeMainThread(aRootLayerTreeId);
 }
 
 void APZCTreeManager::UpdateFocusState(LayersId aRootLayerTreeId,
                                        LayersId aOriginatingLayersId,
                                        const FocusTarget& aFocusTarget) {
   AssertOnUpdaterThread();
 
-  if (!gfxPrefs::APZKeyboardEnabled()) {
+  if (!StaticPrefs::APZKeyboardEnabled()) {
     return;
   }
 
   mFocusState.Update(aRootLayerTreeId, aOriginatingLayersId, aFocusTarget);
 }
 
 void APZCTreeManager::UpdateHitTestingTree(LayersId aRootLayerTreeId,
                                            Layer* aRoot, bool aIsFirstPaint,
@@ -1535,17 +1535,17 @@ nsEventStatus APZCTreeManager::ReceiveIn
         apzc->GetGuid(aOutTargetGuid);
         tapInput.mPoint = *untransformedPoint;
       }
       break;
     }
     case KEYBOARD_INPUT: {
       // Disable async keyboard scrolling when accessibility.browsewithcaret is
       // enabled
-      if (!gfxPrefs::APZKeyboardEnabled() ||
+      if (!StaticPrefs::APZKeyboardEnabled() ||
           StaticPrefs::AccessibilityBrowseWithCaret()) {
         APZ_KEY_LOG("Skipping key input from invalid prefs\n");
         return result;
       }
 
       KeyboardInput& keyInput = aEvent.AsKeyboardInput();
 
       // Try and find a matching shortcut for this keyboard input
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -41,16 +41,17 @@
 #include "mozilla/ClearOnShutdown.h"    // for ClearOnShutdown
 #include "mozilla/ComputedTimingFunction.h"  // for ComputedTimingFunction
 #include "mozilla/EventForwards.h"           // for nsEventStatus_*
 #include "mozilla/EventStateManager.h"       // for EventStateManager
 #include "mozilla/MouseEvents.h"             // for WidgetWheelEvent
 #include "mozilla/Preferences.h"             // for Preferences
 #include "mozilla/RecursiveMutex.h"          // for RecursiveMutexAutoLock, etc
 #include "mozilla/RefPtr.h"                  // for RefPtr
+#include "mozilla/StaticPrefs.h"             // for StaticPrefs
 #include "mozilla/StaticPtr.h"               // for StaticAutoPtr
 #include "mozilla/Telemetry.h"               // for Telemetry
 #include "mozilla/TimeStamp.h"               // for TimeDuration, TimeStamp
 #include "mozilla/dom/CheckerboardReportService.h"  // for CheckerboardEventStorage
 // note: CheckerboardReportService.h actually lives in gfx/layers/apz/util/
 #include "mozilla/dom/Touch.h"              // for Touch
 #include "mozilla/gfx/BasePoint.h"          // for BasePoint
 #include "mozilla/gfx/BaseRect.h"           // for BaseRect
@@ -810,18 +811,18 @@ void AsyncPanZoomController::InitializeG
   sInitialized = true;
 
   MOZ_ASSERT(NS_IsMainThread());
 
   gZoomAnimationFunction =
       new ComputedTimingFunction(nsTimingFunction(StyleTimingKeyword::Ease));
   ClearOnShutdown(&gZoomAnimationFunction);
   gVelocityCurveFunction = new ComputedTimingFunction(nsTimingFunction(
-      gfxPrefs::APZCurveFunctionX1(), gfxPrefs::APZCurveFunctionY1(),
-      gfxPrefs::APZCurveFunctionX2(), gfxPrefs::APZCurveFunctionY2()));
+      StaticPrefs::APZCurveFunctionX1(), StaticPrefs::APZCurveFunctionY1(),
+      StaticPrefs::APZCurveFunctionX2(), StaticPrefs::APZCurveFunctionY2()));
   ClearOnShutdown(&gVelocityCurveFunction);
 
   uint64_t sysmem = PR_GetPhysicalMemorySize();
   uint64_t threshold = 1LL << 32;  // 4 GB in bytes
   gIsHighMemSystem = sysmem >= threshold;
 
   PlatformSpecificState::InitializeGlobalState();
 }
@@ -838,18 +839,18 @@ AsyncPanZoomController::AsyncPanZoomCont
       // mTreeManager must be initialized before GetFrameTime() is called
       mTreeManager(aTreeManager),
       mRecursiveMutex("AsyncPanZoomController"),
       mLastContentPaintMetrics(mLastContentPaintMetadata.GetMetrics()),
       mX(this),
       mY(this),
       mPanDirRestricted(false),
       mPinchLocked(false),
-      mPinchEventBuffer(
-          TimeDuration::FromMilliseconds(gfxPrefs::APZPinchLockBufferMaxAge())),
+      mPinchEventBuffer(TimeDuration::FromMilliseconds(
+          StaticPrefs::APZPinchLockBufferMaxAge())),
       mZoomConstraints(false, false,
                        mScrollMetadata.GetMetrics().GetDevPixelsPerCSSPixel() *
                            kViewportMinScale / ParentLayerToScreenScale(1),
                        mScrollMetadata.GetMetrics().GetDevPixelsPerCSSPixel() *
                            kViewportMaxScale / ParentLayerToScreenScale(1)),
       mLastSampleTime(GetFrameTime()),
       mLastCheckerboardReport(GetFrameTime()),
       mOverscrollEffect(MakeUnique<OverscrollEffect>(*this)),
@@ -1046,17 +1047,17 @@ nsEventStatus AsyncPanZoomController::Ha
 
   const ScrollbarData& scrollbarData = node->GetScrollbarData();
   MOZ_ASSERT(scrollbarData.mScrollbarLayerType ==
              layers::ScrollbarLayerType::Thumb);
   MOZ_ASSERT(scrollbarData.mDirection.isSome());
   ScrollDirection direction = *scrollbarData.mDirection;
 
   bool isMouseAwayFromThumb = false;
-  if (int snapMultiplier = gfxPrefs::SliderSnapMultiplier()) {
+  if (int snapMultiplier = StaticPrefs::SliderSnapMultiplier()) {
     // It's fine to ignore the async component of the thumb's transform,
     // because any async transform of the thumb will be in the direction of
     // scrolling, but here we're interested in the other direction.
     ParentLayerRect thumbRect =
         (node->GetTransform() * AsyncTransformMatrix())
             .TransformBounds(LayerRect(node->GetVisibleRegion().GetBounds()));
     ScrollDirection otherDirection = GetPerpendicularDirection(direction);
     ParentLayerCoord distance =
@@ -5015,17 +5016,17 @@ void AsyncPanZoomController::DispatchSta
 
   if (RefPtr<GeckoContentController> controller = GetGeckoContentController()) {
     if (!IsTransformingState(aOldState) && IsTransformingState(aNewState)) {
       controller->NotifyAPZStateChange(GetGuid(),
                                        APZStateChange::eTransformBegin);
 #if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
       // Let the compositor know about scroll state changes so it can manage
       // windowed plugins.
-      if (gfxPrefs::HidePluginsForScroll() && mCompositorController) {
+      if (StaticPrefs::HidePluginsForScroll() && mCompositorController) {
         mCompositorController->ScheduleHideAllPluginWindows();
       }
 #endif
     } else if (IsTransformingState(aOldState) &&
                !IsTransformingState(aNewState)) {
 #if defined(MOZ_WIDGET_ANDROID)
       // The Android UI thread only shows overlay UI elements when the content
       // is not being panned or zoomed and it is in a steady state. So the
@@ -5037,17 +5038,17 @@ void AsyncPanZoomController::DispatchSta
           animator->UpdateRootFrameMetrics(Metrics());
         }
       }
 #endif
 
       controller->NotifyAPZStateChange(GetGuid(),
                                        APZStateChange::eTransformEnd);
 #if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
-      if (gfxPrefs::HidePluginsForScroll() && mCompositorController) {
+      if (StaticPrefs::HidePluginsForScroll() && mCompositorController) {
         mCompositorController->ScheduleShowAllPluginWindows();
       }
 #endif
     }
   }
 }
 
 bool AsyncPanZoomController::IsTransformingState(PanZoomState aState) {
--- a/gfx/layers/apz/src/AsyncPanZoomController.h
+++ b/gfx/layers/apz/src/AsyncPanZoomController.h
@@ -1142,17 +1142,17 @@ class AsyncPanZoomController {
   /**
    * Samples the composited async transform, making the result of
    * |GetCurrentAsyncTransform(eForCompositing)| and similar functions reflect
    * the async scroll offset and zoom stored in |Metrics()|.
    *
    * Returns true if the newly sampled value is different from the previously
    * sampled value.
    *
-   * (This is only relevant when |gfxPrefs::APZFrameDelayEnabled() == true|.
+   * (This is only relevant when |StaticPrefs::APZFrameDelayEnabled() == true|.
    * Otherwise, GetCurrentAsyncTransform() always reflects what's stored in
    * |Metrics()| immediately, without any delay.)
    */
   bool SampleCompositedAsyncTransform();
 
   /**
    * Returns the incremental transformation corresponding to the async
    * panning/zooming of the layout viewport (unlike GetCurrentAsyncTransform,
--- a/gfx/layers/apz/src/GestureEventListener.cpp
+++ b/gfx/layers/apz/src/GestureEventListener.cpp
@@ -7,16 +7,17 @@
 #include "GestureEventListener.h"
 #include <math.h>                    // for fabsf
 #include <stddef.h>                  // for size_t
 #include "AsyncPanZoomController.h"  // for AsyncPanZoomController
 #include "InputBlockState.h"         // for TouchBlockState
 #include "base/task.h"               // for CancelableTask, etc
 #include "gfxPrefs.h"                // for gfxPrefs
 #include "InputBlockState.h"         // for TouchBlockState
+#include "mozilla/StaticPrefs.h"     // for StaticPrefs
 #include "nsDebug.h"                 // for NS_WARNING
 #include "nsMathUtils.h"             // for NS_hypot
 
 #define GEL_LOG(...)
 // #define GEL_LOG(...) printf_stderr("GEL: " __VA_ARGS__)
 
 namespace mozilla {
 namespace layers {
@@ -286,17 +287,17 @@ nsEventStatus GestureEventListener::Hand
         mSingleTapSent = Nothing();
         SetState(GESTURE_NONE);
       }
       break;
     }
 
     // The user has performed a double tap, but not lifted her finger.
     case GESTURE_SECOND_SINGLE_TOUCH_DOWN: {
-      // If touch has moved noticeably (within gfxPrefs::APZMaxTapTime()),
+      // If touch has moved noticeably (within StaticPrefs::APZMaxTapTime()),
       // change state.
       if (MoveDistanceIsLarge()) {
         CancelLongTapTimeoutTask();
         CancelMaxTapTimeoutTask();
         mSingleTapSent = Nothing();
         if (!StaticPrefs::APZOneTouchPinchEnabled()) {
           // If the one-touch-pinch feature is disabled, bail out of the double-
           // tap gesture instead.
--- a/gfx/layers/apz/src/GestureEventListener.h
+++ b/gfx/layers/apz/src/GestureEventListener.h
@@ -79,27 +79,27 @@ class GestureEventListener final {
     // In this state there's no gesture going on, and we don't think we're
     // about to enter one.
     // Allowed next states: GESTURE_FIRST_SINGLE_TOUCH_DOWN,
     // GESTURE_MULTI_TOUCH_DOWN.
     GESTURE_NONE,
 
     // A touch start with a single touch point has just happened.
     // After having gotten into this state we start timers for MAX_TAP_TIME and
-    // gfxPrefs::UiClickHoldContextMenusDelay().
+    // StaticPrefs::UiClickHoldContextMenusDelay().
     // Allowed next states: GESTURE_MULTI_TOUCH_DOWN, GESTURE_NONE,
     //                      GESTURE_FIRST_SINGLE_TOUCH_UP,
     //                      GESTURE_LONG_TOUCH_DOWN,
     //                      GESTURE_FIRST_SINGLE_TOUCH_MAX_TAP_DOWN.
     GESTURE_FIRST_SINGLE_TOUCH_DOWN,
 
     // While in GESTURE_FIRST_SINGLE_TOUCH_DOWN state a MAX_TAP_TIME timer got
     // triggered. Now we'll trigger either a single tap if a user lifts her
-    // finger or a long tap if gfxPrefs::UiClickHoldContextMenusDelay() happens
-    // first.
+    // finger or a long tap if StaticPrefs::UiClickHoldContextMenusDelay()
+    // happens first.
     // Allowed next states: GESTURE_MULTI_TOUCH_DOWN, GESTURE_NONE,
     //                      GESTURE_LONG_TOUCH_DOWN.
     GESTURE_FIRST_SINGLE_TOUCH_MAX_TAP_DOWN,
 
     // A user put her finger down and lifted it up quickly enough.
     // After having gotten into this state we clear the timer for MAX_TAP_TIME.
     // Allowed next states: GESTURE_SECOND_SINGLE_TOUCH_DOWN, GESTURE_NONE,
     //                      GESTURE_MULTI_TOUCH_DOWN.
--- a/gfx/layers/apz/src/InputBlockState.h
+++ b/gfx/layers/apz/src/InputBlockState.h
@@ -102,19 +102,19 @@ class InputBlockState : public RefCounte
  private:
   RefPtr<AsyncPanZoomController> mTargetApzc;
   TargetConfirmationState mTargetConfirmed;
   bool mRequiresTargetConfirmation;
   const uint64_t mBlockId;
 
   // The APZC that was actually scrolled by events in this input block.
   // This is used in configurations where a single input block is only
-  // allowed to scroll a single APZC (configurations where gfxPrefs::
-  // APZAllowImmediateHandoff() is false).
-  // Set the first time an input event in this block scrolls an APZC.
+  // allowed to scroll a single APZC (configurations where
+  // StaticPrefs::APZAllowImmediateHandoff() is false). Set the first time an
+  // input event in this block scrolls an APZC.
   RefPtr<AsyncPanZoomController> mScrolledApzc;
 
  protected:
   RefPtr<const OverscrollHandoffChain> mOverscrollHandoffChain;
 
   // Used to transform events from global screen space to |mTargetApzc|'s
   // screen space. It's cached at the beginning of the input block so that
   // all events in the block are in the same coordinate space.
--- a/gfx/layers/apz/src/SimpleVelocityTracker.cpp
+++ b/gfx/layers/apz/src/SimpleVelocityTracker.cpp
@@ -98,17 +98,17 @@ Maybe<float> SimpleVelocityTracker::Comp
   return Some(velocity);
 }
 
 void SimpleVelocityTracker::Clear() { mVelocityQueue.Clear(); }
 
 void SimpleVelocityTracker::AddVelocityToQueue(uint32_t aTimestampMs,
                                                float aVelocity) {
   mVelocityQueue.AppendElement(std::make_pair(aTimestampMs, aVelocity));
-  if (mVelocityQueue.Length() > gfxPrefs::APZMaxVelocityQueueSize()) {
+  if (mVelocityQueue.Length() > StaticPrefs::APZMaxVelocityQueueSize()) {
     mVelocityQueue.RemoveElementAt(0);
   }
 }
 
 float SimpleVelocityTracker::ApplyFlingCurveToVelocity(float aVelocity) const {
   float newVelocity = aVelocity;
   if (StaticPrefs::APZMaxVelocity() > 0.0f) {
     bool velocityIsNegative = (newVelocity < 0);
--- a/gfx/layers/client/ClientLayerManager.cpp
+++ b/gfx/layers/client/ClientLayerManager.cpp
@@ -2,19 +2,19 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ClientLayerManager.h"
 #include "GeckoProfiler.h"       // for AUTO_PROFILER_LABEL
 #include "gfxEnv.h"              // for gfxEnv
-#include "gfxPrefs.h"            // for gfxPrefs::LayersTile...
 #include "mozilla/Assertions.h"  // for MOZ_ASSERT, etc
 #include "mozilla/Hal.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/dom/BrowserChild.h"  // for BrowserChild
 #include "mozilla/dom/TabGroup.h"      // for TabGroup
 #include "mozilla/hal_sandbox/PHal.h"  // for ScreenConfiguration
 #include "mozilla/layers/CompositableClient.h"
 #include "mozilla/layers/CompositorBridgeChild.h"  // for CompositorBridgeChild
 #include "mozilla/layers/FrameUniformityData.h"
 #include "mozilla/layers/ISurfaceAllocator.h"
 #include "mozilla/layers/LayersMessages.h"  // for EditReply, etc
--- a/gfx/layers/client/ClientLayerManager.h
+++ b/gfx/layers/client/ClientLayerManager.h
@@ -5,19 +5,19 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef GFX_CLIENTLAYERMANAGER_H
 #define GFX_CLIENTLAYERMANAGER_H
 
 #include <stdint.h>  // for int32_t
 #include "Layers.h"
 #include "gfxContext.h"  // for gfxContext
-#include "gfxPrefs.h"
 #include "mozilla/Attributes.h"   // for override
-#include "mozilla/LinkedList.h"   // For LinkedList
+#include "mozilla/LinkedList.h"   // for LinkedList
+#include "mozilla/StaticPrefs.h"  // for StaticPrefs
 #include "mozilla/WidgetUtils.h"  // for ScreenRotation
 #include "mozilla/gfx/Rect.h"     // for Rect
 #include "mozilla/layers/CompositorTypes.h"
 #include "mozilla/layers/FocusTarget.h"   // for FocusTarget
 #include "mozilla/layers/LayersTypes.h"   // for BufferMode, LayersBackend, etc
 #include "mozilla/layers/PaintThread.h"   // For PaintThread
 #include "mozilla/layers/ShadowLayers.h"  // for ShadowLayerForwarder, etc
 #include "mozilla/layers/APZTestData.h"   // for APZTestData
@@ -210,17 +210,17 @@ class ClientLayerManager final : public 
   // Log APZ test data for a repaint request. The sequence number must be
   // passed in from outside, and APZTestData::StartNewRepaintRequest() needs
   // to be called from the outside as well when a new repaint request is
   // started.
   void StartNewRepaintRequest(SequenceNumber aSequenceNumber);
 
   // TODO(botond): When we start using this and write a wrapper similar to
   // nsLayoutUtils::LogTestDataForPaint(), make sure that wrapper checks
-  // gfxPrefs::APZTestLoggingEnabled().
+  // StaticPrefs::APZTestLoggingEnabled().
   void LogTestDataForRepaintRequest(SequenceNumber aSequenceNumber,
                                     ScrollableLayerGuid::ViewID aScrollId,
                                     const std::string& aKey,
                                     const std::string& aValue) {
     MOZ_ASSERT(StaticPrefs::APZTestLoggingEnabled(), "don't call me");
     mApzTestData.LogTestDataForRepaintRequest(aSequenceNumber, aScrollId, aKey,
                                               aValue);
   }
--- a/gfx/layers/client/ClientTiledPaintedLayer.cpp
+++ b/gfx/layers/client/ClientTiledPaintedLayer.cpp
@@ -5,19 +5,19 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ClientTiledPaintedLayer.h"
 #include "FrameMetrics.h"          // for FrameMetrics
 #include "Units.h"                 // for ScreenIntRect, CSSPoint, etc
 #include "UnitTransforms.h"        // for TransformTo
 #include "ClientLayerManager.h"    // for ClientLayerManager, etc
 #include "gfxPlatform.h"           // for gfxPlatform
-#include "gfxPrefs.h"              // for gfxPrefs
 #include "gfxRect.h"               // for gfxRect
 #include "mozilla/Assertions.h"    // for MOZ_ASSERT, etc
+#include "mozilla/StaticPrefs.h"   // for StaticPrefs
 #include "mozilla/gfx/BaseSize.h"  // for BaseSize
 #include "mozilla/gfx/gfxVars.h"
 #include "mozilla/gfx/Rect.h"  // for Rect, RectTyped
 #include "mozilla/layers/CompositorBridgeChild.h"
 #include "mozilla/layers/LayerMetricsWrapper.h"  // for LayerMetricsWrapper
 #include "mozilla/layers/LayersMessages.h"
 #include "mozilla/layers/PaintThread.h"
 #include "mozilla/mozalloc.h"  // for operator delete, etc
--- a/gfx/layers/client/MultiTiledContentClient.cpp
+++ b/gfx/layers/client/MultiTiledContentClient.cpp
@@ -2,16 +2,17 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/layers/MultiTiledContentClient.h"
 
 #include "ClientTiledPaintedLayer.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/layers/LayerMetricsWrapper.h"
 
 namespace mozilla {
 
 using namespace gfx;
 
 namespace layers {
 
@@ -259,17 +260,17 @@ void ClientMultiTiledLayerBuffer::Update
                          .PreScale(mResolution, mResolution)
                          .PreTranslate(-mTilingOrigin));
 
       mCallback(&mPaintedLayer, ctx, paintRegion, dirtyRegion,
                 DrawRegionClip::DRAW, nsIntRegion(), mCallbackData);
       ctx = nullptr;
 
       // Edge padding allows us to avoid resampling artifacts
-      if (gfxPrefs::TileEdgePaddingEnabled() && mResolution == 1) {
+      if (StaticPrefs::TileEdgePaddingEnabled() && mResolution == 1) {
         drawTarget->PadEdges(newValidRegion.MovedBy(-mTilingOrigin));
       }
 
       // Reset
       mPaintTiles.Clear();
       mTilingOrigin = IntPoint(std::numeric_limits<int32_t>::max(),
                                std::numeric_limits<int32_t>::max());
     }
--- a/gfx/layers/client/SingleTiledContentClient.h
+++ b/gfx/layers/client/SingleTiledContentClient.h
@@ -15,17 +15,17 @@ namespace layers {
 class ClientTiledPaintedLayer;
 class ClientLayerManager;
 
 /**
  * Provide an instance of TiledLayerBuffer backed by drawable TextureClients.
  * This buffer provides an implementation of ValidateTile using a
  * thebes callback and can support painting using a single paint buffer.
  * Whether a single paint buffer is used is controlled by
- * gfxPrefs::PerTileDrawing().
+ * StaticPrefs::PerTileDrawing().
  */
 class ClientSingleTiledLayerBuffer : public ClientTiledLayerBuffer,
                                      public TextureClientAllocator {
   virtual ~ClientSingleTiledLayerBuffer() = default;
 
  public:
   ClientSingleTiledLayerBuffer(ClientTiledPaintedLayer& aPaintedLayer,
                                CompositableClient& aCompositableClient,
--- a/gfx/layers/client/TextureClient.cpp
+++ b/gfx/layers/client/TextureClient.cpp
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/layers/TextureClient.h"
 #include <stdint.h>  // for uint8_t, uint32_t, etc
 #include "Layers.h"  // for Layer, etc
 #include "gfx2DGlue.h"
 #include "gfxPlatform.h"  // for gfxPlatform
 #include "mozilla/Atomics.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/SystemGroup.h"
 #include "mozilla/ipc/SharedMemory.h"  // for SharedMemory, etc
 #include "mozilla/layers/CompositableForwarder.h"
 #include "mozilla/layers/ISurfaceAllocator.h"
 #include "mozilla/layers/ImageBridgeChild.h"
 #include "mozilla/layers/ImageDataSerializer.h"
 #include "mozilla/layers/PaintThread.h"
 #include "mozilla/layers/TextureClientRecycleAllocator.h"
@@ -27,17 +28,16 @@
 #include "mozilla/layers/TextureClientOGL.h"
 #include "mozilla/layers/PTextureChild.h"
 #include "mozilla/gfx/DataSurfaceHelpers.h"  // for CreateDataSourceSurfaceByCloning
 #include "nsPrintfCString.h"                 // for nsPrintfCString
 #include "LayersLogging.h"                   // for AppendToString
 #include "gfxUtils.h"                        // for gfxUtils::GetAsLZ4Base64Str
 #include "IPDLActor.h"
 #include "BufferTexture.h"
-#include "gfxPrefs.h"
 #include "mozilla/layers/ShadowLayers.h"
 #include "mozilla/ipc/CrossProcessSemaphore.h"
 
 #ifdef XP_WIN
 #  include "mozilla/gfx/DeviceManagerDx.h"
 #  include "mozilla/layers/TextureD3D11.h"
 #  include "mozilla/layers/TextureDIB.h"
 #  include "gfxWindowsPlatform.h"
@@ -1075,23 +1075,23 @@ already_AddRefed<TextureClient> TextureC
   if (!data && aLayersBackend == LayersBackend::LAYERS_OPENGL &&
       type == gfxSurfaceType::Xlib && aFormat != SurfaceFormat::A8 &&
       gl::sGLXLibrary.UseTextureFromPixmap()) {
     data = X11TextureData::Create(aSize, aFormat, aTextureFlags, aAllocator);
   }
 #endif
 
 #ifdef XP_MACOSX
-  if (!data && gfxPrefs::UseIOSurfaceTextures()) {
+  if (!data && StaticPrefs::UseIOSurfaceTextures()) {
     data = MacIOSurfaceTextureData::Create(aSize, aFormat, moz2DBackend);
   }
 #endif
 
 #ifdef MOZ_WIDGET_ANDROID
-  if (!data && gfxPrefs::UseSurfaceTextureTextures()) {
+  if (!data && StaticPrefs::UseSurfaceTextureTextures()) {
     data = AndroidNativeWindowTextureData::Create(aSize, aFormat);
   }
 #endif
 
   if (data) {
     return MakeAndAddRef<TextureClient>(data, aTextureFlags, aAllocator);
   }
 
--- a/gfx/layers/client/TextureClientPool.cpp
+++ b/gfx/layers/client/TextureClientPool.cpp
@@ -4,18 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "TextureClientPool.h"
 #include "CompositableClient.h"
 #include "mozilla/layers/CompositableForwarder.h"
 #include "mozilla/layers/TextureForwarder.h"
 #include "mozilla/layers/TiledContentClient.h"
-
-#include "gfxPrefs.h"
+#include "mozilla/StaticPrefs.h"
 
 #include "nsComponentManagerUtils.h"
 
 #define TCP_LOG(...)
 //#define TCP_LOG(...) printf_stderr(__VA_ARGS__);
 
 namespace mozilla {
 namespace layers {
@@ -137,17 +136,17 @@ void TextureClientPool::AllocateTextureC
 
   if (mSupportsTextureDirectMapping &&
       std::max(mSize.width, mSize.height) <= mMaxTextureSize) {
     allocFlags =
         TextureAllocationFlags(allocFlags | ALLOC_ALLOW_DIRECT_MAPPING);
   }
 
   RefPtr<TextureClient> newClient;
-  if (gfxPrefs::ForceShmemTiles()) {
+  if (StaticPrefs::ForceShmemTiles()) {
     // gfx::BackendType::NONE means use the content backend
     newClient = TextureClient::CreateForRawBufferAccess(
         mSurfaceAllocator, mFormat, mSize, gfx::BackendType::NONE, mBackend,
         mFlags, allocFlags);
   } else {
     newClient = TextureClient::CreateForDrawing(
         mSurfaceAllocator, mFormat, mSize, mBackend, mMaxTextureSize,
         BackendSelector::Content, mFlags, allocFlags);
--- a/gfx/layers/client/TiledContentClient.cpp
+++ b/gfx/layers/client/TiledContentClient.cpp
@@ -7,33 +7,33 @@
 #include "mozilla/layers/TiledContentClient.h"
 #include <math.h>  // for ceil, ceilf, floor
 #include <algorithm>
 #include "ClientTiledPaintedLayer.h"  // for ClientTiledPaintedLayer
 #include "GeckoProfiler.h"            // for AUTO_PROFILER_LABEL
 #include "ClientLayerManager.h"       // for ClientLayerManager
 #include "gfxContext.h"               // for gfxContext, etc
 #include "gfxPlatform.h"              // for gfxPlatform
-#include "gfxPrefs.h"                 // for gfxPrefs
 #include "gfxRect.h"                  // for gfxRect
 #include "mozilla/MathAlgorithms.h"   // for Abs
 #include "mozilla/gfx/Point.h"        // for IntSize
 #include "mozilla/gfx/Rect.h"         // for Rect
 #include "mozilla/gfx/Tools.h"        // for BytesPerPixel
 #include "mozilla/layers/CompositableForwarder.h"
 #include "mozilla/layers/CompositorBridgeChild.h"  // for CompositorBridgeChild
 #include "mozilla/layers/LayerMetricsWrapper.h"
 #include "mozilla/layers/ShadowLayers.h"  // for ShadowLayerForwarder
 #include "mozilla/layers/PaintThread.h"   // for PaintThread
 #include "TextureClientPool.h"
 #include "nsISupportsImpl.h"      // for gfxContext::AddRef, etc
 #include "nsExpirationTracker.h"  // for nsExpirationTracker
 #include "nsMathUtils.h"          // for NS_lroundf
 #include "LayersLogging.h"
 #include "UnitTransforms.h"  // for TransformTo
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/UniquePtr.h"
 
 #ifdef GFX_TILEDLAYER_DEBUG_OVERLAY
 #  include "cairo.h"
 #  include <sstream>
 using mozilla::layers::Layer;
 static void DrawDebugOverlay(mozilla::gfx::DrawTarget* dt, int x, int y,
                              int width, int height) {
@@ -673,17 +673,17 @@ Maybe<AcquiredBackBuffer> TileClient::Ac
   } else {
     target = backBuffer;
   }
 
   // Construct a capture draw target if necessary
   RefPtr<DrawTargetCapture> capture;
   if (aFlags & TilePaintFlags::Async) {
     capture = Factory::CreateCaptureDrawTargetForTarget(
-        target, gfxPrefs::LayersOMTPCaptureLimit());
+        target, StaticPrefs::LayersOMTPCaptureLimit());
     target = capture;
   }
 
   // Gather texture clients
   AutoTArray<RefPtr<TextureClient>, 4> clients;
   clients.AppendElement(RefPtr<TextureClient>(mBackBuffer));
   if (mBackBufferOnWhite) {
     clients.AppendElement(mBackBufferOnWhite);
--- a/gfx/layers/client/TiledContentClient.h
+++ b/gfx/layers/client/TiledContentClient.h
@@ -310,17 +310,17 @@ class SharedFrameMetricsHelper {
   bool mProgressiveUpdateWasInDanger;
 };
 
 /**
  * Provide an instance of TiledLayerBuffer backed by drawable TextureClients.
  * This buffer provides an implementation of ValidateTile using a
  * thebes callback and can support painting using a single paint buffer.
  * Whether a single paint buffer is used is controlled by
- * gfxPrefs::PerTileDrawing().
+ * StaticPrefs::PerTileDrawing().
  */
 class ClientTiledLayerBuffer {
  public:
   ClientTiledLayerBuffer(ClientTiledPaintedLayer& aPaintedLayer,
                          CompositableClient& aCompositableClient)
       : mPaintedLayer(aPaintedLayer),
         mCompositableClient(aCompositableClient),
         mLastPaintContentType(gfxContentType::COLOR),
--- a/gfx/layers/composite/ContainerLayerComposite.cpp
+++ b/gfx/layers/composite/ContainerLayerComposite.cpp
@@ -5,19 +5,19 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ContainerLayerComposite.h"
 #include <algorithm>                         // for min
 #include "FrameMetrics.h"                    // for FrameMetrics
 #include "Units.h"                           // for LayerRect, LayerPixel, etc
 #include "CompositableHost.h"                // for CompositableHost
 #include "gfxEnv.h"                          // for gfxEnv
-#include "gfxPrefs.h"                        // for gfxPrefs
 #include "mozilla/Assertions.h"              // for MOZ_ASSERT, etc
 #include "mozilla/RefPtr.h"                  // for RefPtr
+#include "mozilla/StaticPrefs.h"             // for StaticPrefs
 #include "mozilla/UniquePtr.h"               // for UniquePtr
 #include "mozilla/gfx/BaseRect.h"            // for BaseRect
 #include "mozilla/gfx/Matrix.h"              // for Matrix4x4
 #include "mozilla/gfx/Point.h"               // for Point, IntPoint
 #include "mozilla/gfx/Rect.h"                // for IntRect, Rect
 #include "mozilla/layers/APZSampler.h"       // for APZSampler
 #include "mozilla/layers/Compositor.h"       // for Compositor, etc
 #include "mozilla/layers/CompositorTypes.h"  // for DiagnosticFlags::CONTAINER
@@ -468,17 +468,17 @@ void RenderLayers(ContainerT* aContainer
 
       if (geometry && isLeafLayer) {
         TransformLayerGeometry(layer, geometry);
       }
 
       layerToRender->RenderLayer(clipRect, geometry);
     }
 
-    if (gfxPrefs::UniformityInfo()) {
+    if (StaticPrefs::UniformityInfo()) {
       PrintUniformityInfo(layer);
     }
 
     if (StaticPrefs::DrawLayerInfo()) {
       DrawLayerInfo(preparedData.mClipRect, aManager, layer);
     }
 
     // Draw a border around scrollable layers.
--- a/gfx/layers/d3d11/CompositorD3D11.cpp
+++ b/gfx/layers/d3d11/CompositorD3D11.cpp
@@ -16,24 +16,24 @@
 #include "mozilla/gfx/Swizzle.h"
 #include "mozilla/layers/ImageHost.h"
 #include "mozilla/layers/ContentHost.h"
 #include "mozilla/layers/Diagnostics.h"
 #include "mozilla/layers/DiagnosticsD3D11.h"
 #include "mozilla/layers/Effects.h"
 #include "mozilla/layers/HelpersD3D11.h"
 #include "nsWindowsHelpers.h"
-#include "gfxPrefs.h"
 #include "gfxConfig.h"
 #include "gfxCrashReporterUtils.h"
 #include "gfxUtils.h"
 #include "mozilla/gfx/StackArray.h"
 #include "mozilla/widget/WinCompositorWidget.h"
 
 #include "mozilla/EnumeratedArray.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/Telemetry.h"
 #include "BlendShaderConstants.h"
 
 #include "D3D11ShareHandleImage.h"
 #include "DeviceAttachmentsD3D11.h"
 
 #include <versionhelpers.h>  // For IsWindows8OrGreater
 #include <winsdkver.h>
@@ -104,17 +104,17 @@ CompositorD3D11::CompositorD3D11(Composi
       mWindowRTCopy(nullptr),
       mAttachments(nullptr),
       mHwnd(nullptr),
       mDisableSequenceForNextFrame(false),
       mAllowPartialPresents(false),
       mIsDoubleBuffered(false),
       mVerifyBuffersFailed(false),
       mUseMutexOnPresent(false) {
-  mUseMutexOnPresent = gfxPrefs::UseMutexOnPresent();
+  mUseMutexOnPresent = StaticPrefs::UseMutexOnPresent();
 }
 
 CompositorD3D11::~CompositorD3D11() {}
 
 template <typename VertexType>
 void CompositorD3D11::SetVertexBuffer(ID3D11Buffer* aBuffer) {
   UINT size = sizeof(VertexType);
   UINT offset = 0;
@@ -1043,17 +1043,17 @@ void CompositorD3D11::DrawGeometry(const
       TextureSourceD3D11* sourceCr = source->GetSubSource(Cr)->AsSourceD3D11();
 
       ID3D11ShaderResourceView* srViews[3] = {
           sourceY->GetShaderResourceView(), sourceCb->GetShaderResourceView(),
           sourceCr->GetShaderResourceView()};
       mContext->PSSetShaderResources(TexSlot::Y, 3, srViews);
     } break;
     case EffectTypes::COMPONENT_ALPHA: {
-      MOZ_ASSERT(gfxPrefs::ComponentAlphaEnabled());
+      MOZ_ASSERT(StaticPrefs::ComponentAlphaEnabled());
       MOZ_ASSERT(mAttachments->mComponentBlendState);
       EffectComponentAlpha* effectComponentAlpha =
           static_cast<EffectComponentAlpha*>(aEffectChain.mPrimaryEffect.get());
 
       TextureSourceD3D11* sourceOnWhite =
           effectComponentAlpha->mOnWhite->AsSourceD3D11();
       TextureSourceD3D11* sourceOnBlack =
           effectComponentAlpha->mOnBlack->AsSourceD3D11();
--- a/gfx/layers/d3d11/DeviceAttachmentsD3D11.cpp
+++ b/gfx/layers/d3d11/DeviceAttachmentsD3D11.cpp
@@ -1,19 +1,19 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DeviceAttachmentsD3D11.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/layers/Compositor.h"
 #include "CompositorD3D11Shaders.h"
-#include "gfxPrefs.h"
 #include "ShaderDefinitionsD3D11.h"
 
 namespace mozilla {
 namespace layers {
 
 using namespace gfx;
 
 static const size_t kInitialMaximumTriangles = 64;
@@ -174,17 +174,17 @@ bool DeviceAttachmentsD3D11::Initialize(
   blendDesc.RenderTarget[0] = rtBlendNonPremul;
   hr = mDevice->CreateBlendState(&blendDesc,
                                  getter_AddRefs(mNonPremulBlendState));
   if (Failed(hr, "create npm blender")) {
     mInitFailureId = "FEATURE_FAILURE_D3D11_NPM_BLENDER";
     return false;
   }
 
-  if (gfxPrefs::ComponentAlphaEnabled()) {
+  if (StaticPrefs::ComponentAlphaEnabled()) {
     D3D11_RENDER_TARGET_BLEND_DESC rtBlendComponent = {
         TRUE,
         D3D11_BLEND_ONE,
         D3D11_BLEND_INV_SRC1_COLOR,
         D3D11_BLEND_OP_ADD,
         D3D11_BLEND_ONE,
         D3D11_BLEND_INV_SRC_ALPHA,
         D3D11_BLEND_OP_ADD,
@@ -270,17 +270,17 @@ bool DeviceAttachmentsD3D11::CreateShade
   InitPixelShader(sRGBShader, mRGBShader, MaskType::MaskNone);
   InitPixelShader(sRGBShaderMask, mRGBShader, MaskType::Mask);
   InitPixelShader(sRGBAShader, mRGBAShader, MaskType::MaskNone);
   InitPixelShader(sRGBAShaderMask, mRGBAShader, MaskType::Mask);
   InitPixelShader(sYCbCrShader, mYCbCrShader, MaskType::MaskNone);
   InitPixelShader(sYCbCrShaderMask, mYCbCrShader, MaskType::Mask);
   InitPixelShader(sNV12Shader, mNV12Shader, MaskType::MaskNone);
   InitPixelShader(sNV12ShaderMask, mNV12Shader, MaskType::Mask);
-  if (gfxPrefs::ComponentAlphaEnabled()) {
+  if (StaticPrefs::ComponentAlphaEnabled()) {
     InitPixelShader(sComponentAlphaShader, mComponentAlphaShader,
                     MaskType::MaskNone);
     InitPixelShader(sComponentAlphaShaderMask, mComponentAlphaShader,
                     MaskType::Mask);
   }
 
   return mContinueInit;
 }
--- a/gfx/layers/d3d11/MLGDeviceD3D11.cpp
+++ b/gfx/layers/d3d11/MLGDeviceD3D11.cpp
@@ -316,17 +316,17 @@ RefPtr<MLGRenderTarget> MLGSwapChainD3D1
   if (FAILED(hr)) {
     gfxCriticalNote << "Failed to acquire swap chain's backbuffer: "
                     << hexa(hr);
     return nullptr;
   }
 
   if (!mRT) {
     MLGRenderTargetFlags flags = MLGRenderTargetFlags::Default;
-    if (gfxPrefs::AdvancedLayersEnableDepthBuffer()) {
+    if (StaticPrefs::AdvancedLayersEnableDepthBuffer()) {
       flags |= MLGRenderTargetFlags::ZBuffer;
     }
 
     mRT = new MLGRenderTargetD3D11(mSize, flags);
     if (!mRT->Initialize(mDevice, nullptr)) {
       return nullptr;
     }
   }
--- a/gfx/layers/ipc/CompositorBench.cpp
+++ b/gfx/layers/ipc/CompositorBench.cpp
@@ -5,18 +5,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "CompositorBench.h"
 
 #ifdef MOZ_COMPOSITOR_BENCH
 #  include "mozilla/gfx/2D.h"
 #  include "mozilla/layers/Compositor.h"
 #  include "mozilla/layers/Effects.h"
+#  include "mozilla/StaticPrefs.h"
 #  include "mozilla/TimeStamp.h"
-#  include "gfxPrefs.h"
 #  include <math.h>
 #  include "GeckoProfiler.h"
 
 #  define TEST_STEPS 1000
 #  define DURATION_THRESHOLD 30
 #  define THRESHOLD_ABORT_COUNT 5
 
 namespace mozilla {
@@ -330,17 +330,17 @@ static void RunCompositorBench(Composito
 
   for (size_t i = 0; i < tests.size(); i++) {
     delete tests[i];
   }
 }
 
 void CompositorBench(Compositor* aCompositor, const gfx::IntRect& aScreenRect) {
   static bool sRanBenchmark = false;
-  bool wantBenchmark = gfxPrefs::LayersBenchEnabled();
+  bool wantBenchmark = StaticPrefs::LayersBenchEnabled();
   if (wantBenchmark && !sRanBenchmark) {
     RunCompositorBench(aCompositor, aScreenRect);
   }
   sRanBenchmark = wantBenchmark;
 }
 
 }  // namespace layers
 }  // namespace mozilla
--- a/gfx/layers/ipc/CompositorBridgeChild.cpp
+++ b/gfx/layers/ipc/CompositorBridgeChild.cpp
@@ -6,17 +6,17 @@
 
 #include "mozilla/layers/CompositorBridgeChild.h"
 #include "mozilla/layers/CompositorBridgeParent.h"
 #include "mozilla/layers/CompositorThread.h"
 #include <stddef.h>              // for size_t
 #include "ClientLayerManager.h"  // for ClientLayerManager
 #include "base/message_loop.h"   // for MessageLoop
 #include "base/task.h"           // for NewRunnableMethod, etc
-#include "gfxPrefs.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/dom/TabGroup.h"
 #include "mozilla/layers/CompositorManagerChild.h"
 #include "mozilla/layers/ImageBridgeChild.h"
 #include "mozilla/layers/APZChild.h"
 #include "mozilla/layers/IAPZCTreeManager.h"
 #include "mozilla/layers/APZCTreeManagerChild.h"
 #include "mozilla/layers/LayerTransactionChild.h"
 #include "mozilla/layers/PaintThread.h"
@@ -865,20 +865,20 @@ TextureClientPool* CompositorBridgeChild
       return mTexturePools[i];
     }
   }
 
   mTexturePools.AppendElement(new TextureClientPool(
       aAllocator->GetCompositorBackendType(),
       aAllocator->SupportsTextureDirectMapping(),
       aAllocator->GetMaxTextureSize(), aFormat, gfx::gfxVars::TileSize(),
-      aFlags, gfxPrefs::LayersTilePoolShrinkTimeout(),
-      gfxPrefs::LayersTilePoolClearTimeout(),
-      gfxPrefs::LayersTileInitialPoolSize(),
-      gfxPrefs::LayersTilePoolUnusedSize(), this));
+      aFlags, StaticPrefs::LayersTilePoolShrinkTimeout(),
+      StaticPrefs::LayersTilePoolClearTimeout(),
+      StaticPrefs::LayersTileInitialPoolSize(),
+      StaticPrefs::LayersTilePoolUnusedSize(), this));
 
   return mTexturePools.LastElement();
 }
 
 void CompositorBridgeChild::HandleMemoryPressure() {
   for (size_t i = 0; i < mTexturePools.Length(); i++) {
     mTexturePools[i]->Clear();
   }
--- a/gfx/layers/ipc/CompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/CompositorBridgeParent.cpp
@@ -23,16 +23,17 @@
 #include "TreeTraversal.h"            // for ForEachNode
 #ifdef MOZ_WIDGET_GTK
 #  include "gfxPlatformGtk.h"  // for gfxPlatform
 #endif
 #include "gfxPrefs.h"                 // for gfxPrefs
 #include "mozilla/AutoRestore.h"      // for AutoRestore
 #include "mozilla/ClearOnShutdown.h"  // for ClearOnShutdown
 #include "mozilla/DebugOnly.h"        // for DebugOnly
+#include "mozilla/StaticPrefs.h"      // for StaticPrefs
 #include "mozilla/dom/BrowserParent.h"
 #include "mozilla/gfx/2D.h"         // for DrawTarget
 #include "mozilla/gfx/GPUChild.h"   // for GfxPrefValue
 #include "mozilla/gfx/Point.h"      // for IntSize
 #include "mozilla/gfx/Rect.h"       // for IntSize
 #include "mozilla/gfx/gfxVars.h"    // for gfxVars
 #include "VRManager.h"              // for VRManager
 #include "mozilla/ipc/Transport.h"  // for Transport
@@ -289,17 +290,17 @@ void CompositorBridgeParent::FinishShutd
 }
 
 #ifdef COMPOSITOR_PERFORMANCE_WARNING
 static int32_t CalculateCompositionFrameRate() {
   // Used when layout.frame_rate is -1. Needs to be kept in sync with
   // DEFAULT_FRAME_RATE in nsRefreshDriver.cpp.
   // TODO: This should actually return the vsync rate.
   const int32_t defaultFrameRate = 60;
-  int32_t compositionFrameRatePref = gfxPrefs::LayersCompositionFrameRate();
+  int32_t compositionFrameRatePref = StaticPrefs::LayersCompositionFrameRate();
   if (compositionFrameRatePref < 0) {
     // Use the same frame rate for composition as for layout.
     int32_t layoutFrameRatePref = gfxPrefs::LayoutFrameRate();
     if (layoutFrameRatePref < 0) {
       // TODO: The main thread frame scheduling code consults the actual
       // monitor refresh rate in this case. We should do the same.
       return defaultFrameRate;
     }
@@ -1788,17 +1789,17 @@ PWebRenderBridgeParent* CompositorBridge
   apis.AppendElement(
       wr::WebRenderAPI::Create(this, std::move(widget), windowId, aSize));
   if (!apis[0]) {
     mWrBridge = WebRenderBridgeParent::CreateDestroyed(aPipelineId);
     mWrBridge.get()->AddRef();  // IPDL reference
     return mWrBridge;
   }
 
-  if (gfxPrefs::WebRenderSplitRenderRoots()) {
+  if (StaticPrefs::WebRenderSplitRenderRoots()) {
     apis.AppendElement(
         apis[0]->CreateDocument(aSize, 1, wr::RenderRoot::Content));
   }
 
   InfallibleTArray<RefPtr<wr::WebRenderAPI>> clonedApis;
   for (auto& api : apis) {
     wr::TransactionBuilder txn;
     txn.SetRootPipeline(aPipelineId);
--- a/gfx/layers/ipc/CompositorManagerChild.cpp
+++ b/gfx/layers/ipc/CompositorManagerChild.cpp
@@ -1,17 +1,17 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/layers/CompositorManagerChild.h"
 
-#include "gfxPrefs.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/layers/CompositorBridgeChild.h"
 #include "mozilla/layers/CompositorManagerParent.h"
 #include "mozilla/layers/CompositorThread.h"
 #include "mozilla/gfx/gfxVars.h"
 #include "mozilla/gfx/GPUProcessManager.h"
 #include "mozilla/dom/ContentChild.h"  // for ContentChild
 #include "mozilla/dom/BrowserChild.h"  // for BrowserChild
 #include "mozilla/dom/TabGroup.h"      // for TabGroup
@@ -264,17 +264,17 @@ CompositorManagerChild::GetSpecificMessa
 
   return nullptr;
 }
 
 void CompositorManagerChild::SetReplyTimeout() {
 #ifndef DEBUG
   // Add a timeout for release builds to kill GPU process when it hangs.
   if (XRE_IsParentProcess() && GPUProcessManager::Get()->GetGPUChild()) {
-    int32_t timeout = gfxPrefs::GPUProcessIPCReplyTimeoutMs();
+    int32_t timeout = StaticPrefs::GPUProcessIPCReplyTimeoutMs();
     SetReplyTimeoutMs(timeout);
   }
 #endif
 }
 
 bool CompositorManagerChild::ShouldContinueFromReplyTimeout() {
   if (XRE_IsParentProcess()) {
     gfxCriticalNote << "Killing GPU process due to IPC reply timeout";
--- a/gfx/layers/ipc/CompositorVsyncScheduler.cpp
+++ b/gfx/layers/ipc/CompositorVsyncScheduler.cpp
@@ -9,19 +9,19 @@
 #include <stdio.h>        // for fprintf, stdout
 #include <stdint.h>       // for uint64_t
 #include "base/task.h"    // for CancelableTask, etc
 #include "base/thread.h"  // for Thread
 #include "gfxPlatform.h"  // for gfxPlatform
 #ifdef MOZ_WIDGET_GTK
 #  include "gfxPlatformGtk.h"  // for gfxPlatform
 #endif
-#include "gfxPrefs.h"             // for gfxPrefs
 #include "mozilla/AutoRestore.h"  // for AutoRestore
 #include "mozilla/DebugOnly.h"    // for DebugOnly
+#include "mozilla/StaticPrefs.h"  // for StaticPrefs
 #include "mozilla/gfx/2D.h"       // for DrawTarget
 #include "mozilla/gfx/Point.h"    // for IntSize
 #include "mozilla/gfx/Rect.h"     // for IntSize
 #include "mozilla/layers/CompositorThread.h"
 #include "mozilla/layers/CompositorVsyncSchedulerOwner.h"
 #include "mozilla/mozalloc.h"  // for operator new, etc
 #include "nsCOMPtr.h"          // for already_AddRefed
 #include "nsDebug.h"           // for NS_ASSERTION, etc
@@ -250,17 +250,17 @@ void CompositorVsyncScheduler::Composite
 
     mVsyncNotificationsSkipped = 0;
 
     TimeDuration compositeFrameTotal = TimeStamp::Now() - aVsyncTimestamp;
     mozilla::Telemetry::Accumulate(
         mozilla::Telemetry::COMPOSITE_FRAME_ROUNDTRIP_TIME,
         compositeFrameTotal.ToMilliseconds());
   } else if (mVsyncNotificationsSkipped++ >
-             gfxPrefs::CompositorUnobserveCount()) {
+             StaticPrefs::CompositorUnobserveCount()) {
     UnobserveVsync();
   }
 }
 
 void CompositorVsyncScheduler::ForceComposeToTarget(gfx::DrawTarget* aTarget,
                                                     const IntRect* aRect) {
   MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
 
--- a/gfx/layers/ipc/LayerTransactionParent.cpp
+++ b/gfx/layers/ipc/LayerTransactionParent.cpp
@@ -20,16 +20,17 @@
 #include "mozilla/layers/ImageBridgeParent.h"  // for ImageBridgeParent
 #include "mozilla/layers/ImageLayerComposite.h"
 #include "mozilla/layers/LayerManagerComposite.h"
 #include "mozilla/layers/LayersMessages.h"  // for EditReply, etc
 #include "mozilla/layers/LayersTypes.h"     // for MOZ_LAYERS_LOG
 #include "mozilla/layers/TextureHostOGL.h"  // for TextureHostOGL
 #include "mozilla/layers/PaintedLayerComposite.h"
 #include "mozilla/mozalloc.h"  // for operator delete, etc
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/Unused.h"
 #include "nsCoord.h"          // for NSAppUnitsToFloatPixels
 #include "nsISupportsImpl.h"  // for Layer::Release, etc
 #include "nsLayoutUtils.h"    // for nsLayoutUtils
 #include "nsMathUtils.h"      // for NS_round
 #include "nsPoint.h"          // for nsPoint
 #include "nsTArray.h"         // for nsTArray, nsTArray_Impl, etc
--- a/gfx/layers/mlgpu/MLGDevice.cpp
+++ b/gfx/layers/mlgpu/MLGDevice.cpp
@@ -4,17 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "MLGDevice.h"
 #include "mozilla/layers/TextureHost.h"
 #include "BufferCache.h"
 #include "ClearRegionHelper.h"
 #include "gfxConfig.h"
-#include "gfxPrefs.h"
+#include "mozilla/StaticPrefs.h"
 #include "gfxUtils.h"
 #include "LayersLogging.h"
 #include "ShaderDefinitionsMLGPU.h"
 #include "SharedBufferMLGPU.h"
 #include "UtilityMLGPU.h"
 
 namespace mozilla {
 namespace layers {
@@ -80,31 +80,31 @@ bool MLGDevice::Initialize() {
     // StagingBuffer depends on this value being accurate, so for now we just
     // double-check it here.
     return Fail("FEATURE_FAILURE_MIN_MAX_CB_BIND_SIZE",
                 "Minimum constant buffer bind size not met");
   }
 
   // We allow this to be pref'd off for testing. Switching it off enables
   // Direct3D 11.0/Windows 7/OpenGL-style buffer code paths.
-  if (!gfxPrefs::AdvancedLayersEnableBufferSharing()) {
+  if (!StaticPrefs::AdvancedLayersEnableBufferSharing()) {
     gfxConfig::EnableFallback(Fallback::NO_CONSTANT_BUFFER_OFFSETTING,
                               "Disabled by pref");
     mCanUseConstantBufferOffsetBinding = false;
   }
   if (mCanUseConstantBufferOffsetBinding && !VerifyConstantBufferOffsetting()) {
     gfxConfig::EnableFallback(Fallback::NO_CONSTANT_BUFFER_OFFSETTING,
                               "Constant buffer offset binding does not work");
     mCanUseConstantBufferOffsetBinding = false;
   }
 
   // We allow this to be pref'd off for testing. Disabling it turns on
   // ID3D11DeviceContext1::ClearView support, which is present on
   // newer Windows 8+ drivers.
-  if (!gfxPrefs::AdvancedLayersEnableClearView()) {
+  if (!StaticPrefs::AdvancedLayersEnableClearView()) {
     mCanUseClearView = false;
   }
 
   // When compositing normal sized layer trees, we typically have small vertex
   // buffers. Empirically the vertex and pixel constant buffer sizes are
   // generally under 1KB and the vertex constant buffer size is under 8KB.
   static const size_t kDefaultVertexBufferSize = 4096;
   static const size_t kDefaultVSConstantBufferSize =
@@ -122,17 +122,17 @@ bool MLGDevice::Initialize() {
       MakeUnique<SharedConstantBuffer>(this, kDefaultPSConstantBufferSize);
 
   if (!mSharedVertexBuffer->Init() || !mSharedVSBuffer->Init() ||
       !mSharedPSBuffer->Init()) {
     return Fail("FEATURE_FAILURE_ALLOC_SHARED_BUFFER",
                 "Failed to allocate a shared shader buffer");
   }
 
-  if (gfxPrefs::AdvancedLayersEnableBufferCache()) {
+  if (StaticPrefs::AdvancedLayersEnableBufferCache()) {
     mConstantBufferCache = MakeUnique<BufferCache>(this);
   }
 
   mInitialized = true;
   mIsValid = true;
   return true;
 }
 
--- a/gfx/layers/mlgpu/RenderViewMLGPU.cpp
+++ b/gfx/layers/mlgpu/RenderViewMLGPU.cpp
@@ -2,17 +2,17 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "RenderViewMLGPU.h"
 #include "ContainerLayerMLGPU.h"
 #include "FrameBuilder.h"
-#include "gfxPrefs.h"
+#include "mozilla/StaticPrefs.h"
 #include "LayersHelpers.h"
 #include "LayersLogging.h"
 #include "MLGDevice.h"
 #include "RenderPassMLGPU.h"
 #include "ShaderDefinitionsMLGPU.h"
 #include "Units.h"
 #include "UnitTransforms.h"
 #include "UtilityMLGPU.h"
@@ -69,17 +69,17 @@ RenderViewMLGPU::RenderViewMLGPU(FrameBu
       mDevice(aBuilder->GetDevice()),
       mParent(aParent),
       mContainer(nullptr),
       mFinishedBuilding(false),
       mCurrentLayerBufferIndex(kInvalidResourceIndex),
       mCurrentMaskRectBufferIndex(kInvalidResourceIndex),
       mCurrentDepthMode(MLGDepthTestMode::Disabled),
       mNextSortIndex(1),
-      mUseDepthBuffer(gfxPrefs::AdvancedLayersEnableDepthBuffer()),
+      mUseDepthBuffer(StaticPrefs::AdvancedLayersEnableDepthBuffer()),
       mDepthBufferNeedsClear(false) {
   if (aParent) {
     aParent->AddChild(this);
   }
 }
 
 RenderViewMLGPU::~RenderViewMLGPU() {
   for (const auto& child : mChildren) {
@@ -183,17 +183,17 @@ void RenderViewMLGPU::AddItem(LayerMLGPU
 }
 
 bool RenderViewMLGPU::UpdateVisibleRegion(ItemInfo& aItem) {
   // If the item has some kind of complex transform, we perform a very
   // simple occlusion test and move on. We using a depth buffer we skip
   // CPU-based occlusion culling as well, since the GPU will do most of our
   // culling work for us.
   if (mUseDepthBuffer || !aItem.translation ||
-      !gfxPrefs::AdvancedLayersEnableCPUOcclusion()) {
+      !StaticPrefs::AdvancedLayersEnableCPUOcclusion()) {
     // Update the render region even if we won't compute visibility, since some
     // layer types (like Canvas and Image) need to have the visible region
     // clamped.
     LayerIntRegion region = aItem.layer->GetShadowVisibleRegion();
     aItem.layer->SetRenderRegion(std::move(region));
 
     AL_LOG("RenderView %p simple occlusion test, bounds=%s, translation?=%d\n",
            this, Stringify(aItem.bounds).c_str(), aItem.translation ? 1 : 0);
--- a/gfx/layers/opengl/CompositorOGL.cpp
+++ b/gfx/layers/opengl/CompositorOGL.cpp
@@ -11,22 +11,21 @@
 #include "GLContextProvider.h"  // for GLContextProvider
 #include "GLContext.h"          // for GLContext
 #include "GLUploadHelpers.h"
 #include "Layers.h"                 // for WriteSnapshotToDumpFile
 #include "LayerScope.h"             // for LayerScope
 #include "gfxCrashReporterUtils.h"  // for ScopedGfxFeatureReporter
 #include "gfxEnv.h"                 // for gfxEnv
 #include "gfxPlatform.h"            // for gfxPlatform
-#include "gfxPrefs.h"               // for gfxPrefs
 #include "gfxRect.h"                // for gfxRect
 #include "gfxUtils.h"               // for gfxUtils, etc
 #include "mozilla/ArrayUtils.h"     // for ArrayLength
 #include "mozilla/Preferences.h"    // for Preferences
-#include "mozilla/StaticPrefs.h"
+#include "mozilla/StaticPrefs.h"    // for StaticPrefs
 #include "mozilla/gfx/BasePoint.h"  // for BasePoint
 #include "mozilla/gfx/Matrix.h"     // for Matrix4x4, Matrix
 #include "mozilla/gfx/Triangle.h"   // for Triangle
 #include "mozilla/gfx/gfxVars.h"    // for gfxVars
 #include "mozilla/layers/ImageDataSerializer.h"
 #include "mozilla/layers/LayerManagerComposite.h"  // for LayerComposite, etc
 #include "mozilla/layers/CompositingRenderTargetOGL.h"
 #include "mozilla/layers/Effects.h"      // for EffectChain, TexturedEffect, etc
@@ -1544,17 +1543,17 @@ void CompositorOGL::DrawGeometry(const G
 
       // Drawing is always flipped, but when copying between surfaces we want to
       // avoid this. Pass true for the flip parameter to introduce a second flip
       // that cancels the other one out.
       didSetBlendMode = SetBlendMode(gl(), blendMode);
       BindAndDrawGeometry(program, aGeometry);
     } break;
     case EffectTypes::COMPONENT_ALPHA: {
-      MOZ_ASSERT(gfxPrefs::ComponentAlphaEnabled());
+      MOZ_ASSERT(StaticPrefs::ComponentAlphaEnabled());
       MOZ_ASSERT(blendMode == gfx::CompositionOp::OP_OVER,
                  "Can't support blend modes with component alpha!");
       EffectComponentAlpha* effectComponentAlpha =
           static_cast<EffectComponentAlpha*>(aEffectChain.mPrimaryEffect.get());
       TextureSourceOGL* sourceOnWhite =
           effectComponentAlpha->mOnWhite->AsSourceOGL();
       TextureSourceOGL* sourceOnBlack =
           effectComponentAlpha->mOnBlack->AsSourceOGL();
@@ -1968,17 +1967,17 @@ GLBlitTextureImageHelper* CompositorOGL:
 GLuint CompositorOGL::GetTemporaryTexture(GLenum aTarget, GLenum aUnit) {
   if (!mTexturePool) {
     mTexturePool = new PerUnitTexturePoolOGL(gl());
   }
   return mTexturePool->GetTexture(aTarget, aUnit);
 }
 
 bool CompositorOGL::SupportsTextureDirectMapping() {
-  if (!gfxPrefs::AllowTextureDirectMapping()) {
+  if (!StaticPrefs::AllowTextureDirectMapping()) {
     return false;
   }
 
   if (mGLContext) {
     mGLContext->MakeCurrent();
     return mGLContext->IsExtensionSupported(
                gl::GLContext::APPLE_client_storage) &&
            mGLContext->IsExtensionSupported(gl::GLContext::APPLE_texture_range);
--- a/gfx/layers/wr/WebRenderBridgeChild.cpp
+++ b/gfx/layers/wr/WebRenderBridgeChild.cpp
@@ -2,17 +2,17 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/layers/WebRenderBridgeChild.h"
 
 #include "gfxPlatform.h"
-#include "gfxPrefs.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/dom/TabGroup.h"
 #include "mozilla/layers/CompositableClient.h"
 #include "mozilla/layers/CompositorBridgeChild.h"
 #include "mozilla/layers/ImageDataSerializer.h"
 #include "mozilla/layers/IpcResourceUpdateQueue.h"
 #include "mozilla/layers/StackingContextHelper.h"
 #include "mozilla/layers/PTextureChild.h"
 #include "mozilla/layers/WebRenderLayerManager.h"
@@ -68,18 +68,19 @@ void WebRenderBridgeChild::DoDestroy() {
   // mActiveResourceTracker is not cleared here, since it is
   // used by PersistentBufferProviderShared.
   mDestroyed = true;
   mManager = nullptr;
 }
 
 void WebRenderBridgeChild::AddWebRenderParentCommand(
     const WebRenderParentCommand& aCmd, wr::RenderRoot aRenderRoot) {
-  MOZ_ASSERT(aRenderRoot == wr::RenderRoot::Default ||
-             (XRE_IsParentProcess() && gfxPrefs::WebRenderSplitRenderRoots()));
+  MOZ_ASSERT(
+      aRenderRoot == wr::RenderRoot::Default ||
+      (XRE_IsParentProcess() && StaticPrefs::WebRenderSplitRenderRoots()));
   mParentCommands[aRenderRoot].AppendElement(aCmd);
 }
 
 void WebRenderBridgeChild::BeginTransaction() {
   MOZ_ASSERT(!mDestroyed);
 
   UpdateFwdTransactionId();
   mIsInTransaction = true;
@@ -114,17 +115,17 @@ void WebRenderBridgeChild::EndTransactio
   MOZ_ASSERT(!mDestroyed);
   MOZ_ASSERT(mIsInTransaction);
 
   TimeStamp fwdTime = TimeStamp::Now();
 
   for (auto& renderRoot : aRenderRoots) {
     MOZ_ASSERT(
         renderRoot.mRenderRoot == wr::RenderRoot::Default ||
-        (XRE_IsParentProcess() && gfxPrefs::WebRenderSplitRenderRoots()));
+        (XRE_IsParentProcess() && StaticPrefs::WebRenderSplitRenderRoots()));
     renderRoot.mCommands = std::move(mParentCommands[renderRoot.mRenderRoot]);
   }
 
   this->SendSetDisplayList(std::move(aRenderRoots), mDestroyedActors,
                            GetFwdTransactionId(), aTransactionId, mIdNamespace,
                            aContainsSVGGroup, aVsyncId, aVsyncStartTime,
                            aRefreshStartTime, aTxnStartTime, aTxnURL, fwdTime);
 
@@ -146,17 +147,17 @@ void WebRenderBridgeChild::EndEmptyTrans
   MOZ_ASSERT(!mDestroyed);
   MOZ_ASSERT(mIsInTransaction);
 
   TimeStamp fwdTime = TimeStamp::Now();
 
   for (auto& update : aRenderRootUpdates) {
     MOZ_ASSERT(
         update.mRenderRoot == wr::RenderRoot::Default ||
-        (XRE_IsParentProcess() && gfxPrefs::WebRenderSplitRenderRoots()));
+        (XRE_IsParentProcess() && StaticPrefs::WebRenderSplitRenderRoots()));
     update.mCommands = std::move(mParentCommands[update.mRenderRoot]);
   }
 
   this->SendEmptyTransaction(
       aFocusTarget, aPaintSequenceNumber, std::move(aRenderRootUpdates),
       mDestroyedActors, GetFwdTransactionId(), aTransactionId, mIdNamespace,
       aVsyncId, aVsyncStartTime, aRefreshStartTime, aTxnStartTime, aTxnURL,
       fwdTime);
@@ -170,17 +171,17 @@ void WebRenderBridgeChild::EndEmptyTrans
 }
 
 void WebRenderBridgeChild::ProcessWebRenderParentCommands() {
   MOZ_ASSERT(!mDestroyed);
 
   for (auto renderRoot : wr::kRenderRoots) {
     if (!mParentCommands[renderRoot].IsEmpty()) {
       MOZ_ASSERT(renderRoot == wr::RenderRoot::Default ||
-                 gfxPrefs::WebRenderSplitRenderRoots());
+                 StaticPrefs::WebRenderSplitRenderRoots());
       this->SendParentCommands(mParentCommands[renderRoot], renderRoot);
       mParentCommands[renderRoot].Clear();
     }
   }
 }
 
 void WebRenderBridgeChild::AddPipelineIdForAsyncCompositable(
     const wr::PipelineId& aPipelineId, const CompositableHandle& aHandle,
--- a/gfx/layers/wr/WebRenderBridgeParent.cpp
+++ b/gfx/layers/wr/WebRenderBridgeParent.cpp
@@ -3,23 +3,23 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/layers/WebRenderBridgeParent.h"
 
 #include "CompositableHost.h"
 #include "gfxEnv.h"
-#include "gfxPrefs.h"
 #include "gfxEnv.h"
 #include "GeckoProfiler.h"
 #include "GLContext.h"
 #include "GLContextProvider.h"
 #include "nsExceptionHandler.h"
 #include "mozilla/Range.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/layers/AnimationHelper.h"
 #include "mozilla/layers/APZSampler.h"
 #include "mozilla/layers/APZUpdater.h"
 #include "mozilla/layers/Compositor.h"
 #include "mozilla/layers/CompositorBridgeParent.h"
 #include "mozilla/layers/CompositorThread.h"
 #include "mozilla/layers/CompositorVsyncScheduler.h"
@@ -321,17 +321,18 @@ WebRenderBridgeParent::WebRenderBridgePa
   MOZ_ASSERT(mAsyncImageManager);
   MOZ_ASSERT(mAnimStorage);
   mAsyncImageManager->AddPipeline(mPipelineId, this);
   if (IsRootWebRenderBridgeParent()) {
     MOZ_ASSERT(!mCompositorScheduler);
     mCompositorScheduler = new CompositorVsyncScheduler(this, mWidget);
   }
 
-  if (!IsRootWebRenderBridgeParent() && gfxPrefs::WebRenderSplitRenderRoots()) {
+  if (!IsRootWebRenderBridgeParent() &&
+      StaticPrefs::WebRenderSplitRenderRoots()) {
     mRenderRoot = wr::RenderRoot::Content;
   }
 
   for (auto& api : aApis) {
     MOZ_ASSERT(api);
     mApis[api->GetRenderRoot()] = api;
   }
 }
@@ -916,17 +917,17 @@ bool WebRenderBridgeParent::SetDisplayLi
     if (IsRootWebRenderBridgeParent()) {
       if (aRenderRoot != wr::RenderRoot::Default) {
         MutexAutoLock lock(mRenderRootRectMutex);
         mRenderRootRects[aRenderRoot] = ViewAs<ScreenPixel>(
             aRect, PixelCastJustification::LayoutDeviceIsScreenForTabDims);
       }
       LayoutDeviceIntSize widgetSize = mWidget->GetClientSize();
       LayoutDeviceIntRect rect;
-      if (gfxPrefs::WebRenderSplitRenderRoots()) {
+      if (StaticPrefs::WebRenderSplitRenderRoots()) {
         rect = RoundedToInt(aRect);
         rect.SetWidth(
             std::max(0, std::min(widgetSize.width - rect.X(), rect.Width())));
         rect.SetHeight(
             std::max(0, std::min(widgetSize.height - rect.Y(), rect.Height())));
       } else {
         // XXX: If we can't have multiple documents, just use the
         // pre-document- splitting behavior of directly applying the client
@@ -1603,17 +1604,17 @@ mozilla::ipc::IPCResult WebRenderBridgeP
 mozilla::ipc::IPCResult WebRenderBridgeParent::RecvClearCachedResources() {
   if (mDestroyed) {
     return IPC_OK();
   }
 
   for (auto renderRoot : wr::kRenderRoots) {
     if (renderRoot == wr::RenderRoot::Default ||
         (IsRootWebRenderBridgeParent() &&
-         gfxPrefs::WebRenderSplitRenderRoots())) {
+         StaticPrefs::WebRenderSplitRenderRoots())) {
       // Clear resources
       wr::TransactionBuilder txn;
       txn.SetLowPriority(true);
       txn.ClearDisplayList(GetNextWrEpoch(), mPipelineId);
       txn.Notify(wr::Checkpoint::SceneBuilt,
                  MakeUnique<ScheduleObserveLayersUpdate>(
                      mCompositorBridge, GetLayersId(),
                      mChildLayersObserverEpoch, false));
@@ -1691,17 +1692,17 @@ mozilla::ipc::IPCResult WebRenderBridgeP
 void WebRenderBridgeParent::ScheduleForcedGenerateFrame() {
   if (mDestroyed) {
     return;
   }
 
   for (auto renderRoot : wr::kRenderRoots) {
     if (renderRoot == wr::RenderRoot::Default ||
         (IsRootWebRenderBridgeParent() &&
-         gfxPrefs::WebRenderSplitRenderRoots())) {
+         StaticPrefs::WebRenderSplitRenderRoots())) {
       wr::TransactionBuilder fastTxn(/* aUseSceneBuilderThread */ false);
       fastTxn.InvalidateRenderedFrame();
       Api(renderRoot)->SendTransaction(fastTxn);
     }
   }
 
   ScheduleGenerateFrameAllRenderRoots();
 }
@@ -1728,17 +1729,17 @@ mozilla::ipc::IPCResult WebRenderBridgeP
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult WebRenderBridgeParent::RecvSetConfirmedTargetAPZC(
     const uint64_t& aBlockId, nsTArray<SLGuidAndRenderRoot>&& aTargets) {
   for (size_t i = 0; i < aTargets.Length(); i++) {
     // Guard against bad data from hijacked child processes
     if (aTargets[i].mRenderRoot > wr::kHighestRenderRoot ||
-        (!gfxPrefs::WebRenderSplitRenderRoots() &&
+        (!StaticPrefs::WebRenderSplitRenderRoots() &&
          aTargets[i].mRenderRoot != wr::RenderRoot::Default)) {
       NS_ERROR(
           "Unexpected render root in RecvSetConfirmedTargetAPZC; dropping "
           "message...");
       return IPC_FAIL(this, "Bad render root");
     }
     if (aTargets[i].mScrollableLayerGuid.mLayersId != GetLayersId()) {
       NS_ERROR(
--- a/gfx/src/DriverCrashGuard.cpp
+++ b/gfx/src/DriverCrashGuard.cpp
@@ -1,24 +1,24 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #include "DriverCrashGuard.h"
 #include "gfxEnv.h"
-#include "gfxPrefs.h"
 #include "gfxConfig.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsExceptionHandler.h"
 #include "nsServiceManagerUtils.h"
 #include "nsString.h"
 #include "nsXULAppAPI.h"
 #include "mozilla/Preferences.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/Services.h"
 #include "mozilla/gfx/Logging.h"
 #include "mozilla/dom/ContentChild.h"
 
 namespace mozilla {
 namespace gfx {
 
@@ -401,18 +401,18 @@ bool D3D11LayersCrashGuard::UpdateEnviro
     return false;
   }
 
   checked = true;
 
   bool changed = false;
   // Feature status.
 #if defined(XP_WIN)
-  bool d2dEnabled = gfxPrefs::Direct2DForceEnabled() ||
-                    (!gfxPrefs::Direct2DDisabled() &&
+  bool d2dEnabled = StaticPrefs::Direct2DForceEnabled() ||
+                    (!StaticPrefs::Direct2DDisabled() &&
                      FeatureEnabled(nsIGfxInfo::FEATURE_DIRECT2D));
   changed |= CheckAndUpdateBoolPref("feature-d2d", d2dEnabled);
 
   bool d3d11Enabled = gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING);
   changed |= CheckAndUpdateBoolPref("feature-d3d11", d3d11Enabled);
   if (changed) {
     RecordTelemetry(TelemetryState::EnvironmentChanged);
   }
--- a/gfx/tests/gtest/TestGfxPrefs.cpp
+++ b/gfx/tests/gtest/TestGfxPrefs.cpp
@@ -23,46 +23,46 @@ TEST(GfxPrefs, Singleton)
 }
 
 TEST(GfxPrefs, OnceValues)
 {
   gfxPrefs::GetSingleton();
   ASSERT_TRUE(gfxPrefs::SingletonExists());
 
   // Once boolean, default true
-  ASSERT_TRUE(gfxPrefs::WorkAroundDriverBugs());
+  ASSERT_TRUE(StaticPrefs::WorkAroundDriverBugs());
 
   // Once boolean, default false
-  ASSERT_FALSE(gfxPrefs::UseApitrace());
+  ASSERT_FALSE(StaticPrefs::UseApitrace());
 
   // Once uint32_t, default 5
-  ASSERT_TRUE(gfxPrefs::APZMaxVelocityQueueSize() == 5);
+  ASSERT_TRUE(StaticPrefs::APZMaxVelocityQueueSize() == 5);
 
   // Once float, default 0 (should be OK with ==)
-  ASSERT_TRUE(gfxPrefs::APZCurveFunctionX1() == 0.0f);
+  ASSERT_TRUE(StaticPrefs::APZCurveFunctionX1() == 0.0f);
 }
 
 TEST(GfxPrefs, Set)
 {
   gfxPrefs::GetSingleton();
   ASSERT_TRUE(gfxPrefs::SingletonExists());
 
   // Once boolean, default false
-  ASSERT_FALSE(gfxPrefs::UseApitrace());
-  gfxPrefs::SetUseApitrace(true);
-  ASSERT_TRUE(gfxPrefs::UseApitrace());
-  gfxPrefs::SetUseApitrace(false);
-  ASSERT_FALSE(gfxPrefs::UseApitrace());
+  ASSERT_FALSE(StaticPrefs::UseApitrace());
+  StaticPrefs::SetUseApitrace(true);
+  ASSERT_TRUE(StaticPrefs::UseApitrace());
+  StaticPrefs::SetUseApitrace(false);
+  ASSERT_FALSE(StaticPrefs::UseApitrace());
 
   // Once float, default 0
-  ASSERT_TRUE(gfxPrefs::APZCurveFunctionX1() == 0.0f);
-  gfxPrefs::SetAPZCurveFunctionX1(1.75f);
-  ASSERT_TRUE(gfxPrefs::APZCurveFunctionX1() == 1.75f);
-  gfxPrefs::SetAPZCurveFunctionX1(0.0f);
-  ASSERT_TRUE(gfxPrefs::APZCurveFunctionX1() == 0.0f);
+  ASSERT_TRUE(StaticPrefs::APZCurveFunctionX1() == 0.0f);
+  StaticPrefs::SetAPZCurveFunctionX1(1.75f);
+  ASSERT_TRUE(StaticPrefs::APZCurveFunctionX1() == 1.75f);
+  StaticPrefs::SetAPZCurveFunctionX1(0.0f);
+  ASSERT_TRUE(StaticPrefs::APZCurveFunctionX1() == 0.0f);
 }
 
 // Randomly test the function we use in nsExceptionHandler.cpp here:
 extern bool SimpleNoCLibDtoA(double aValue, char* aBuffer, int aBufferLength);
 TEST(GfxPrefs, StringUtility)
 {
   char testBuffer[64];
   double testVal[] = {
--- a/gfx/thebes/D3D11Checks.cpp
+++ b/gfx/thebes/D3D11Checks.cpp
@@ -2,17 +2,16 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "D3D11Checks.h"
 #include "DXVA2Manager.h"
 #include "gfxConfig.h"
 #include "GfxDriverInfo.h"
-#include "gfxPrefs.h"
 #include "gfxWindowsPlatform.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/StaticPrefs.h"
 #include "mozilla/gfx/gfxVars.h"
 #include "mozilla/gfx/Logging.h"
 #include "mozilla/layers/TextureD3D11.h"
 #include "nsIGfxInfo.h"
 #include <dxgi.h>
@@ -135,17 +134,17 @@ bool D3D11Checks::DoesRenderTargetViewNe
 /* static */
 bool D3D11Checks::DoesDeviceWork() {
   static bool checked = false;
   static bool result = false;
 
   if (checked) return result;
   checked = true;
 
-  if (gfxPrefs::Direct2DForceEnabled() ||
+  if (StaticPrefs::Direct2DForceEnabled() ||
       gfxConfig::IsForcedOnByUser(Feature::HW_COMPOSITING)) {
     result = true;
     return true;
   }
 
   if (GetModuleHandleW(L"igd10umd32.dll")) {
     const wchar_t* checkModules[] = {L"dlumd32.dll", L"dlumd11.dll",
                                      L"dlumd10.dll"};
@@ -196,29 +195,29 @@ static bool TryCreateTexture2D(ID3D11Dev
 static bool DoesTextureSharingWorkInternal(ID3D11Device* device,
                                            DXGI_FORMAT format, UINT bindflags) {
   // CreateTexture2D is known to crash on lower feature levels, see bugs
   // 1170211 and 1089413.
   if (device->GetFeatureLevel() < D3D_FEATURE_LEVEL_10_0) {
     return false;
   }
 
-  if (gfxPrefs::Direct2DForceEnabled() ||
+  if (StaticPrefs::Direct2DForceEnabled() ||
       gfxConfig::IsForcedOnByUser(Feature::HW_COMPOSITING)) {
     return true;
   }
 
   if (GetModuleHandleW(L"atidxx32.dll")) {
     nsCOMPtr<nsIGfxInfo> gfxInfo = services::GetGfxInfo();
     if (gfxInfo) {
       nsString vendorID, vendorID2;
       gfxInfo->GetAdapterVendorID(vendorID);
       gfxInfo->GetAdapterVendorID2(vendorID2);
       if (vendorID.EqualsLiteral("0x8086") && vendorID2.IsEmpty()) {
-        if (!gfxPrefs::LayersAMDSwitchableGfxEnabled()) {
+        if (!StaticPrefs::LayersAMDSwitchableGfxEnabled()) {
           return false;
         }
         gfxCriticalError(CriticalLog::DefaultOptions(false))
             << "PossiblyBrokenSurfaceSharing_UnexpectedAMDGPU";
       }
     }
   }
 
--- a/gfx/thebes/DeviceManagerDx.cpp
+++ b/gfx/thebes/DeviceManagerDx.cpp
@@ -2,17 +2,16 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DeviceManagerDx.h"
 #include "D3D11Checks.h"
 #include "gfxConfig.h"
 #include "GfxDriverInfo.h"
-#include "gfxPrefs.h"
 #include "gfxWindowsPlatform.h"
 #include "mozilla/D3DMessageUtils.h"
 #include "mozilla/StaticPrefs.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/WindowsVersion.h"
 #include "mozilla/gfx/GPUParent.h"
 #include "mozilla/gfx/GraphicsMessages.h"
 #include "mozilla/gfx/Logging.h"
@@ -179,17 +178,17 @@ static inline bool ProcessOwnsCompositor
 #endif
 
 bool DeviceManagerDx::CreateCompositorDevices() {
   MOZ_ASSERT(ProcessOwnsCompositor());
 
   FeatureState& d3d11 = gfxConfig::GetFeature(Feature::D3D11_COMPOSITING);
   MOZ_ASSERT(d3d11.IsEnabled());
 
-  if (int32_t sleepSec = gfxPrefs::Direct3D11SleepOnCreateDevice()) {
+  if (int32_t sleepSec = StaticPrefs::Direct3D11SleepOnCreateDevice()) {
     printf_stderr("Attach to PID: %d\n", GetCurrentProcessId());
     Sleep(sleepSec * 1000);
   }
 
   if (!LoadD3D11()) {
     return false;
   }
 
@@ -459,17 +458,17 @@ bool DeviceManagerDx::CreateCompositorDe
 // whole graphics stack is blown away anyway. But just in case, we
 // make gpu process IDs negative and parent process IDs positive.
 static inline int32_t GetNextDeviceCounter() {
   static int32_t sDeviceCounter = 0;
   return XRE_IsGPUProcess() ? --sDeviceCounter : ++sDeviceCounter;
 }
 
 void DeviceManagerDx::CreateCompositorDevice(FeatureState& d3d11) {
-  if (gfxPrefs::LayersD3D11ForceWARP()) {
+  if (StaticPrefs::LayersD3D11ForceWARP()) {
     CreateWARPCompositorDevice();
     return;
   }
 
   RefPtr<IDXGIAdapter1> adapter = GetDXGIAdapter();
   if (!adapter) {
     d3d11.SetFailed(FeatureStatus::Unavailable,
                     "Failed to acquire a DXGI adapter",
@@ -529,30 +528,30 @@ void DeviceManagerDx::CreateCompositorDe
   }
   mCompositorDevice->SetExceptionMode(0);
 }
 
 bool DeviceManagerDx::CreateDevice(IDXGIAdapter* aAdapter,
                                    D3D_DRIVER_TYPE aDriverType, UINT aFlags,
                                    HRESULT& aResOut,
                                    RefPtr<ID3D11Device>& aOutDevice) {
-  if (gfxPrefs::Direct3D11EnableDebugLayer() ||
-      gfxPrefs::Direct3D11BreakOnError()) {
+  if (StaticPrefs::Direct3D11EnableDebugLayer() ||
+      StaticPrefs::Direct3D11BreakOnError()) {
     aFlags |= D3D11_CREATE_DEVICE_DEBUG;
   }
 
   MOZ_SEH_TRY {
     aResOut = sD3D11CreateDeviceFn(
         aAdapter, aDriverType, nullptr, aFlags, mFeatureLevels.Elements(),
         mFeatureLevels.Length(), D3D11_SDK_VERSION, getter_AddRefs(aOutDevice),
         nullptr, nullptr);
   }
   MOZ_SEH_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { return false; }
 
-  if (gfxPrefs::Direct3D11BreakOnError()) {
+  if (StaticPrefs::Direct3D11BreakOnError()) {
     do {
       if (!aOutDevice) break;
 
       RefPtr<ID3D11Debug> debug;
       if (!SUCCEEDED(aOutDevice->QueryInterface(__uuidof(ID3D11Debug),
                                                 getter_AddRefs(debug))))
         break;
 
@@ -578,17 +577,17 @@ bool DeviceManagerDx::CreateDevice(IDXGI
     } while (false);
   }
 
   return true;
 }
 
 void DeviceManagerDx::CreateWARPCompositorDevice() {
   ScopedGfxFeatureReporter reporterWARP("D3D11-WARP",
-                                        gfxPrefs::LayersD3D11ForceWARP());
+                                        StaticPrefs::LayersD3D11ForceWARP());
   FeatureState& d3d11 = gfxConfig::GetFeature(Feature::D3D11_COMPOSITING);
 
   HRESULT hr;
   RefPtr<ID3D11Device> device;
 
   // Use D3D11_CREATE_DEVICE_PREVENT_INTERNAL_THREADING_OPTIMIZATIONS
   // to prevent bug 1092260. IE 11 also uses this flag.
   UINT flags = D3D11_CREATE_DEVICE_BGRA_SUPPORT;
--- a/gfx/thebes/gfxAndroidPlatform.cpp
+++ b/gfx/thebes/gfxAndroidPlatform.cpp
@@ -7,27 +7,27 @@
 #include "base/basictypes.h"
 
 #include "gfxAndroidPlatform.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/CountingAllocatorBase.h"
 #include "mozilla/intl/LocaleService.h"
 #include "mozilla/intl/OSPreferences.h"
 #include "mozilla/Preferences.h"
+#include "mozilla/StaticPrefs.h"
 
 #include "gfx2DGlue.h"
 #include "gfxFT2FontList.h"
 #include "gfxImageSurface.h"
 #include "gfxTextRun.h"
 #include "nsXULAppAPI.h"
 #include "nsIScreen.h"
 #include "nsIScreenManager.h"
 #include "nsServiceManagerUtils.h"
 #include "nsUnicodeProperties.h"
-#include "gfxPrefs.h"
 #include "cairo.h"
 #include "VsyncSource.h"
 
 #include "ft2build.h"
 #include FT_FREETYPE_H
 #include FT_MODULE_H
 
 #include "GeneratedJNINatives.h"
@@ -88,17 +88,17 @@ gfxAndroidPlatform::gfxAndroidPlatform()
 
   Factory::SetFTLibrary(gPlatformFTLibrary);
 
   RegisterStrongMemoryReporter(new FreetypeReporter());
 
   mOffscreenFormat = GetScreenDepth() == 16 ? SurfaceFormat::R5G6B5_UINT16
                                             : SurfaceFormat::X8R8G8B8_UINT32;
 
-  if (gfxPrefs::AndroidRGB16Force()) {
+  if (StaticPrefs::AndroidRGB16Force()) {
     mOffscreenFormat = SurfaceFormat::R5G6B5_UINT16;
   }
 }
 
 gfxAndroidPlatform::~gfxAndroidPlatform() {
   FT_Done_Library(gPlatformFTLibrary);
   gPlatformFTLibrary = nullptr;
 }
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -592,17 +592,17 @@ static void WebRenderDebugPrefChangeCall
 static uint32_t GetSkiaGlyphCacheSize() {
   // Only increase font cache size on non-android to save memory.
 #  if !defined(MOZ_WIDGET_ANDROID)
   // 10mb as the default pref cache size on desktop due to talos perf tweaking.
   // Chromium uses 20mb and skia default uses 2mb.
   // We don't need to change the font cache count since we usually
   // cache thrash due to asian character sets in talos.
   // Only increase memory on the content process
-  uint32_t cacheSize = gfxPrefs::SkiaContentFontCacheSize() * 1024 * 1024;
+  uint32_t cacheSize = StaticPrefs::SkiaContentFontCacheSize() * 1024 * 1024;
   if (mozilla::BrowserTabsRemoteAutostart()) {
     return XRE_IsContentProcess() ? cacheSize : kDefaultGlyphCacheSize;
   }
 
   return cacheSize;
 #  else
   return kDefaultGlyphCacheSize;
 #  endif  // MOZ_WIDGET_ANDROID
@@ -884,35 +884,35 @@ void gfxPlatform::Init() {
 
   // Drop a note in the crash report if we end up forcing an option that could
   // destabilize things.  New items should be appended at the end (of an
   // existing or in a new section), so that we don't have to know the version to
   // interpret these cryptic strings.
   {
     nsAutoCString forcedPrefs;
     // D2D prefs
-    forcedPrefs.AppendPrintf("FP(D%d%d", gfxPrefs::Direct2DDisabled(),
-                             gfxPrefs::Direct2DForceEnabled());
+    forcedPrefs.AppendPrintf("FP(D%d%d", StaticPrefs::Direct2DDisabled(),
+                             StaticPrefs::Direct2DForceEnabled());
     // Layers prefs
     forcedPrefs.AppendPrintf(
-        "-L%d%d%d%d", gfxPrefs::LayersAMDSwitchableGfxEnabled(),
-        gfxPrefs::LayersAccelerationDisabledDoNotUseDirectly(),
-        gfxPrefs::LayersAccelerationForceEnabledDoNotUseDirectly(),
-        gfxPrefs::LayersD3D11ForceWARP());
+        "-L%d%d%d%d", StaticPrefs::LayersAMDSwitchableGfxEnabled(),
+        StaticPrefs::LayersAccelerationDisabledDoNotUseDirectly(),
+        StaticPrefs::LayersAccelerationForceEnabledDoNotUseDirectly(),
+        StaticPrefs::LayersD3D11ForceWARP());
     // WebGL prefs
     forcedPrefs.AppendPrintf(
         "-W%d%d%d%d%d%d%d%d", StaticPrefs::WebGLANGLEForceD3D11(),
         StaticPrefs::WebGLANGLEForceWARP(), StaticPrefs::WebGLDisabled(),
         StaticPrefs::WebGLDisableANGLE(), StaticPrefs::WebGLDXGLEnabled(),
-        StaticPrefs::WebGLForceEnabled(), gfxPrefs::WebGLForceLayersReadback(),
-        StaticPrefs::WebGLForceMSAA());
+        StaticPrefs::WebGLForceEnabled(),
+        StaticPrefs::WebGLForceLayersReadback(), StaticPrefs::WebGLForceMSAA());
     // Prefs that don't fit into any of the other sections
-    forcedPrefs.AppendPrintf("-T%d%d%d) ", gfxPrefs::AndroidRGB16Force(),
+    forcedPrefs.AppendPrintf("-T%d%d%d) ", StaticPrefs::AndroidRGB16Force(),
                              0,  // SkiaGL canvas no longer supported
-                             gfxPrefs::ForceShmemTiles());
+                             StaticPrefs::ForceShmemTiles());
     ScopedGfxFeatureReporter::AppNote(forcedPrefs);
   }
 
   InitMoz2DLogging();
 
   gGfxPlatformPrefsLock = new Mutex("gfxPlatform::gGfxPlatformPrefsLock");
 
   /* Initialize the GfxInfo service.
@@ -943,16 +943,17 @@ void gfxPlatform::Init() {
 #elif defined(ANDROID)
   gPlatform = new gfxAndroidPlatform;
 #else
 #  error "No gfxPlatform implementation available"
 #endif
   gPlatform->PopulateScreenInfo();
   gPlatform->InitAcceleration();
   gPlatform->InitWebRenderConfig();
+
   // When using WebRender, we defer initialization of the D3D11 devices until
   // the (rare) cases where they're used. Note that the GPU process where
   // WebRender runs doesn't initialize gfxPlatform and performs explicit
   // initialization of the bits it needs.
   if (!UseWebRender()) {
     gPlatform->EnsureDevicesInitialized();
   }
   gPlatform->InitOMTPConfig();
@@ -1110,32 +1111,32 @@ bool gfxPlatform::IsDXP016Blocked() {
   return IsFeatureSupported(nsIGfxInfo::FEATURE_DX_P016);
 }
 
 /* static */
 int32_t gfxPlatform::MaxTextureSize() {
   // Make sure we don't completely break rendering because of a typo in the
   // pref or whatnot.
   const int32_t kMinSizePref = 2048;
-  return std::max(kMinSizePref, gfxPrefs::MaxTextureSizeDoNotUseDirectly());
+  return std::max(kMinSizePref, StaticPrefs::MaxTextureSizeDoNotUseDirectly());
 }
 
 /* static */
 int32_t gfxPlatform::MaxAllocSize() {
   // Make sure we don't completely break rendering because of a typo in the
   // pref or whatnot.
   const int32_t kMinAllocPref = 10000000;
-  return std::max(kMinAllocPref, gfxPrefs::MaxAllocSizeDoNotUseDirectly());
+  return std::max(kMinAllocPref, StaticPrefs::MaxAllocSizeDoNotUseDirectly());
 }
 
 /* static */
 void gfxPlatform::InitMoz2DLogging() {
   auto fwd = new CrashStatsLogForwarder(
       CrashReporter::Annotation::GraphicsCriticalError);
-  fwd->SetCircularBufferSize(gfxPrefs::GfxLoggingCrashLength());
+  fwd->SetCircularBufferSize(StaticPrefs::GfxLoggingCrashLength());
 
   mozilla::gfx::Config cfg;
   cfg.mLogForwarder = fwd;
   cfg.mMaxTextureSize = gfxPlatform::MaxTextureSize();
   cfg.mMaxAllocSize = gfxPlatform::MaxAllocSize();
 
   gfx::Factory::Init(cfg);
 }
@@ -1530,20 +1531,20 @@ already_AddRefed<DataSourceSurface> gfxP
 
 void gfxPlatform::ComputeTileSize() {
   // The tile size should be picked in the parent processes
   // and sent to the child processes over IPDL GetTileSize.
   if (!XRE_IsParentProcess()) {
     return;
   }
 
-  int32_t w = gfxPrefs::LayersTileWidth();
-  int32_t h = gfxPrefs::LayersTileHeight();
-
-  if (gfxPrefs::LayersTilesAdjust()) {
+  int32_t w = StaticPrefs::LayersTileWidth();
+  int32_t h = StaticPrefs::LayersTileHeight();
+
+  if (StaticPrefs::LayersTilesAdjust()) {
     gfx::IntSize screenSize = GetScreenSize();
     if (screenSize.width > 0) {
       // Choose a size so that there are between 2 and 4 tiles per screen width.
       // FIXME: we should probably make sure this is within the max texture
       // size, but I think everything should at least support 1024
       w = h = clamped(int32_t(RoundUpPow2(screenSize.width)) / 4, 256, 1024);
     }
   }
@@ -2369,17 +2370,17 @@ void gfxPlatform::InitAcceleration() {
   if (Preferences::GetBool("media.hardware-video-decoding.enabled", false) &&
 #ifdef XP_WIN
       Preferences::GetBool("media.wmf.dxva.enabled", true) &&
 #endif
       NS_SUCCEEDED(
           gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_HARDWARE_VIDEO_DECODING,
                                     discardFailureId, &status))) {
     if (status == nsIGfxInfo::FEATURE_STATUS_OK ||
-        gfxPrefs::HardwareVideoDecodingForceEnabled()) {
+        StaticPrefs::HardwareVideoDecodingForceEnabled()) {
       sLayersSupportsHardwareVideoDecoding = true;
     }
   }
 
   sLayersAccelerationPrefsInitialized = true;
 
   if (XRE_IsParentProcess()) {
     Preferences::RegisterCallbackAndCall(
@@ -2387,35 +2388,37 @@ void gfxPlatform::InitAcceleration() {
         "media.hardware-video-decoding.failed");
     InitGPUProcessPrefs();
   }
 }
 
 void gfxPlatform::InitGPUProcessPrefs() {
   // We want to hide this from about:support, so only set a default if the
   // pref is known to be true.
-  if (!gfxPrefs::GPUProcessEnabled() && !gfxPrefs::GPUProcessForceEnabled()) {
+  if (!StaticPrefs::GPUProcessEnabled() &&
+      !StaticPrefs::GPUProcessForceEnabled()) {
     return;
   }
 
   FeatureState& gpuProc = gfxConfig::GetFeature(Feature::GPU_PROCESS);
 
   // We require E10S - otherwise, there is very little benefit to the GPU
   // process, since the UI process must still use acceleration for
   // performance.
   if (!BrowserTabsRemoteAutostart()) {
     gpuProc.DisableByDefault(FeatureStatus::Unavailable,
                              "Multi-process mode is not enabled",
                              NS_LITERAL_CSTRING("FEATURE_FAILURE_NO_E10S"));
   } else {
-    gpuProc.SetDefaultFromPref(gfxPrefs::GetGPUProcessEnabledPrefName(), true,
-                               gfxPrefs::GetGPUProcessEnabledPrefDefault());
+    gpuProc.SetDefaultFromPref(StaticPrefs::GetGPUProcessEnabledPrefName(),
+                               true,
+                               StaticPrefs::GetGPUProcessEnabledPrefDefault());
   }
 
-  if (gfxPrefs::GPUProcessForceEnabled()) {
+  if (StaticPrefs::GPUProcessForceEnabled()) {
     gpuProc.UserForceEnable("User force-enabled via pref");
   }
 
   if (IsHeadless()) {
     gpuProc.ForceDisable(FeatureStatus::Blocked, "Headless mode is enabled",
                          NS_LITERAL_CSTRING("FEATURE_FAILURE_HEADLESS_MODE"));
     return;
   }
@@ -2435,31 +2438,31 @@ void gfxPlatform::InitGPUProcessPrefs() 
 void gfxPlatform::InitCompositorAccelerationPrefs() {
   const char* acceleratedEnv = PR_GetEnv("MOZ_ACCELERATED");
 
   FeatureState& feature = gfxConfig::GetFeature(Feature::HW_COMPOSITING);
 
   // Base value - does the platform allow acceleration?
   if (feature.SetDefault(AccelerateLayersByDefault(), FeatureStatus::Blocked,
                          "Acceleration blocked by platform")) {
-    if (gfxPrefs::LayersAccelerationDisabledDoNotUseDirectly()) {
+    if (StaticPrefs::LayersAccelerationDisabledDoNotUseDirectly()) {
       feature.UserDisable("Disabled by pref",
                           NS_LITERAL_CSTRING("FEATURE_FAILURE_COMP_PREF"));
     } else if (acceleratedEnv && *acceleratedEnv == '0') {
       feature.UserDisable("Disabled by envvar",
                           NS_LITERAL_CSTRING("FEATURE_FAILURE_COMP_ENV"));
     }
   } else {
     if (acceleratedEnv && *acceleratedEnv == '1') {
       feature.UserEnable("Enabled by envvar");
     }
   }
 
   // This has specific meaning elsewhere, so we always record it.
-  if (gfxPrefs::LayersAccelerationForceEnabledDoNotUseDirectly()) {
+  if (StaticPrefs::LayersAccelerationForceEnabledDoNotUseDirectly()) {
     feature.UserForceEnable("Force-enabled by pref");
   }
 
   // Safe, headless, and record/replay modes override everything.
   if (InSafeMode()) {
     feature.ForceDisable(FeatureStatus::Blocked,
                          "Acceleration blocked by safe-mode",
                          NS_LITERAL_CSTRING("FEATURE_FAILURE_COMP_SAFEMODE"));
@@ -2473,18 +2476,18 @@ void gfxPlatform::InitCompositorAccelera
     feature.ForceDisable(
         FeatureStatus::Blocked, "Acceleration blocked by recording/replaying",
         NS_LITERAL_CSTRING("FEATURE_FAILURE_COMP_RECORDREPLAY"));
   }
 }
 
 /*static*/
 bool gfxPlatform::WebRenderPrefEnabled() {
-  return gfxPrefs::WebRenderAll() ||
-         gfxPrefs::WebRenderEnabledDoNotUseDirectly();
+  return StaticPrefs::WebRenderAll() ||
+         StaticPrefs::WebRenderEnabledDoNotUseDirectly();
 }
 
 /*static*/
 bool gfxPlatform::WebRenderEnvvarEnabled() {
   const char* env = PR_GetEnv("MOZ_WEBRENDER");
   return (env && *env == '1');
 }
 
@@ -2507,32 +2510,33 @@ static bool CalculateWrQualifiedPrefValu
     // if we have one. This ensures the user doesn't mess with the pref.
     // If we need it again, we'll re-create it on shutdown.
     Preferences::ClearUser(WR_ROLLOUT_PREF_DEFAULT);
   });
 
   if (!Preferences::HasUserValue(WR_ROLLOUT_PREF) &&
       Preferences::HasUserValue(WR_ROLLOUT_PREF_DEFAULT)) {
     // The user has not set a user pref, and we have a default value set by the
-    // shutdown observer. We should use that instead of the gfxPref's default,
-    // as if Normandy had a chance to set it before startup, that is the value
-    // gfxPrefs would return, rather than the default set by DECL_GFX_PREF.
-    return gfxPrefs::WebRenderAllQualifiedDefault();
+    // shutdown observer. We should use that instead of the StaticPrefs's
+    // default, as if Normandy had a chance to set it before startup, that is
+    // the value StaticPrefs would return, rather than the default set by
+    // DECL_GFX_PREF.
+    return StaticPrefs::WebRenderAllQualifiedDefault();
   }
 
   // We don't have a user value for the rollout pref, and we don't have the
   // value of the rollout pref at last shutdown stored. So we should fallback
   // to using whatever default is stored in the gfxPref. *But* if we're running
   // under the Marionette pref rollout work-around test, we may want to override
   // the default value expressed here, so we can test the "default disabled;
   // rollout pref enabled" case.
   if (Preferences::HasUserValue(WR_ROLLOUT_PREF_OVERRIDE)) {
     return Preferences::GetBool(WR_ROLLOUT_PREF_OVERRIDE);
   }
-  return gfxPrefs::WebRenderAllQualified();
+  return StaticPrefs::WebRenderAllQualified();
 }
 
 static FeatureState& WebRenderHardwareQualificationStatus(
     const IntSize& aScreenSize, bool aHasBattery, nsCString& aOutFailureId) {
   FeatureState& featureWebRenderQualified =
       gfxConfig::GetFeature(Feature::WEBRENDER_QUALIFIED);
   featureWebRenderQualified.EnableByDefault();
 
@@ -2793,17 +2797,17 @@ void gfxPlatform::InitWebRenderConfig() 
     featureWebRender.UserEnable("Force enabled by pref");
   } else if (wrQualifiedAll && featureWebRenderQualified.IsEnabled()) {
     featureWebRender.UserEnable("Qualified enabled by pref ");
   }
 
   // If the user set the pref to force-disable, let's do that. This will
   // override all the other enabling prefs (gfx.webrender.enabled,
   // gfx.webrender.all, and gfx.webrender.all.qualified).
-  if (gfxPrefs::WebRenderForceDisabled() || WebRenderEnvvarDisabled()) {
+  if (StaticPrefs::WebRenderForceDisabled() || WebRenderEnvvarDisabled()) {
     featureWebRender.UserDisable(
         "User force-disabled WR",
         NS_LITERAL_CSTRING("FEATURE_FAILURE_USER_FORCE_DISABLED"));
   }
 
   // HW_COMPOSITING being disabled implies interfacing with the GPU might break
   if (!gfxConfig::IsEnabled(Feature::HW_COMPOSITING)) {
     featureWebRender.ForceDisable(
@@ -2955,17 +2959,17 @@ bool gfxPlatform::AccelerateLayersByDefa
 #else
   return false;
 #endif
 }
 
 bool gfxPlatform::BufferRotationEnabled() {
   MutexAutoLock autoLock(*gGfxPlatformPrefsLock);
 
-  return sBufferRotationCheckPref && gfxPrefs::BufferRotationEnabled();
+  return sBufferRotationCheckPref && StaticPrefs::BufferRotationEnabled();
 }
 
 void gfxPlatform::DisableBufferRotation() {
   MutexAutoLock autoLock(*gGfxPlatformPrefsLock);
 
   sBufferRotationCheckPref = false;
 }
 
@@ -2976,56 +2980,57 @@ bool gfxPlatform::UsesOffMainThreadCompo
   }
 
   static bool firstTime = true;
   static bool result = false;
 
   if (firstTime) {
     MOZ_ASSERT(sLayersAccelerationPrefsInitialized);
     result = gfxVars::BrowserTabsRemoteAutostart() ||
-             !gfxPrefs::LayersOffMainThreadCompositionForceDisabled();
+             !StaticPrefs::LayersOffMainThreadCompositionForceDisabled();
 #if defined(MOZ_WIDGET_GTK)
     // Linux users who chose OpenGL are being grandfathered in to OMTC
-    result |= gfxPrefs::LayersAccelerationForceEnabledDoNotUseDirectly();
+    result |= StaticPrefs::LayersAccelerationForceEnabledDoNotUseDirectly();
 
 #endif
     firstTime = false;
   }
 
   return result;
 }
 
 bool gfxPlatform::UsesTiling() const {
   bool usesSkia = GetDefaultContentBackend() == BackendType::SKIA;
 
   // We can't just test whether the PaintThread is initialized here because
   // this function is used when initializing the PaintThread. So instead we
   // check the conditions that enable OMTP with parallel painting.
   bool usesPOMTP = XRE_IsContentProcess() && gfxVars::UseOMTP() &&
-                   (gfxPrefs::LayersOMTPPaintWorkers() == -1 ||
-                    gfxPrefs::LayersOMTPPaintWorkers() > 1);
-
-  return gfxPrefs::LayersTilesEnabled() ||
-         (gfxPrefs::LayersTilesEnabledIfSkiaPOMTP() && usesSkia && usesPOMTP);
+                   (StaticPrefs::LayersOMTPPaintWorkers() == -1 ||
+                    StaticPrefs::LayersOMTPPaintWorkers() > 1);
+
+  return StaticPrefs::LayersTilesEnabled() ||
+         (StaticPrefs::LayersTilesEnabledIfSkiaPOMTP() && usesSkia &&
+          usesPOMTP);
 }
 
 bool gfxPlatform::ContentUsesTiling() const {
   BackendPrefsData data = GetBackendPrefs();
   BackendType contentBackend = GetContentBackendPref(data.mContentBitmask);
   if (contentBackend == BackendType::NONE) {
     contentBackend = data.mContentDefault;
   }
 
   bool contentUsesSkia = contentBackend == BackendType::SKIA;
   bool contentUsesPOMTP =
-      gfxVars::UseOMTP() && (gfxPrefs::LayersOMTPPaintWorkers() == -1 ||
-                             gfxPrefs::LayersOMTPPaintWorkers() > 1);
-
-  return gfxPrefs::LayersTilesEnabled() ||
-         (gfxPrefs::LayersTilesEnabledIfSkiaPOMTP() && contentUsesSkia &&
+      gfxVars::UseOMTP() && (StaticPrefs::LayersOMTPPaintWorkers() == -1 ||
+                             StaticPrefs::LayersOMTPPaintWorkers() > 1);
+
+  return StaticPrefs::LayersTilesEnabled() ||
+         (StaticPrefs::LayersTilesEnabledIfSkiaPOMTP() && contentUsesSkia &&
           contentUsesPOMTP);
 }
 
 /***
  * The preference "layout.frame_rate" has 3 meanings depending on the value:
  *
  * -1 = Auto (default), use hardware vsync or software vsync @ 60 hz if hw
  *      vsync fails.
@@ -3139,17 +3144,17 @@ void gfxPlatform::GetApzSupportInfo(mozi
   }
 
   if (SupportsApzAutoscrolling()) {
     aObj.DefineProperty("ApzAutoscrollInput", 1);
   }
 }
 
 void gfxPlatform::GetTilesSupportInfo(mozilla::widget::InfoObject& aObj) {
-  if (!gfxPrefs::LayersTilesEnabled()) {
+  if (!StaticPrefs::LayersTilesEnabled()) {
     return;
   }
 
   IntSize tileSize = gfxVars::TileSize();
   aObj.DefineProperty("TileHeight", tileSize.height);
   aObj.DefineProperty("TileWidth", tileSize.width);
 }
 
@@ -3187,17 +3192,17 @@ class FrameStatsComparator {
   // Reverse the condition here since we want the array sorted largest to
   // smallest.
   bool LessThan(const FrameStats& aA, const FrameStats& aB) const {
     return aA.contentFrameTime() > aB.contentFrameTime();
   }
 };
 
 void gfxPlatform::NotifyFrameStats(nsTArray<FrameStats>&& aFrameStats) {
-  if (!gfxPrefs::LoggingSlowFramesEnabled()) {
+  if (!StaticPrefs::LoggingSlowFramesEnabled()) {
     return;
   }
 
   FrameStatsComparator comp;
   for (FrameStats& f : aFrameStats) {
     mFrameStats.InsertElementSorted(f, comp);
   }
   if (mFrameStats.Length() > 10) {
@@ -3228,17 +3233,17 @@ bool gfxPlatform::AsyncPanZoomEnabled() 
 #ifdef MOZ_WIDGET_ANDROID
   return true;
 #else
   if (!gfxPrefs::SingletonExists()) {
     // Make sure the gfxPrefs has been initialized before reading from it.
     MOZ_ASSERT(NS_IsMainThread());
     gfxPrefs::GetSingleton();
   }
-  return gfxPrefs::AsyncPanZoomEnabledDoNotUseDirectly();
+  return StaticPrefs::AsyncPanZoomEnabledDoNotUseDirectly();
 #endif
 }
 
 /*static*/
 bool gfxPlatform::PerfWarnings() { return StaticPrefs::PerfWarnings(); }
 
 void gfxPlatform::GetAcceleratedCompositorBackends(
     nsTArray<LayersBackend>& aBackends) {
@@ -3349,17 +3354,17 @@ bool gfxPlatform::SupportsApzTouchInput(
   return dom::TouchEvent::PrefEnabled(nullptr);
 }
 
 bool gfxPlatform::SupportsApzDragInput() const {
   return StaticPrefs::APZDragEnabled();
 }
 
 bool gfxPlatform::SupportsApzKeyboardInput() const {
-  return gfxPrefs::APZKeyboardEnabled();
+  return StaticPrefs::APZKeyboardEnabled();
 }
 
 bool gfxPlatform::SupportsApzAutoscrolling() const {
   return StaticPrefs::APZAutoscrollEnabled();
 }
 
 void gfxPlatform::InitOpenGLConfig() {
 #ifdef XP_WIN
@@ -3378,25 +3383,25 @@ void gfxPlatform::InitOpenGLConfig() {
     openGLFeature.DisableByDefault(
         FeatureStatus::Unavailable, "Hardware compositing is disabled",
         NS_LITERAL_CSTRING("FEATURE_FAILURE_OPENGL_NEED_HWCOMP"));
     return;
   }
 
 #ifdef XP_WIN
   openGLFeature.SetDefaultFromPref(
-      gfxPrefs::GetLayersPreferOpenGLPrefName(), true,
-      gfxPrefs::GetLayersPreferOpenGLPrefDefault());
+      StaticPrefs::GetLayersPreferOpenGLPrefName(), true,
+      StaticPrefs::GetLayersPreferOpenGLPrefDefault());
 #else
   openGLFeature.EnableByDefault();
 #endif
 
   // When layers acceleration is force-enabled, enable it even for blacklisted
   // devices.
-  if (gfxPrefs::LayersAccelerationForceEnabledDoNotUseDirectly()) {
+  if (StaticPrefs::LayersAccelerationForceEnabledDoNotUseDirectly()) {
     openGLFeature.UserForceEnable("Force-enabled by pref");
     return;
   }
 
   nsCString message;
   nsCString failureId;
   if (!IsGfxInfoStatusOkay(nsIGfxInfo::FEATURE_OPENGL_LAYERS, &message,
                            failureId)) {
--- a/gfx/thebes/gfxPlatform.h
+++ b/gfx/thebes/gfxPlatform.h
@@ -664,18 +664,18 @@ class gfxPlatform : public mozilla::laye
    * Helper method, creates a draw target for a specific Azure backend.
    * Used by CreateOffscreenDrawTarget.
    */
   already_AddRefed<DrawTarget> CreateDrawTargetForBackend(
       mozilla::gfx::BackendType aBackend, const mozilla::gfx::IntSize& aSize,
       mozilla::gfx::SurfaceFormat aFormat);
 
   /**
-   * Wrapper around gfxPrefs::PerfWarnings().
-   * Extracted into a function to avoid including gfxPrefs.h from this file.
+   * Wrapper around StaticPrefs::PerfWarnings().
+   * Extracted into a function to avoid including StaticPrefs.h from this file.
    */
   static bool PerfWarnings();
 
   static void NotifyGPUProcessDisabled();
 
   void NotifyCompositorCreated(mozilla::layers::LayersBackend aBackend);
   mozilla::layers::LayersBackend GetCompositorBackend() const {
     return mCompositorBackend;
--- a/gfx/thebes/gfxPlatformFontList.cpp
+++ b/gfx/thebes/gfxPlatformFontList.cpp
@@ -4,33 +4,33 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/Logging.h"
 #include "mozilla/intl/LocaleService.h"
 #include "mozilla/intl/MozLocale.h"
 #include "mozilla/intl/OSPreferences.h"
 
 #include "gfxPlatformFontList.h"
-#include "gfxPrefs.h"
 #include "gfxTextRun.h"
 #include "gfxUserFontSet.h"
 #include "SharedFontList-impl.h"
 
 #include "nsCRT.h"
 #include "nsGkAtoms.h"
 #include "nsServiceManagerUtils.h"
 #include "nsUnicharUtils.h"
 #include "nsUnicodeProperties.h"
 #include "nsXULAppAPI.h"
 
 #include "mozilla/Attributes.h"
 #include "mozilla/Likely.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/Mutex.h"
 #include "mozilla/Preferences.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/dom/BlobImpl.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/ContentProcessMessageManager.h"
 #include "mozilla/dom/IPCBlobUtils.h"
 #include "mozilla/gfx/2D.h"
@@ -414,17 +414,17 @@ nsresult gfxPlatformFontList::InitFontLi
   mCodepointsWithNoFonts.reset();
   mCodepointsWithNoFonts.SetRange(0, 0x1f);     // C0 controls
   mCodepointsWithNoFonts.SetRange(0x7f, 0x9f);  // C1 controls
 
   sPlatformFontList = this;
 
   // Try to initialize the cross-process shared font list if enabled by prefs,
   // but not if we're running in Safe Mode.
-  if (gfxPrefs::SharedFontList() && !gfxPlatform::InSafeMode()) {
+  if (StaticPrefs::SharedFontList() && !gfxPlatform::InSafeMode()) {
     for (auto i = mFontEntries.Iter(); !i.Done(); i.Next()) {
       i.Data()->mShmemCharacterMap = nullptr;
       i.Data()->mShmemFace = nullptr;
       i.Data()->mFamilyName = NS_LITERAL_CSTRING("");
     }
     mFontEntries.Clear();
     mShmemCharMaps.Clear();
     bool oldSharedList = mSharedFontList != nullptr;
--- a/gfx/thebes/gfxPlatformGtk.cpp
+++ b/gfx/thebes/gfxPlatformGtk.cpp
@@ -13,21 +13,21 @@
 #include "nsUnicodeProperties.h"
 #include "gfx2DGlue.h"
 #include "gfxFcPlatformFontList.h"
 #include "gfxConfig.h"
 #include "gfxContext.h"
 #include "gfxUserFontSet.h"
 #include "gfxUtils.h"
 #include "gfxFT2FontBase.h"
-#include "gfxPrefs.h"
 #include "gfxTextRun.h"
 #include "VsyncSource.h"
 #include "mozilla/Atomics.h"
 #include "mozilla/Monitor.h"
+#include "mozilla/StaticPrefs.h"
 #include "base/task.h"
 #include "base/thread.h"
 #include "base/message_loop.h"
 #include "mozilla/FontPropertyTypes.h"
 #include "mozilla/gfx/Logging.h"
 
 #include "mozilla/gfx/2D.h"
 
@@ -286,17 +286,17 @@ double gfxPlatformGtk::GetFontScaleFacto
   if (dpi < 168) {
     return 1.5;
   }
   return round(dpi / 96.0);
 }
 
 bool gfxPlatformGtk::UseImageOffscreenSurfaces() {
   return GetDefaultContentBackend() != mozilla::gfx::BackendType::CAIRO ||
-         gfxPrefs::UseImageOffscreenSurfaces();
+         StaticPrefs::UseImageOffscreenSurfaces();
 }
 
 gfxImageFormat gfxPlatformGtk::GetOffscreenFormat() {
   // Make sure there is a screen
   GdkScreen* screen = gdk_screen_get_default();
   if (screen && gdk_visual_get_depth(gdk_visual_get_system()) == 16) {
     return SurfaceFormat::R5G6B5_UINT16;
   }
--- a/gfx/thebes/gfxPrefs.h
+++ b/gfx/thebes/gfxPrefs.h
@@ -284,169 +284,21 @@ class gfxPrefs final {
   };
 
   // clang-format off
 
   // This is where DECL_GFX_PREF for each of the preferences should go.  We
   // will keep these in an alphabetical order to make it easier to see if a
   // method accessing a pref already exists. Just add yours in the list.
 
-  // The apz prefs are explained in AsyncPanZoomController.cpp
-  DECL_GFX_PREF(Once, "apz.fling_curve_function_x1",           APZCurveFunctionX1, float, 0.0f);
-  DECL_GFX_PREF(Once, "apz.fling_curve_function_x2",           APZCurveFunctionX2, float, 1.0f);
-  DECL_GFX_PREF(Once, "apz.fling_curve_function_y1",           APZCurveFunctionY1, float, 0.0f);
-  DECL_GFX_PREF(Once, "apz.fling_curve_function_y2",           APZCurveFunctionY2, float, 1.0f);
-  DECL_GFX_PREF(Once, "apz.keyboard.enabled",                  APZKeyboardEnabled, bool, false);
-  DECL_GFX_PREF(Once, "apz.max_velocity_queue_size",           APZMaxVelocityQueueSize, uint32_t, 5);
-  DECL_GFX_PREF(Once, "apz.pinch_lock.buffer_max_age",         APZPinchLockBufferMaxAge, int32_t, 50);
-
-  DECL_GFX_PREF(Once, "dom.vr.enabled",                        VREnabled, bool, false);
-  DECL_GFX_PREF(Once, "dom.vr.external.enabled",               VRExternalEnabled, bool, false);
-  DECL_GFX_PREF(Once, "dom.vr.oculus.enabled",                 VROculusEnabled, bool, true);
-  DECL_GFX_PREF(Once, "dom.vr.openvr.enabled",                 VROpenVREnabled, bool, false);
-  DECL_GFX_PREF(Once, "dom.vr.openvr.action_input",            VROpenVRActionInputEnabled, bool, true);
-  DECL_GFX_PREF(Once, "dom.vr.osvr.enabled",                   VROSVREnabled, bool, false);
-  DECL_GFX_PREF(Once, "dom.vr.process.enabled",                VRProcessEnabled, bool, false);
-  DECL_GFX_PREF(Once, "dom.vr.process.startup_timeout_ms",     VRProcessTimeoutMs, int32_t, 5000);
-  DECL_GFX_PREF(Once, "dom.vr.service.enabled",                VRServiceEnabled, bool, true);
-
-  DECL_GFX_PREF(Once, "gfx.android.rgb16.force",               AndroidRGB16Force, bool, false);
-  DECL_GFX_PREF(Once, "gfx.apitrace.enabled",                  UseApitrace, bool, false);
-#if defined(RELEASE_OR_BETA)
-  // "Skip" means this is locked to the default value in beta and release.
-  DECL_GFX_PREF(Skip, "gfx.blocklist.all",                     BlocklistAll, int32_t, 0);
-#else
-  DECL_GFX_PREF(Once, "gfx.blocklist.all",                     BlocklistAll, int32_t, 0);
-#endif
-  // Size in megabytes
-  DECL_GFX_PREF(Once, "gfx.content.skia-font-cache-size",      SkiaContentFontCacheSize, int32_t, 5);
-  DECL_GFX_PREF(Once, "gfx.device-reset.limit",                DeviceResetLimitCount, int32_t, 10);
-  DECL_GFX_PREF(Once, "gfx.device-reset.threshold-ms",         DeviceResetThresholdMilliseconds, int32_t, -1);
-  DECL_GFX_PREF(Once, "gfx.direct2d.disabled",                 Direct2DDisabled, bool, false);
-  DECL_GFX_PREF(Once, "gfx.direct2d.force-enabled",            Direct2DForceEnabled, bool, false);
-  DECL_GFX_PREF(Once, "gfx.direct3d11.enable-debug-layer",     Direct3D11EnableDebugLayer, bool, false);
-  DECL_GFX_PREF(Once, "gfx.direct3d11.break-on-error",         Direct3D11BreakOnError, bool, false);
-  DECL_GFX_PREF(Once, "gfx.direct3d11.sleep-on-create-device", Direct3D11SleepOnCreateDevice, int32_t, 0);
-  DECL_GFX_PREF(Once, "gfx.e10s.hide-plugins-for-scroll",      HidePluginsForScroll, bool, true);
-  DECL_GFX_PREF(Once, "gfx.e10s.font-list.shared",             SharedFontList, bool, false);
   // Note that        "gfx.logging.level" is defined in Logging.h.
   DECL_GFX_PREF(Live, "gfx.logging.level",                     GfxLoggingLevel, int32_t, mozilla::gfx::LOG_DEFAULT);
-  DECL_GFX_PREF(Once, "gfx.logging.crash.length",              GfxLoggingCrashLength, uint32_t, 16);
-  // The maximums here are quite conservative, we can tighten them if problems show up.
-  DECL_GFX_PREF(Once, "gfx.logging.texture-usage.enabled",     GfxLoggingTextureUsageEnabled, bool, false);
-  DECL_GFX_PREF(Once, "gfx.logging.peak-texture-usage.enabled",GfxLoggingPeakTextureUsageEnabled, bool, false);
-  DECL_GFX_PREF(Once, "gfx.logging.slow-frames.enabled",       LoggingSlowFramesEnabled, bool, false);
-  // Use gfxPlatform::MaxAllocSize instead of the pref directly
-  DECL_GFX_PREF(Once, "gfx.max-alloc-size",                    MaxAllocSizeDoNotUseDirectly, int32_t, (int32_t)500000000);
-  // Use gfxPlatform::MaxTextureSize instead of the pref directly
-  DECL_GFX_PREF(Once, "gfx.max-texture-size",                  MaxTextureSizeDoNotUseDirectly, int32_t, (int32_t)32767);
-  DECL_GFX_PREF(Once, "gfx.text.disable-aa",                   DisableAllTextAA, bool, false);
-
-  // Disable surface sharing due to issues with compatible FBConfigs on
-  // NVIDIA drivers as described in bug 1193015.
-  DECL_GFX_PREF(Once, "gfx.use-iosurface-textures",            UseIOSurfaceTextures, bool, false);
-  DECL_GFX_PREF(Once, "gfx.use-mutex-on-present",              UseMutexOnPresent, bool, false);
-  DECL_GFX_PREF(Once, "gfx.use-surfacetexture-textures",       UseSurfaceTextureTextures, bool, false);
-  DECL_GFX_PREF(Once, "gfx.allow-texture-direct-mapping",      AllowTextureDirectMapping, bool, true);
-  DECL_GFX_PREF(Once, "gfx.vsync.compositor.unobserve-count",  CompositorUnobserveCount, int32_t, 10);
-
-  DECL_GFX_PREF(Once, "gfx.webrender.all",                     WebRenderAll, bool, false);
-  DECL_GFX_PREF(Once, "gfx.webrender.all.qualified",           WebRenderAllQualified, bool, true);
-  DECL_GFX_PREF(Once,
-                "gfx.webrender.all.qualified.default",
-                WebRenderAllQualifiedDefault,
-                bool,
-                false);
-  DECL_GFX_PREF(Once, "gfx.webrender.enabled",                 WebRenderEnabledDoNotUseDirectly, bool, false);
-  DECL_GFX_PREF(Once, "gfx.webrender.force-disabled",          WebRenderForceDisabled, bool, false);
-  DECL_GFX_PREF(Once, "gfx.webrender.split-render-roots",      WebRenderSplitRenderRoots, bool, false);
-
-  // Use vsync events generated by hardware
-  DECL_GFX_PREF(Once, "gfx.work-around-driver-bugs",           WorkAroundDriverBugs, bool, true);
-
-  DECL_GFX_PREF(Once, "image.cache.size",                      ImageCacheSize, int32_t, 5*1024*1024);
-  DECL_GFX_PREF(Once, "image.cache.timeweight",                ImageCacheTimeWeight, int32_t, 500);
-  DECL_GFX_PREF(Once, "image.mem.decode_bytes_at_a_time",      ImageMemDecodeBytesAtATime, uint32_t, 200000);
-  DECL_GFX_PREF(Once, "image.mem.animated.discardable",        ImageMemAnimatedDiscardable, bool, false);
-  DECL_GFX_PREF(Once, "image.mem.surfacecache.discard_factor", ImageMemSurfaceCacheDiscardFactor, uint32_t, 1);
-  DECL_GFX_PREF(Once, "image.mem.surfacecache.max_size_kb",    ImageMemSurfaceCacheMaxSizeKB, uint32_t, 100 * 1024);
-  DECL_GFX_PREF(Once, "image.mem.surfacecache.min_expiration_ms", ImageMemSurfaceCacheMinExpirationMS, uint32_t, 60*1000);
-  DECL_GFX_PREF(Once, "image.mem.surfacecache.size_factor",    ImageMemSurfaceCacheSizeFactor, uint32_t, 64);
-  DECL_GFX_PREF(Once, "image.multithreaded_decoding.limit",    ImageMTDecodingLimit, int32_t, -1);
-  DECL_GFX_PREF(Once, "image.multithreaded_decoding.idle_timeout", ImageMTDecodingIdleTimeout, int32_t, -1);
-
-  DECL_GFX_PREF(Once, "layers.acceleration.disabled",          LayersAccelerationDisabledDoNotUseDirectly, bool, false);
-  // Instead, use gfxConfig::IsEnabled(Feature::HW_COMPOSITING).
-
-  DECL_GFX_PREF(Once, "layers.acceleration.force-enabled",     LayersAccelerationForceEnabledDoNotUseDirectly, bool, false);
-  DECL_GFX_PREF(Once, "layers.amd-switchable-gfx.enabled",     LayersAMDSwitchableGfxEnabled, bool, false);
-  DECL_GFX_PREF(Once, "layers.async-pan-zoom.enabled",         AsyncPanZoomEnabledDoNotUseDirectly, bool, true);
-  DECL_GFX_PREF(Once, "layers.bufferrotation.enabled",         BufferRotationEnabled, bool, true);
-#ifdef MOZ_GFX_OPTIMIZE_MOBILE
-  // If MOZ_GFX_OPTIMIZE_MOBILE is defined, we force component alpha off
-  // and ignore the preference.
-  DECL_GFX_PREF(Skip, "layers.componentalpha.enabled",         ComponentAlphaEnabled, bool, false);
-#else
-  // If MOZ_GFX_OPTIMIZE_MOBILE is not defined, we actually take the
-  // preference value, defaulting to true.
-  DECL_GFX_PREF(Once, "layers.componentalpha.enabled",         ComponentAlphaEnabled, bool, true);
-#endif
-  DECL_GFX_PREF(Once, "layers.d3d11.force-warp",               LayersD3D11ForceWARP, bool, false);
-
-  // 0 is "no change" for contrast, positive values increase it, negative values
-  // decrease it until we hit mid gray at -1 contrast, after that it gets weird.
-  DECL_GFX_PREF(Once, "layers.enable-tiles",                   LayersTilesEnabled, bool, false);
-  DECL_GFX_PREF(Once, "layers.enable-tiles-if-skia-pomtp",     LayersTilesEnabledIfSkiaPOMTP, bool, false);
-  DECL_GFX_PREF(Once, "layers.force-shmem-tiles",              ForceShmemTiles, bool, false);
-  DECL_GFX_PREF(Once, "layers.gpu-process.allow-software",     GPUProcessAllowSoftware, bool, false);
-  DECL_GFX_PREF(Once, "layers.gpu-process.enabled",            GPUProcessEnabled, bool, false);
-  DECL_GFX_PREF(Once, "layers.gpu-process.force-enabled",      GPUProcessForceEnabled, bool, false);
-  DECL_GFX_PREF(Once, "layers.gpu-process.ipc_reply_timeout_ms", GPUProcessIPCReplyTimeoutMs, int32_t, 10000);
-  // Note: This pref will only be used if it is less than layers.gpu-process.max_restarts.
-  DECL_GFX_PREF(Once, "layers.gpu-process.startup_timeout_ms", GPUProcessTimeoutMs, int32_t, 5000);
-  DECL_GFX_PREF(Once, "layers.mlgpu.enabled",                  AdvancedLayersEnabledDoNotUseDirectly, bool, false);
-  DECL_GFX_PREF(Once, "layers.mlgpu.enable-buffer-cache",      AdvancedLayersEnableBufferCache, bool, true);
-  DECL_GFX_PREF(Once, "layers.mlgpu.enable-buffer-sharing",    AdvancedLayersEnableBufferSharing, bool, true);
-  DECL_GFX_PREF(Once, "layers.mlgpu.enable-clear-view",        AdvancedLayersEnableClearView, bool, true);
-  DECL_GFX_PREF(Once, "layers.mlgpu.enable-cpu-occlusion",     AdvancedLayersEnableCPUOcclusion, bool, true);
-  DECL_GFX_PREF(Once, "layers.mlgpu.enable-depth-buffer",      AdvancedLayersEnableDepthBuffer, bool, false);
-  DECL_GFX_PREF(Once, "layers.mlgpu.enable-on-windows7",       AdvancedLayersEnableOnWindows7, bool, false);
-  DECL_GFX_PREF(Once, "layers.mlgpu.enable-container-resizing", AdvancedLayersEnableContainerResizing, bool, true);
-  DECL_GFX_PREF(Once, "layers.offmainthreadcomposition.force-disabled", LayersOffMainThreadCompositionForceDisabled, bool, false);
-  DECL_GFX_PREF(Once, "layers.omtp.capture-limit",             LayersOMTPCaptureLimit, uint32_t, 25 * 1024 * 1024);
-  DECL_GFX_PREF(Once, "layers.omtp.paint-workers",             LayersOMTPPaintWorkers, int32_t, 1);
-  DECL_GFX_PREF(Once, "layers.prefer-opengl",                  LayersPreferOpenGL, bool, false);
   DECL_GFX_PREF(Once, "layers.windowrecording.path",           LayersWindowRecordingPath, std::string, std::string());
 
-  // We allow for configurable and rectangular tile size to avoid wasting memory on devices whose
-  // screen size does not align nicely to the default tile size. Although layers can be any size,
-  // they are often the same size as the screen, especially for width.
-  DECL_GFX_PREF(Once, "layers.tile-width",                     LayersTileWidth, int32_t, 256);
-  DECL_GFX_PREF(Once, "layers.tile-height",                    LayersTileHeight, int32_t, 256);
-  DECL_GFX_PREF(Once, "layers.tile-initial-pool-size",         LayersTileInitialPoolSize, uint32_t, (uint32_t)50);
-  DECL_GFX_PREF(Once, "layers.tile-pool-unused-size",          LayersTilePoolUnusedSize, uint32_t, (uint32_t)10);
-  DECL_GFX_PREF(Once, "layers.tile-pool-shrink-timeout",       LayersTilePoolShrinkTimeout, uint32_t, (uint32_t)50);
-  DECL_GFX_PREF(Once, "layers.tile-pool-clear-timeout",        LayersTilePoolClearTimeout, uint32_t, (uint32_t)5000);
-  DECL_GFX_PREF(Once, "layers.tiles.adjust",                   LayersTilesAdjust, bool, true);
-  DECL_GFX_PREF(Once, "layers.tiles.edge-padding",             TileEdgePaddingEnabled, bool, false);
-  DECL_GFX_PREF(Once, "layers.uniformity-info",                UniformityInfo, bool, false);
-  DECL_GFX_PREF(Once, "layers.use-image-offscreen-surfaces",   UseImageOffscreenSurfaces, bool, true);
-
   DECL_GFX_PREF(Live, "layout.frame_rate",                     LayoutFrameRate, int32_t, -1);
-  DECL_GFX_PREF(Once, "layout.paint_rects_separately",         LayoutPaintRectsSeparately, bool, true);
-
-  DECL_GFX_PREF(Once, "media.hardware-video-decoding.force-enabled",
-                                                               HardwareVideoDecodingForceEnabled, bool, false);
-#ifdef XP_WIN
-  DECL_GFX_PREF(Once, "media.wmf.use-sync-texture", PDMWMFUseSyncTexture, bool, true);
-  DECL_GFX_PREF(Once, "media.wmf.vp9.enabled", MediaWmfVp9Enabled, bool, true);
-#endif
-
-  DECL_GFX_PREF(Once, "slider.snapMultiplier",                 SliderSnapMultiplier, int32_t, 0);
-  DECL_GFX_PREF(Once, "webgl.force-layers-readback",           WebGLForceLayersReadback, bool, false);
 
   // WARNING:
   // Please make sure that you've added your new preference to the list above
   // in alphabetical order.
   // Please do not just append it to the end of the list.
 
   // clang-format on
 
--- a/gfx/thebes/gfxUtils.cpp
+++ b/gfx/thebes/gfxUtils.cpp
@@ -24,16 +24,17 @@
 #include "mozilla/gfx/Swizzle.h"
 #include "mozilla/gfx/gfxVars.h"
 #include "mozilla/image/nsBMPEncoder.h"
 #include "mozilla/image/nsICOEncoder.h"
 #include "mozilla/image/nsJPEGEncoder.h"
 #include "mozilla/image/nsPNGEncoder.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/RefPtr.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/UniquePtrExtensions.h"
 #include "mozilla/Unused.h"
 #include "mozilla/Vector.h"
 #include "mozilla/webrender/webrender_ffi.h"
 #include "nsAppRunner.h"
 #include "nsComponentManagerUtils.h"
 #include "nsIClipboardHelper.h"
 #include "nsIFile.h"
@@ -41,17 +42,16 @@
 #include "nsMimeTypes.h"
 #include "nsPresContext.h"
 #include "nsRegion.h"
 #include "nsServiceManagerUtils.h"
 #include "GeckoProfiler.h"
 #include "ImageContainer.h"
 #include "ImageRegion.h"
 #include "gfx2DGlue.h"
-#include "gfxPrefs.h"
 
 #ifdef XP_WIN
 #  include "gfxWindowsPlatform.h"
 #endif
 
 using namespace mozilla;
 using namespace mozilla::image;
 using namespace mozilla::layers;
@@ -1464,70 +1464,71 @@ bool gfxUtils::DumpDisplayList() {
   return StaticPrefs::LayoutDumpDisplayList() ||
          (StaticPrefs::LayoutDumpDisplayListParent() &&
           XRE_IsParentProcess()) ||
          (StaticPrefs::LayoutDumpDisplayListContent() &&
           XRE_IsContentProcess());
 }
 
 wr::RenderRoot gfxUtils::GetContentRenderRoot() {
-  if (gfx::gfxVars::UseWebRender() && gfxPrefs::WebRenderSplitRenderRoots()) {
+  if (gfx::gfxVars::UseWebRender() &&
+      StaticPrefs::WebRenderSplitRenderRoots()) {
     return wr::RenderRoot::Content;
   }
   return wr::RenderRoot::Default;
 }
 
 Maybe<wr::RenderRoot> gfxUtils::GetRenderRootForFrame(const nsIFrame* aFrame) {
-  if (!gfxVars::UseWebRender() || !gfxPrefs::WebRenderSplitRenderRoots()) {
+  if (!gfxVars::UseWebRender() || !StaticPrefs::WebRenderSplitRenderRoots()) {
     return Nothing();
   }
   if (!aFrame->GetContent()) {
     return Nothing();
   }
   return gfxUtils::GetRenderRootForElement(aFrame->GetContent()->AsElement());
 }
 
 Maybe<wr::RenderRoot> gfxUtils::GetRenderRootForElement(
     const dom::Element* aElement) {
   if (!aElement) {
     return Nothing();
   }
-  if (!gfxVars::UseWebRender() || !gfxPrefs::WebRenderSplitRenderRoots()) {
+  if (!gfxVars::UseWebRender() || !StaticPrefs::WebRenderSplitRenderRoots()) {
     return Nothing();
   }
   if (!aElement->IsXULElement()) {
     return Nothing();
   }
   if (aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::renderroot,
                             NS_LITERAL_STRING("content"), eCaseMatters)) {
     return Some(wr::RenderRoot::Content);
   }
   return Nothing();
 }
 
 wr::RenderRoot gfxUtils::RecursivelyGetRenderRootForFrame(
     const nsIFrame* aFrame) {
-  if (!gfxVars::UseWebRender() || !gfxPrefs::WebRenderSplitRenderRoots()) {
+  if (!gfxVars::UseWebRender() || !StaticPrefs::WebRenderSplitRenderRoots()) {
     return wr::RenderRoot::Default;
   }
 
   for (const nsIFrame* current = aFrame; current;
        current = current->GetParent()) {
     auto renderRoot = gfxUtils::GetRenderRootForFrame(current);
     if (renderRoot) {
       return *renderRoot;
     }
   }
 
   return wr::RenderRoot::Default;
 }
 
 wr::RenderRoot gfxUtils::RecursivelyGetRenderRootForElement(
     const dom::Element* aElement) {
-  if (!gfxVars::UseWebRender() || !gfxPrefs::WebRenderSplitRenderRoots()) {
+  if (!gfxVars::UseWebRender() || !StaticPrefs::WebRenderSplitRenderRoots()) {
     return wr::RenderRoot::Default;
   }
 
   for (const dom::Element* current = aElement; current;
        current = current->GetParentElement()) {
     auto renderRoot = gfxUtils::GetRenderRootForElement(current);
     if (renderRoot) {
       return *renderRoot;
--- a/gfx/thebes/gfxWindowsPlatform.cpp
+++ b/gfx/thebes/gfxWindowsPlatform.cpp
@@ -69,17 +69,17 @@
 #include <d3d11.h>
 #include <d2d1_1.h>
 
 #include "nsIMemoryReporter.h"
 #include <winternl.h>
 #include "d3dkmtQueryStatistics.h"
 
 #include "base/thread.h"
-#include "gfxPrefs.h"
+#include "mozilla/StaticPrefs.h"
 #include "gfxConfig.h"
 #include "VsyncSource.h"
 #include "DriverCrashGuard.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/gfx/DeviceManagerDx.h"
 #include "mozilla/layers/DeviceAttachmentsD3D11.h"
 #include "D3D11Checks.h"
 
@@ -1362,41 +1362,41 @@ void gfxWindowsPlatform::InitializeD3D11
   nsCString message;
   nsCString failureId;
   if (!gfxPlatform::IsGfxInfoStatusOkay(nsIGfxInfo::FEATURE_DIRECT3D_11_LAYERS,
                                         &message, failureId)) {
     d3d11.Disable(FeatureStatus::Blacklisted, message.get(), failureId);
   }
 
   // Check if the user really, really wants WARP.
-  if (gfxPrefs::LayersD3D11ForceWARP()) {
+  if (StaticPrefs::LayersD3D11ForceWARP()) {
     // Force D3D11 on even if we disabled it.
     d3d11.UserForceEnable("User force-enabled WARP");
   }
 
   InitializeAdvancedLayersConfig();
 }
 
 /* static */
 void gfxWindowsPlatform::InitializeAdvancedLayersConfig() {
   // Only enable Advanced Layers if D3D11 succeeded.
   if (!gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING)) {
     return;
   }
 
   FeatureState& al = gfxConfig::GetFeature(Feature::ADVANCED_LAYERS);
   al.SetDefaultFromPref(
-      gfxPrefs::GetAdvancedLayersEnabledDoNotUseDirectlyPrefName(),
+      StaticPrefs::GetAdvancedLayersEnabledDoNotUseDirectlyPrefName(),
       true /* aIsEnablePref */,
-      gfxPrefs::GetAdvancedLayersEnabledDoNotUseDirectlyPrefDefault());
+      StaticPrefs::GetAdvancedLayersEnabledDoNotUseDirectlyPrefDefault());
 
   // Windows 7 has an extra pref since it uses totally different buffer paths
   // that haven't been performance tested yet.
   if (al.IsEnabled() && !IsWin8OrLater()) {
-    if (gfxPrefs::AdvancedLayersEnableOnWindows7()) {
+    if (StaticPrefs::AdvancedLayersEnableOnWindows7()) {
       al.UserEnable("Enabled for Windows 7 via user-preference");
     } else {
       al.Disable(FeatureStatus::Disabled,
                  "Advanced Layers is disabled on Windows 7 by default",
                  NS_LITERAL_CSTRING("FEATURE_FAILURE_DISABLED_ON_WIN7"));
     }
   }
 
@@ -1538,27 +1538,27 @@ void gfxWindowsPlatform::InitializeD2DCo
 
   if (!gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING)) {
     d2d1.DisableByDefault(FeatureStatus::Unavailable,
                           "Direct2D requires Direct3D 11 compositing",
                           NS_LITERAL_CSTRING("FEATURE_FAILURE_D2D_D3D11_COMP"));
     return;
   }
 
-  d2d1.SetDefaultFromPref(gfxPrefs::GetDirect2DDisabledPrefName(), false,
-                          gfxPrefs::GetDirect2DDisabledPrefDefault());
+  d2d1.SetDefaultFromPref(StaticPrefs::GetDirect2DDisabledPrefName(), false,
+                          StaticPrefs::GetDirect2DDisabledPrefDefault());
 
   nsCString message;
   nsCString failureId;
   if (!gfxPlatform::IsGfxInfoStatusOkay(nsIGfxInfo::FEATURE_DIRECT2D, &message,
                                         failureId)) {
     d2d1.Disable(FeatureStatus::Blacklisted, message.get(), failureId);
   }
 
-  if (!d2d1.IsEnabled() && gfxPrefs::Direct2DForceEnabled()) {
+  if (!d2d1.IsEnabled() && StaticPrefs::Direct2DForceEnabled()) {
     d2d1.UserForceEnable("Force-enabled via user-preference");
   }
 }
 
 void gfxWindowsPlatform::InitializeD2D() {
   ScopedGfxFeatureReporter d2d1_1("D2D1.1");
 
   FeatureState& d2d1 = gfxConfig::GetFeature(Feature::DIRECT2D);
@@ -1632,17 +1632,17 @@ bool gfxWindowsPlatform::InitGPUProcessS
                                         &message, failureId)) {
     gpuProc.Disable(FeatureStatus::Blacklisted, message.get(), failureId);
     return false;
   }
 
   if (!gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING)) {
     // Don't use the GPU process if not using D3D11, unless software
     // compositor is allowed
-    if (gfxPrefs::GPUProcessAllowSoftware()) {
+    if (StaticPrefs::GPUProcessAllowSoftware()) {
       return gpuProc.IsEnabled();
     }
     gpuProc.Disable(FeatureStatus::Unavailable,
                     "Not using GPU Process since D3D11 is unavailable",
                     NS_LITERAL_CSTRING("FEATURE_FAILURE_NO_D3D11"));
   } else if (!IsWin7SP1OrLater()) {
     // On Windows 7 Pre-SP1, DXGI 1.2 is not available and remote presentation
     // for D3D11 will not work. Rather than take a regression we revert back
@@ -1939,17 +1939,17 @@ gfxWindowsPlatform::CreateHardwareVsyncS
 
   RefPtr<VsyncSource> d3dVsyncSource = new D3DVsyncSource();
   return d3dVsyncSource.forget();
 }
 
 void gfxWindowsPlatform::GetAcceleratedCompositorBackends(
     nsTArray<LayersBackend>& aBackends) {
   if (gfxConfig::IsEnabled(Feature::OPENGL_COMPOSITING) &&
-      gfxPrefs::LayersPreferOpenGL()) {
+      StaticPrefs::LayersPreferOpenGL()) {
     aBackends.AppendElement(LayersBackend::LAYERS_OPENGL);
   }
 
   if (gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING)) {
     aBackends.AppendElement(LayersBackend::LAYERS_D3D11);
   }
 }
 
--- a/gfx/vr/VRManager.cpp
+++ b/gfx/vr/VRManager.cpp
@@ -8,19 +8,19 @@
 #include "VRManagerParent.h"
 #include "VRThread.h"
 #include "gfxVR.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/dom/VRDisplay.h"
 #include "mozilla/dom/GamepadEventTypes.h"
 #include "mozilla/layers/TextureHost.h"
 #include "mozilla/layers/CompositorThread.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/Unused.h"
 
-#include "gfxPrefs.h"
 #include "gfxVR.h"
 #include "gfxVRExternal.h"
 
 #include "gfxVRPuppet.h"
 #include "ipc/VRLayerParent.h"
 #if !defined(MOZ_WIDGET_ANDROID)
 #  include "service/VRService.h"
 #  include "service/VRServiceManager.h"
@@ -74,17 +74,17 @@ VRManager::VRManager()
   MOZ_COUNT_CTOR(VRManager);
   MOZ_ASSERT(sVRManagerSingleton == nullptr);
 
   RefPtr<VRSystemManager> mgr;
 
 #if !defined(MOZ_WIDGET_ANDROID)
   // The VR Service accesses all hardware from a separate process
   // and replaces the other VRSystemManager when enabled.
-  if (!gfxPrefs::VRProcessEnabled() || !XRE_IsGPUProcess()) {
+  if (!StaticPrefs::VRProcessEnabled() || !XRE_IsGPUProcess()) {
     VRServiceManager::Get().CreateService();
   }
   if (VRServiceManager::Get().IsServiceValid()) {
     mExternalManager =
         VRSystemManagerExternal::Create(VRServiceManager::Get().GetAPIShmem());
   }
   if (mExternalManager) {
     mManagers.AppendElement(mExternalManager);
@@ -95,17 +95,17 @@ VRManager::VRManager()
     mExternalManager = VRSystemManagerExternal::Create();
     if (mExternalManager) {
       mManagers.AppendElement(mExternalManager);
     }
   }
 
   // Enable gamepad extensions while VR is enabled.
   // Preference only can be set at the Parent process.
-  if (XRE_IsParentProcess() && gfxPrefs::VREnabled()) {
+  if (XRE_IsParentProcess() && StaticPrefs::VREnabled()) {
     Preferences::SetBool("dom.gamepad.extensions.enabled", true);
   }
 }
 
 VRManager::~VRManager() {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!mInitialized);
 #if !defined(MOZ_WIDGET_ANDROID)
@@ -139,17 +139,18 @@ void VRManager::Shutdown() {
     mManagers[i]->Shutdown();
   }
 #if !defined(MOZ_WIDGET_ANDROID)
   if (VRServiceManager::Get().IsServiceValid()) {
     VRServiceManager::Get().Stop();
   }
   // XRE_IsGPUProcess() is helping us to check some platforms like
   // Win 7 try which are not using GPU process but VR process is enabled.
-  if (XRE_IsGPUProcess() && gfxPrefs::VRProcessEnabled() && mVRServiceStarted) {
+  if (XRE_IsGPUProcess() && StaticPrefs::VRProcessEnabled() &&
+      mVRServiceStarted) {
     RefPtr<Runnable> task = NS_NewRunnableFunction(
         "VRServiceManager::ShutdownVRProcess",
         []() -> void { VRServiceManager::Get().ShutdownVRProcess(); });
     NS_DispatchToMainThread(task.forget());
   }
 #endif
   mVRServiceStarted = false;
 }
@@ -450,17 +451,17 @@ void VRManager::EnumerateVRDisplays() {
    * We don't want to start this until we will
    * actualy enumerate, to avoid continuously
    * re-launching the thread/process when
    * no hardware is found or a VR software update
    * is in progress
    */
 #if !defined(MOZ_WIDGET_ANDROID)
   if (!mVRServiceStarted) {
-    if (XRE_IsGPUProcess() && gfxPrefs::VRProcessEnabled()) {
+    if (XRE_IsGPUProcess() && StaticPrefs::VRProcessEnabled()) {
       VRServiceManager::Get().CreateVRProcess();
       mVRServiceStarted = true;
     } else {
       if (VRServiceManager::Get().IsServiceValid()) {
         VRServiceManager::Get().Start();
         mVRServiceStarted = true;
       }
     }
--- a/gfx/vr/gfxVRExternal.cpp
+++ b/gfx/vr/gfxVRExternal.cpp
@@ -3,18 +3,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include <math.h>
 
 #include "prlink.h"
 #include "prenv.h"
-#include "gfxPrefs.h"
 #include "mozilla/Preferences.h"
+#include "mozilla/StaticPrefs.h"
 
 #include "mozilla/gfx/Quaternion.h"
 
 #ifdef XP_WIN
 #  include "CompositorD3D11.h"
 #  include "TextureD3D11.h"
 static const char* kShmemName = "moz.gecko.vr_ext.0.0.1";
 #elif defined(XP_MACOSX)
@@ -521,17 +521,17 @@ void VRSystemManagerExternal::OpenShmem(
     // TODO - Implement logging
     mExternalShmem = NULL;
     CloseShmem();
     return;
   }
 
 #elif defined(XP_WIN)
   if (mShmemFile == NULL) {
-    if (gfxPrefs::VRProcessEnabled()) {
+    if (StaticPrefs::VRProcessEnabled()) {
       mShmemFile =
           CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0,
                              sizeof(VRExternalShmem), kShmemName);
       MOZ_ASSERT(GetLastError() == 0 || GetLastError() == ERROR_ALREADY_EXISTS);
       MOZ_ASSERT(mShmemFile);
     } else {
       mShmemFile = OpenFileMappingA(FILE_MAP_ALL_ACCESS, FALSE, kShmemName);
     }
@@ -619,21 +619,21 @@ void VRSystemManagerExternal::CloseShmem
 #endif
 }
 
 /*static*/
 already_AddRefed<VRSystemManagerExternal> VRSystemManagerExternal::Create(
     VRExternalShmem* aAPIShmem /* = nullptr*/) {
   MOZ_ASSERT(NS_IsMainThread());
 
-  if (!gfxPrefs::VREnabled()) {
+  if (!StaticPrefs::VREnabled()) {
     return nullptr;
   }
 
-  if ((!gfxPrefs::VRExternalEnabled() && aAPIShmem == nullptr)
+  if ((!StaticPrefs::VRExternalEnabled() && aAPIShmem == nullptr)
 #if defined(XP_WIN)
       || !XRE_IsGPUProcess()
 #endif
   ) {
     return nullptr;
   }
 
   RefPtr<VRSystemManagerExternal> manager =
--- a/gfx/vr/gfxVRPuppet.cpp
+++ b/gfx/vr/gfxVRPuppet.cpp
@@ -11,17 +11,16 @@
 #elif defined(XP_MACOSX)
 #  include "mozilla/gfx/MacIOSurface.h"
 #endif
 
 #include "mozilla/Base64.h"
 #include "mozilla/StaticPrefs.h"
 #include "mozilla/gfx/DataSurfaceHelpers.h"
 #include "mozilla/layers/CompositorThread.h"  // for CompositorThreadHolder
-#include "gfxPrefs.h"
 #include "gfxUtils.h"
 #include "gfxVRPuppet.h"
 #include "VRManager.h"
 #include "VRThread.h"
 
 #include "mozilla/dom/GamepadEventTypes.h"
 #include "mozilla/dom/GamepadBinding.h"
 
@@ -636,17 +635,17 @@ void VRControllerPuppet::SetAxisMove(uin
 
 VRSystemManagerPuppet::VRSystemManagerPuppet()
     : mPuppetDisplayCount(0),
       mPuppetDisplayInfo{},
       mPuppetDisplaySensorState{} {}
 
 /*static*/
 already_AddRefed<VRSystemManagerPuppet> VRSystemManagerPuppet::Create() {
-  if (!gfxPrefs::VREnabled() || !StaticPrefs::VRPuppetEnabled()) {
+  if (!StaticPrefs::VREnabled() || !StaticPrefs::VRPuppetEnabled()) {
     return nullptr;
   }
 
   RefPtr<VRSystemManagerPuppet> manager = new VRSystemManagerPuppet();
   return manager.forget();
 }
 
 void VRSystemManagerPuppet::Destroy() { Shutdown(); }
--- a/gfx/vr/ipc/VRProcessManager.cpp
+++ b/gfx/vr/ipc/VRProcessManager.cpp
@@ -64,17 +64,17 @@ void VRProcessManager::LaunchVRProcess()
   // acquire the IPDL actor.
   mProcess = new VRProcessParent(this);
   if (!mProcess->Launch()) {
     DisableVRProcess("Failed to launch VR process");
   }
 }
 
 void VRProcessManager::DisableVRProcess(const char* aMessage) {
-  if (!gfxPrefs::VRProcessEnabled()) {
+  if (!StaticPrefs::VRProcessEnabled()) {
     return;
   }
 
   DestroyProcess();
 }
 
 void VRProcessManager::DestroyProcess() {
   if (!mProcess) {
--- a/gfx/vr/ipc/VRProcessParent.cpp
+++ b/gfx/vr/ipc/VRProcessParent.cpp
@@ -6,16 +6,17 @@
 
 #include "VRProcessParent.h"
 #include "VRGPUChild.h"
 #include "VRProcessManager.h"
 #include "mozilla/gfx/GPUProcessManager.h"
 #include "mozilla/gfx/GPUChild.h"
 #include "mozilla/ipc/ProtocolTypes.h"
 #include "mozilla/ipc/ProtocolUtils.h"  // for IToplevelProtocol
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/TimeStamp.h"          // for TimeStamp
 #include "mozilla/Unused.h"
 #include "ProcessUtils.h"
 #include "VRChild.h"
 #include "VRManager.h"
 #include "VRThread.h"
 #include "gfxVRPuppet.h"
 
@@ -76,17 +77,17 @@ bool VRProcessParent::Launch() {
   return true;
 }
 
 bool VRProcessParent::WaitForLaunch() {
   if (mLaunchPhase == LaunchPhase::Complete) {
     return !!mVRChild;
   }
 
-  int32_t timeoutMs = gfxPrefs::VRProcessTimeoutMs();
+  int32_t timeoutMs = StaticPrefs::VRProcessTimeoutMs();
 
   // If one of the following environment variables are set we can effectively
   // ignore the timeout - as we can guarantee the compositor process will be
   // terminated
   if (PR_GetEnv("MOZ_DEBUG_CHILD_PROCESS") ||
       PR_GetEnv("MOZ_DEBUG_CHILD_PAUSE")) {
     timeoutMs = 0;
   }
--- a/gfx/vr/service/OSVRSession.cpp
+++ b/gfx/vr/service/OSVRSession.cpp
@@ -1,19 +1,19 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "OSVRSession.h"
 #include "prenv.h"
-#include "gfxPrefs.h"
 #include "nsString.h"
 #include "mozilla/Preferences.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/SharedLibrary.h"
 #include "mozilla/gfx/Quaternion.h"
 
 #if defined(XP_WIN)
 #  include <d3d11.h>
 #  include "mozilla/gfx/DeviceManagerDx.h"
 #endif  // defined(XP_WIN)
 
@@ -204,17 +204,17 @@ OSVRSession::OSVRSession()
       mDisplayConfigInitialized(false),
       mInterfaceInitialized(false),
       m_ctx(nullptr),
       m_iface(nullptr),
       m_display(nullptr) {}
 OSVRSession::~OSVRSession() { Shutdown(); }
 
 bool OSVRSession::Initialize(mozilla::gfx::VRSystemState& aSystemState) {
-  if (!gfxPrefs::VREnabled() || !gfxPrefs::VROSVREnabled()) {
+  if (!StaticPrefs::VREnabled() || !StaticPrefs::VROSVREnabled()) {
     return false;
   }
   if (mOSVRInitialized) {
     return true;
   }
   if (!LoadOSVRRuntime()) {
     return false;
   }
--- a/gfx/vr/service/OculusSession.cpp
+++ b/gfx/vr/service/OculusSession.cpp
@@ -6,17 +6,16 @@
 
 #ifndef XP_WIN
 #  error "Oculus support only available for Windows"
 #endif
 
 #include <math.h>
 #include <d3d11.h>
 
-#include "gfxPrefs.h"
 #include "mozilla/StaticPrefs.h"
 #include "mozilla/dom/GamepadEventTypes.h"
 #include "mozilla/dom/GamepadBinding.h"
 #include "mozilla/gfx/DeviceManagerDx.h"
 #include "mozilla/SharedLibrary.h"
 #include "OculusSession.h"
 
 /** XXX The DX11 objects and quad blitting could be encapsulated
@@ -202,17 +201,17 @@ OculusSession::OculusSession()
       mInputLayout(nullptr),
       mRemainingVibrateTime{},
       mHapticPulseIntensity{},
       mIsPresenting(false) {}
 
 OculusSession::~OculusSession() { Shutdown(); }
 
 bool OculusSession::Initialize(mozilla::gfx::VRSystemState& aSystemState) {
-  if (!gfxPrefs::VREnabled() || !gfxPrefs::VROculusEnabled()) {
+  if (!StaticPrefs::VREnabled() || !StaticPrefs::VROculusEnabled()) {
     return false;
   }
 
   if (!CreateD3DObjects()) {
     return false;
   }
   if (!CreateShaders()) {
     return false;
--- a/gfx/vr/service/OpenVRSession.cpp
+++ b/gfx/vr/service/OpenVRSession.cpp
@@ -5,17 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include <fstream>
 #include "mozilla/JSONWriter.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "nsString.h"
 
 #include "OpenVRSession.h"
-#include "gfxPrefs.h"
+#include "mozilla/StaticPrefs.h"
 
 #if defined(XP_WIN)
 #  include <d3d11.h>
 #  include "mozilla/gfx/DeviceManagerDx.h"
 #elif defined(XP_MACOSX)
 #  include "mozilla/gfx/MacIOSurface.h"
 #endif
 
@@ -245,17 +245,17 @@ OpenVRSession::OpenVRSession()
 }
 
 OpenVRSession::~OpenVRSession() {
   mActionsetFirefox = ::vr::k_ulInvalidActionSetHandle;
   Shutdown();
 }
 
 bool OpenVRSession::Initialize(mozilla::gfx::VRSystemState& aSystemState) {
-  if (!gfxPrefs::VREnabled() || !gfxPrefs::VROpenVREnabled()) {
+  if (!StaticPrefs::VREnabled() || !StaticPrefs::VROpenVREnabled()) {
     return false;
   }
   if (mVRSystem != nullptr) {
     // Already initialized
     return true;
   }
   if (!::vr::VR_IsRuntimeInstalled()) {
     return false;
@@ -301,17 +301,17 @@ bool OpenVRSession::Initialize(mozilla::
   // Configure coordinate system
   mVRCompositor->SetTrackingSpace(::vr::TrackingUniverseSeated);
 
   if (!InitState(aSystemState)) {
     Shutdown();
     return false;
   }
 
-  if (gfxPrefs::VROpenVRActionInputEnabled() && !SetupContollerActions()) {
+  if (StaticPrefs::VROpenVRActionInputEnabled() && !SetupContollerActions()) {
     return false;
   }
 
   NS_DispatchToMainThread(NS_NewRunnableFunction(
       "OpenVRSession::StartHapticThread", [this]() { StartHapticThread(); }));
 
   // Succeeded
   return true;
@@ -321,17 +321,17 @@ bool OpenVRSession::SetupContollerAction
   // Check if this device binding file has been created.
   // If it didn't exist yet, create a new temp file.
   nsCString controllerAction;
   nsCString viveManifest;
   nsCString WMRManifest;
   nsCString knucklesManifest;
 
   // Getting / Generating manifest file paths.
-  if (gfxPrefs::VRProcessEnabled()) {
+  if (StaticPrefs::VRProcessEnabled()) {
     VRParent* vrParent = VRProcessChild::GetVRParent();
     nsCString output;
 
     if (vrParent->GetOpenVRControllerActionPath(&output)) {
       controllerAction = output;
     }
 
     if (vrParent->GetOpenVRControllerManifestPath(OpenVRControllerType::Vive,
@@ -764,17 +764,17 @@ bool OpenVRSession::SetupContollerAction
       actionfile.close();
     }
   }
 
   vr::VRInput()->SetActionManifestPath(controllerAction.BeginReading());
   // End of setup controller actions.
 
   // Notify the parent process these manifest files are already been recorded.
-  if (gfxPrefs::VRProcessEnabled()) {
+  if (StaticPrefs::VRProcessEnabled()) {
     NS_DispatchToMainThread(NS_NewRunnableFunction(
         "SendOpenVRControllerActionPathToParent",
         [controllerAction, viveManifest, WMRManifest, knucklesManifest]() {
           VRParent* vrParent = VRProcessChild::GetVRParent();
           Unused << vrParent->SendOpenVRControllerActionPathToParent(
               controllerAction);
           Unused << vrParent->SendOpenVRControllerManifestPathToParent(
               OpenVRControllerType::Vive, viveManifest);
@@ -1930,17 +1930,17 @@ void OpenVRSession::GetControllerDeviceI
       break;
   }
 }
 
 void OpenVRSession::StartFrame(mozilla::gfx::VRSystemState& aSystemState) {
   UpdateHeadsetPose(aSystemState);
   UpdateEyeParameters(aSystemState);
 
-  if (gfxPrefs::VROpenVRActionInputEnabled()) {
+  if (StaticPrefs::VROpenVRActionInputEnabled()) {
     EnumerateControllers(aSystemState);
 
     vr::VRActiveActionSet_t actionSet = {0};
     actionSet.ulActionSet = mActionsetFirefox;
     vr::VRInput()->UpdateActionState(&actionSet, sizeof(actionSet), 1);
 
     UpdateControllerButtons(aSystemState);
     UpdateControllerPoses(aSystemState);
@@ -2142,17 +2142,17 @@ void OpenVRSession::HapticTimerCallback(
   /**
    * It is safe to use the pointer passed in aClosure to reference the
    * OpenVRSession object as the timer is canceled in OpenVRSession::Shutdown,
    * which is called by the OpenVRSession destructor, guaranteeing
    * that this function runs if and only if the VRManager object is valid.
    */
   OpenVRSession* self = static_cast<OpenVRSession*>(aClosure);
 
-  if (gfxPrefs::VROpenVRActionInputEnabled()) {
+  if (StaticPrefs::VROpenVRActionInputEnabled()) {
     self->UpdateHaptics();
   } else {
     self->UpdateHapticsObsolete();
   }
 }
 
 void OpenVRSession::UpdateHaptics() {
   MOZ_ASSERT(mHapticThread->GetThread() == NS_GetCurrentThread());
--- a/gfx/vr/service/VRService.cpp
+++ b/gfx/vr/service/VRService.cpp
@@ -47,17 +47,17 @@ bool IsImmersiveContentActive(const mozi
 }
 
 }  // anonymous namespace
 
 /*static*/
 already_AddRefed<VRService> VRService::Create() {
   MOZ_ASSERT(NS_IsMainThread());
 
-  if (!gfxPrefs::VRServiceEnabled()) {
+  if (!StaticPrefs::VRServiceEnabled()) {
     return nullptr;
   }
 
   RefPtr<VRService> service = new VRService();
   return service.forget();
 }
 
 VRService::VRService()
@@ -68,17 +68,17 @@ VRService::VRService()
       mShutdownRequested(false),
       mAPIShmem(nullptr),
       mTargetShmemFile(0),
       mLastHapticState{},
       mFrameStartTime{},
 #if defined(XP_WIN)
       mMutex(NULL),
 #endif
-      mVRProcessEnabled(gfxPrefs::VRProcessEnabled()) {
+      mVRProcessEnabled(StaticPrefs::VRProcessEnabled()) {
   // When we have the VR process, we map the memory
   // of mAPIShmem from GPU process.
   // If we don't have the VR process, we will instantiate
   // mAPIShmem in VRService.
   if (!mVRProcessEnabled) {
     mAPIShmem = new VRExternalShmem();
     memset(mAPIShmem, 0, sizeof(VRExternalShmem));
   }
--- a/gfx/vr/service/VRService.h
+++ b/gfx/vr/service/VRService.h
@@ -61,20 +61,17 @@ class VRService {
 
   VRExternalShmem* MOZ_OWNING_REF mAPIShmem;
   base::ProcessHandle mTargetShmemFile;
   VRHapticState mLastHapticState[kVRHapticsMaxCount];
   TimeStamp mFrameStartTime[kVRFrameTimingHistoryDepth];
 #if defined(XP_WIN)
   HANDLE mMutex;
 #endif
-  // We store the value of gfxPrefs::VRProcessEnabled() in mVRProcessEnabled.
-  // This allows us to read the value in the VRService destructor, after
-  // gfxPrefs has been shut down.  We should investigate why gfxPrefs
-  // is shutting down earlier - See bug xxx
+  // We store the value of StaticPrefs::VRProcessEnabled() in mVRProcessEnabled.
   bool mVRProcessEnabled;
 
   bool IsInServiceThread();
   void UpdateHaptics();
 
   /**
    * The VR Service thread is a state machine that always has one
    * task queued depending on the state.
--- a/gfx/vr/service/VRServiceManager.cpp
+++ b/gfx/vr/service/VRServiceManager.cpp
@@ -2,16 +2,17 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "VRServiceManager.h"
 #include "VRGPUChild.h"
 #include "mozilla/gfx/GPUParent.h"
+#include "mozilla/StaticPrefs.h"
 
 namespace mozilla {
 namespace gfx {
 
 VRServiceManager::VRServiceManager()
 #if !defined(MOZ_WIDGET_ANDROID)
     : mVRService(nullptr)
 #endif
@@ -40,27 +41,27 @@ void VRServiceManager::ShutdownVRProcess
   if (VRGPUChild::IsCreated()) {
     VRGPUChild* vrGPUChild = VRGPUChild::Get();
     vrGPUChild->SendStopVRService();
     if (!vrGPUChild->IsClosed()) {
       vrGPUChild->Close();
     }
     VRGPUChild::Shutdown();
   }
-  if (gfxPrefs::VRProcessEnabled()) {
+  if (StaticPrefs::VRProcessEnabled()) {
     // Using PGPU channel to tell the main process
     // to shutdown VR process.
     gfx::GPUParent* gpu = GPUParent::GetSingleton();
     MOZ_ASSERT(gpu);
     Unused << gpu->SendShutdownVRProcess();
   }
 }
 
 void VRServiceManager::CreateService() {
-  if (!gfxPrefs::VRProcessEnabled()) {
+  if (!StaticPrefs::VRProcessEnabled()) {
     mVRService = VRService::Create();
   }
 }
 
 void VRServiceManager::Start() {
   if (mVRService) {
     mVRService->Start();
   }
--- a/image/AnimationSurfaceProvider.cpp
+++ b/image/AnimationSurfaceProvider.cpp
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "AnimationSurfaceProvider.h"
 
-#include "gfxPrefs.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/gfx/gfxVars.h"
 #include "nsProxyRelease.h"
 
 #include "DecodePool.h"
 #include "Decoder.h"
 
 using namespace mozilla::gfx;
 
@@ -459,17 +459,17 @@ void AnimationSurfaceProvider::FinishDec
   // discardable, it'd result in a leak!
   DropImageReference();
 }
 
 bool AnimationSurfaceProvider::ShouldPreferSyncRun() const {
   MutexAutoLock lock(mDecodingMutex);
   MOZ_ASSERT(mDecoder);
 
-  return mDecoder->ShouldSyncDecode(gfxPrefs::ImageMemDecodeBytesAtATime());
+  return mDecoder->ShouldSyncDecode(StaticPrefs::ImageMemDecodeBytesAtATime());
 }
 
 RawAccessFrameRef AnimationSurfaceProvider::RecycleFrame(
     gfx::IntRect& aRecycleRect) {
   MutexAutoLock lock(mFramesMutex);
   MOZ_ASSERT(mFrames->IsRecycling());
   return mFrames->RecycleFrame(aRecycleRect);
 }
--- a/image/DecodePool.cpp
+++ b/image/DecodePool.cpp
@@ -5,28 +5,27 @@
 
 #include "DecodePool.h"
 
 #include <algorithm>
 
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Monitor.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/TimeStamp.h"
 #include "nsCOMPtr.h"
 #include "nsIObserverService.h"
 #include "nsIThreadPool.h"
 #include "nsThreadManager.h"
 #include "nsThreadUtils.h"
 #include "nsXPCOMCIDInternal.h"
 #include "prsystem.h"
 #include "nsIXULRuntime.h"
 
-#include "gfxPrefs.h"
-
 #include "Decoder.h"
 #include "IDecodingTask.h"
 #include "RasterImage.h"
 
 using std::max;
 using std::min;
 
 namespace mozilla {
@@ -330,17 +329,17 @@ DecodePool* DecodePool::Singleton() {
   return sSingleton;
 }
 
 /* static */
 uint32_t DecodePool::NumberOfCores() { return sNumCores; }
 
 DecodePool::DecodePool() : mMutex("image::DecodePool") {
   // Determine the number of threads we want.
-  int32_t prefLimit = gfxPrefs::ImageMTDecodingLimit();
+  int32_t prefLimit = StaticPrefs::ImageMTDecodingLimit();
   uint32_t limit;
   if (prefLimit <= 0) {
     int32_t numCores = NumberOfCores();
     if (numCores <= 1) {
       limit = 1;
     } else if (numCores == 2) {
       // On an otherwise mostly idle system, having two image decoding threads
       // doubles decoding performance, so it's worth doing on dual-core devices,
@@ -360,17 +359,17 @@ DecodePool::DecodePool() : mMutex("image
   if (limit > 4 && XRE_IsE10sParentProcess()) {
     limit = 4;
   }
 
   // The maximum number of idle threads allowed.
   uint32_t idleLimit;
 
   // The timeout period before shutting down idle threads.
-  int32_t prefIdleTimeout = gfxPrefs::ImageMTDecodingIdleTimeout();
+  int32_t prefIdleTimeout = StaticPrefs::ImageMTDecodingIdleTimeout();
   TimeDuration idleTimeout;
   if (prefIdleTimeout <= 0) {
     idleTimeout = TimeDuration::Forever();
     idleLimit = limit;
   } else {
     idleTimeout = TimeDuration::FromMilliseconds(prefIdleTimeout);
     idleLimit = (limit + 1) / 2;
   }
--- a/image/DecodedSurfaceProvider.cpp
+++ b/image/DecodedSurfaceProvider.cpp
@@ -1,16 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DecodedSurfaceProvider.h"
 
-#include "gfxPrefs.h"
+#include "mozilla/StaticPrefs.h"
 #include "nsProxyRelease.h"
 
 #include "Decoder.h"
 
 using namespace mozilla::gfx;
 
 namespace mozilla {
 namespace image {
@@ -195,13 +195,13 @@ void DecodedSurfaceProvider::FinishDecod
   // finishes. If we don't drop our reference to the image, we'll end up
   // keeping it alive as long as we remain in the surface cache, which could
   // greatly extend the image's lifetime - in fact, if the image isn't
   // discardable, it'd result in a leak!
   DropImageReference();
 }
 
 bool DecodedSurfaceProvider::ShouldPreferSyncRun() const {
-  return mDecoder->ShouldSyncDecode(gfxPrefs::ImageMemDecodeBytesAtATime());
+  return mDecoder->ShouldSyncDecode(StaticPrefs::ImageMemDecodeBytesAtATime());
 }
 
 }  // namespace image
 }  // namespace mozilla
--- a/image/FrameAnimator.cpp
+++ b/image/FrameAnimator.cpp
@@ -2,20 +2,20 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "FrameAnimator.h"
 
 #include "mozilla/Move.h"
 #include "mozilla/CheckedInt.h"
+#include "mozilla/StaticPrefs.h"
 #include "imgIContainer.h"
 #include "LookupResult.h"
 #include "RasterImage.h"
-#include "gfxPrefs.h"
 
 namespace mozilla {
 
 using namespace gfx;
 
 namespace image {
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -81,17 +81,17 @@ const gfx::IntRect AnimationState::Updat
       if (mCompositedFrameInvalid) {
         // Invalidate if we are marking the composited frame valid.
         ret.SizeTo(aSize);
       }
       mCompositedFrameInvalid = false;
     } else if (aResult.Type() == MatchType::NOT_FOUND ||
                aResult.Type() == MatchType::PENDING) {
       if (mHasRequestedDecode) {
-        MOZ_ASSERT(gfxPrefs::ImageMemAnimatedDiscardable());
+        MOZ_ASSERT(StaticPrefs::ImageMemAnimatedDiscardable());
         mCompositedFrameInvalid = true;
       }
     }
     // Otherwise don't change the value of mCompositedFrameInvalid, it will be
     // updated by RequestRefresh.
   }
 
   return ret;
@@ -374,17 +374,17 @@ RefreshResult FrameAnimator::RequestRefr
   }
 
   RefPtr<imgFrame> currentFrame =
       result.Surface().GetFrame(aState.mCurrentAnimationFrameIndex);
 
   // only advance the frame if the current time is greater than or
   // equal to the current frame's end time.
   if (!currentFrame) {
-    MOZ_ASSERT(gfxPrefs::ImageMemAnimatedDiscardable());
+    MOZ_ASSERT(StaticPrefs::ImageMemAnimatedDiscardable());
     MOZ_ASSERT(aState.GetHasRequestedDecode() &&
                !aState.GetIsCurrentlyDecoded());
     MOZ_ASSERT(aState.mCompositedFrameInvalid);
     // Nothing we can do but wait for our previous current frame to be decoded
     // again so we can determine what to do next.
     aState.MaybeAdvanceAnimationFrameTime(aTime);
     return ret;
   }
@@ -446,17 +446,17 @@ LookupResult FrameAnimator::GetComposite
   aState.mCompositedFrameRequested = true;
 
   LookupResult result = SurfaceCache::Lookup(
       ImageKey(mImage),
       RasterSurfaceKey(mSize, DefaultSurfaceFlags(), PlaybackType::eAnimated),
       aMarkUsed);
 
   if (aState.mCompositedFrameInvalid) {
-    MOZ_ASSERT(gfxPrefs::ImageMemAnimatedDiscardable());
+    MOZ_ASSERT(StaticPrefs::ImageMemAnimatedDiscardable());
     MOZ_ASSERT(aState.GetHasRequestedDecode());
     MOZ_ASSERT(!aState.GetIsCurrentlyDecoded());
     if (result.Type() == MatchType::NOT_FOUND) {
       return result;
     }
     return LookupResult(MatchType::PENDING);
   }
 
--- a/image/FrameAnimator.h
+++ b/image/FrameAnimator.h
@@ -3,23 +3,23 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_image_FrameAnimator_h
 #define mozilla_image_FrameAnimator_h
 
 #include "mozilla/Maybe.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/TimeStamp.h"
 #include "gfxTypes.h"
 #include "imgFrame.h"
 #include "nsCOMPtr.h"
 #include "nsRect.h"
 #include "SurfaceCache.h"
-#include "gfxPrefs.h"
 
 namespace mozilla {
 namespace image {
 
 class RasterImage;
 class DrawableSurface;
 
 class AnimationState {
@@ -75,17 +75,17 @@ class AnimationState {
    * been created to redecode it.
    */
   bool IsDiscarded() { return mDiscarded; }
 
   /**
    * Sets the composited frame as valid or invalid.
    */
   void SetCompositedFrameInvalid(bool aInvalid) {
-    MOZ_ASSERT(!aInvalid || gfxPrefs::ImageMemAnimatedDiscardable());
+    MOZ_ASSERT(!aInvalid || StaticPrefs::ImageMemAnimatedDiscardable());
     mCompositedFrameInvalid = aInvalid;
   }
 
   /**
    * Returns whether the composited frame is valid to draw to the screen.
    */
   bool GetCompositedFrameInvalid() { return mCompositedFrameInvalid; }
 
--- a/image/RasterImage.cpp
+++ b/image/RasterImage.cpp
@@ -34,26 +34,26 @@
 
 #include "mozilla/gfx/2D.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Likely.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/Move.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/SizeOfState.h"
+#include "mozilla/StaticPrefs.h"
 #include <stdint.h>
 #include "mozilla/Telemetry.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/Tuple.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/gfx/Scale.h"
 
 #include "GeckoProfiler.h"
 #include "gfx2DGlue.h"
-#include "gfxPrefs.h"
 #include "nsProperties.h"
 #include <algorithm>
 
 namespace mozilla {
 
 using namespace gfx;
 using namespace layers;
 
@@ -342,17 +342,17 @@ LookupResult RasterImage::LookupFrame(co
   if (result.Type() == MatchType::NOT_FOUND ||
       (result.Type() == MatchType::SUBSTITUTE_BECAUSE_NOT_FOUND &&
        !avoidRedecode) ||
       (syncDecode && !avoidRedecode && !result)) {
     // We don't have a copy of this frame, and there's no decoder working on
     // one. (Or we're sync decoding and the existing decoder hasn't even started
     // yet.) Trigger decoding so it'll be available next time.
     MOZ_ASSERT(aPlaybackType != PlaybackType::eAnimated ||
-                   gfxPrefs::ImageMemAnimatedDiscardable() ||
+                   StaticPrefs::ImageMemAnimatedDiscardable() ||
                    !mAnimationState || mAnimationState->KnownFrameCount() < 1,
                "Animated frames should be locked");
 
     // The surface cache may suggest the preferred size we are supposed to
     // decode at. This should only happen if we accept substitutions.
     if (!result.SuggestedSize().IsEmpty()) {
       MOZ_ASSERT(!syncDecode && (aFlags & FLAG_HIGH_QUALITY_SCALING));
       requestedSize = result.SuggestedSize();
@@ -410,17 +410,17 @@ bool RasterImage::IsOpaque() {
 
 NS_IMETHODIMP_(bool)
 RasterImage::WillDrawOpaqueNow() {
   if (!IsOpaque()) {
     return false;
   }
 
   if (mAnimationState) {
-    if (!gfxPrefs::ImageMemAnimatedDiscardable()) {
+    if (!StaticPrefs::ImageMemAnimatedDiscardable()) {
       // We never discard frames of animated images.
       return true;
     } else {
       if (mAnimationState->GetCompositedFrameInvalid()) {
         // We're not going to draw anything at all.
         return false;
       }
     }
@@ -466,17 +466,17 @@ void RasterImage::OnSurfaceDiscarded(con
       });
   eventTarget->Dispatch(ev.forget(), NS_DISPATCH_NORMAL);
 }
 
 void RasterImage::OnSurfaceDiscardedInternal(bool aAnimatedFramesDiscarded) {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (aAnimatedFramesDiscarded && mAnimationState) {
-    MOZ_ASSERT(gfxPrefs::ImageMemAnimatedDiscardable());
+    MOZ_ASSERT(StaticPrefs::ImageMemAnimatedDiscardable());
     ReleaseImageContainer();
     gfx::IntRect rect =
         mAnimationState->UpdateState(mAnimationFinished, this, mSize);
     NotifyProgress(NoProgress, rect);
   }
 
   if (mProgressTracker) {
     mProgressTracker->OnDiscard();
@@ -711,17 +711,17 @@ bool RasterImage::SetMetadata(const Imag
     mHasSize = true;
   }
 
   if (mHasSize && aMetadata.HasAnimation() && !mAnimationState) {
     // We're becoming animated, so initialize animation stuff.
     mAnimationState.emplace(mAnimationMode);
     mFrameAnimator = MakeUnique<FrameAnimator>(this, mSize);
 
-    if (!gfxPrefs::ImageMemAnimatedDiscardable()) {
+    if (!StaticPrefs::ImageMemAnimatedDiscardable()) {
       // We don't support discarding animated images (See bug 414259).
       // Lock the image and throw away the key.
       LockImage();
     }
 
     if (!aFromMetadataDecode) {
       // The metadata decode reported that this image isn't animated, but we
       // discovered that it actually was during the full decode. This is a
@@ -1015,17 +1015,17 @@ RasterImage::GetKeys(nsTArray<nsCString>
     return NS_OK;
   }
   return mProperties->GetKeys(keys);
 }
 
 void RasterImage::Discard() {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(CanDiscard(), "Asked to discard but can't");
-  MOZ_ASSERT(!mAnimationState || gfxPrefs::ImageMemAnimatedDiscardable(),
+  MOZ_ASSERT(!mAnimationState || StaticPrefs::ImageMemAnimatedDiscardable(),
              "Asked to discard for animated image");
 
   // Delete all the decoded frames.
   SurfaceCache::RemoveImage(ImageKey(this));
 
   if (mAnimationState) {
     ReleaseImageContainer();
     gfx::IntRect rect =
@@ -1037,17 +1037,17 @@ void RasterImage::Discard() {
   if (mProgressTracker) {
     mProgressTracker->OnDiscard();
   }
 }
 
 bool RasterImage::CanDiscard() {
   return mAllSourceData &&
          // Can discard animated images if the pref is set
-         (!mAnimationState || gfxPrefs::ImageMemAnimatedDiscardable());
+         (!mAnimationState || StaticPrefs::ImageMemAnimatedDiscardable());
 }
 
 NS_IMETHODIMP
 RasterImage::StartDecoding(uint32_t aFlags) {
   if (mError) {
     return NS_ERROR_FAILURE;
   }
 
--- a/image/SurfaceCache.cpp
+++ b/image/SurfaceCache.cpp
@@ -14,22 +14,22 @@
 #include "mozilla/Attributes.h"
 #include "mozilla/CheckedInt.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Likely.h"
 #include "mozilla/Move.h"
 #include "mozilla/Pair.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/StaticMutex.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/Tuple.h"
 #include "nsIMemoryReporter.h"
 #include "gfx2DGlue.h"
 #include "gfxPlatform.h"
-#include "gfxPrefs.h"
 #include "imgFrame.h"
 #include "Image.h"
 #include "ISurfaceProvider.h"
 #include "LookupResult.h"
 #include "nsExpirationTracker.h"
 #include "nsHashKeys.h"
 #include "nsRefPtrHashtable.h"
 #include "nsSize.h"
@@ -1051,17 +1051,17 @@ class SurfaceCacheImpl final : public ns
     if (!cache || !cache->IsLocked()) {
       return;  // Already unlocked.
     }
 
     // (Note that we *don't* unlock the per-image cache here; that's the
     // difference between this and UnlockImage.)
     DoUnlockSurfaces(
         WrapNotNull(cache),
-        /* aStaticOnly = */ !gfxPrefs::ImageMemAnimatedDiscardable(),
+        /* aStaticOnly = */ !StaticPrefs::ImageMemAnimatedDiscardable(),
         aAutoLock);
   }
 
   already_AddRefed<ImageSurfaceCache> RemoveImage(
       const ImageKey aImageKey, const StaticMutexAutoLock& aAutoLock) {
     RefPtr<ImageSurfaceCache> cache = GetImageCache(aImageKey);
     if (!cache) {
       return nullptr;  // No cached surfaces for this image, so nothing to do.
@@ -1368,43 +1368,43 @@ NS_IMPL_ISUPPORTS(SurfaceCacheImpl::Memo
 ///////////////////////////////////////////////////////////////////////////////
 
 /* static */
 void SurfaceCache::Initialize() {
   // Initialize preferences.
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!sInstance, "Shouldn't initialize more than once");
 
-  // See gfxPrefs for the default values of these preferences.
+  // See StaticPrefs for the default values of these preferences.
 
   // Length of time before an unused surface is removed from the cache, in
   // milliseconds.
   uint32_t surfaceCacheExpirationTimeMS =
-      gfxPrefs::ImageMemSurfaceCacheMinExpirationMS();
+      StaticPrefs::ImageMemSurfaceCacheMinExpirationMS();
 
   // What fraction of the memory used by the surface cache we should discard
   // when we get a memory pressure notification. This value is interpreted as
   // 1/N, so 1 means to discard everything, 2 means to discard about half of the
   // memory we're using, and so forth. We clamp it to avoid division by zero.
   uint32_t surfaceCacheDiscardFactor =
-      max(gfxPrefs::ImageMemSurfaceCacheDiscardFactor(), 1u);
+      max(StaticPrefs::ImageMemSurfaceCacheDiscardFactor(), 1u);
 
   // Maximum size of the surface cache, in kilobytes.
-  uint64_t surfaceCacheMaxSizeKB = gfxPrefs::ImageMemSurfaceCacheMaxSizeKB();
+  uint64_t surfaceCacheMaxSizeKB = StaticPrefs::ImageMemSurfaceCacheMaxSizeKB();
 
   // A knob determining the actual size of the surface cache. Currently the
   // cache is (size of main memory) / (surface cache size factor) KB
   // or (surface cache max size) KB, whichever is smaller. The formula
   // may change in the future, though.
   // For example, a value of 4 would yield a 256MB cache on a 1GB machine.
   // The smallest machines we are likely to run this code on have 256MB
   // of memory, which would yield a 64MB cache on this setting.
   // We clamp this value to avoid division by zero.
   uint32_t surfaceCacheSizeFactor =
-      max(gfxPrefs::ImageMemSurfaceCacheSizeFactor(), 1u);
+      max(StaticPrefs::ImageMemSurfaceCacheSizeFactor(), 1u);
 
   // Compute the size of the surface cache.
   uint64_t memorySize = PR_GetPhysicalMemorySize();
   if (memorySize == 0) {
     MOZ_ASSERT_UNREACHABLE("PR_GetPhysicalMemorySize not implemented here");
     memorySize = 256 * 1024 * 1024;  // Fall back to 256MB.
   }
   uint64_t proposedSize = memorySize / surfaceCacheSizeFactor;
--- a/image/imgLoader.cpp
+++ b/image/imgLoader.cpp
@@ -10,16 +10,17 @@
 #include "ImageLogging.h"
 #include "imgLoader.h"
 
 #include "mozilla/Attributes.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/Move.h"
 #include "mozilla/NullPrincipal.h"
 #include "mozilla/Preferences.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/ChaosMode.h"
 #include "mozilla/LoadInfo.h"
 #include "mozilla/StaticPrefs.h"
 
 #include "nsImageModule.h"
 #include "imgRequestProxy.h"
 
 #include "nsCOMPtr.h"
@@ -50,17 +51,16 @@
 #include "mozilla/layers/CompositorManagerChild.h"
 
 #include "nsIApplicationCache.h"
 #include "nsIApplicationCacheContainer.h"
 
 #include "nsIMemoryReporter.h"
 #include "DecoderFactory.h"
 #include "Image.h"
-#include "gfxPrefs.h"
 #include "prtime.h"
 #include "ReferrerInfo.h"
 
 // we want to explore making the document own the load group
 // so we can associate the document URI with the load group.
 // until this point, we have an evil hack:
 #include "nsIHttpChannelInternal.h"
 #include "nsILoadContext.h"
@@ -1246,18 +1246,18 @@ imgCacheQueue& imgLoader::GetCacheQueue(
   return aForChrome ? mChromeCacheQueue : mCacheQueue;
 }
 
 imgCacheQueue& imgLoader::GetCacheQueue(const ImageCacheKey& aKey) {
   return GetCacheQueue(aKey.IsChrome());
 }
 
 void imgLoader::GlobalInit() {
-  sCacheTimeWeight = gfxPrefs::ImageCacheTimeWeight() / 1000.0;
-  int32_t cachesize = gfxPrefs::ImageCacheSize();
+  sCacheTimeWeight = StaticPrefs::ImageCacheTimeWeight() / 1000.0;
+  int32_t cachesize = StaticPrefs::ImageCacheSize();
   sCacheMaxSize = cachesize > 0 ? cachesize : 0;
 
   sMemReporter = new imgMemoryReporter();
   RegisterStrongAsyncMemoryReporter(sMemReporter);
   RegisterImagesContentUsedUncompressedDistinguishedAmount(
       imgMemoryReporter::ImagesContentUsedUncompressedDistinguishedAmount);
 }
 
--- a/image/test/gtest/TestSurfaceCache.cpp
+++ b/image/test/gtest/TestSurfaceCache.cpp
@@ -6,16 +6,17 @@
 #include "gtest/gtest.h"
 
 #include "Common.h"
 #include "imgIContainer.h"
 #include "imgITools.h"
 #include "ImageFactory.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/RefPtr.h"
+#include "mozilla/StaticPrefs.h"
 #include "nsIInputStream.h"
 #include "nsString.h"
 #include "ProgressTracker.h"
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 using namespace mozilla::image;
 
@@ -38,17 +39,17 @@ TEST_F(ImageSurfaceCache, Factor2) {
   // Figure out how much data we have.
   uint64_t length;
   nsresult rv = inputStream->Available(&length);
   ASSERT_TRUE(NS_SUCCEEDED(rv));
 
   // Ensures we meet the threshold for FLAG_SYNC_DECODE_IF_FAST to do sync
   // decoding without the implications of FLAG_SYNC_DECODE.
   ASSERT_LT(length,
-            static_cast<uint64_t>(gfxPrefs::ImageMemDecodeBytesAtATime()));
+            static_cast<uint64_t>(StaticPrefs::ImageMemDecodeBytesAtATime()));
 
   // Write the data into the image.
   rv = image->OnImageDataAvailable(nullptr, nullptr, inputStream, 0,
                                    static_cast<uint32_t>(length));
   ASSERT_TRUE(NS_SUCCEEDED(rv));
 
   // Let the image know we've sent all the data.
   rv = image->OnImageDataComplete(nullptr, nullptr, NS_OK, true);
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -6000,17 +6000,17 @@ void PresShell::Paint(nsView* aViewToPai
   NS_ASSERTION(aViewToPaint, "null view");
 
   MOZ_ASSERT(!mApproximateFrameVisibilityVisited, "Should have been cleared");
 
   if (!mIsActive) {
     return;
   }
 
-  if (gfxPrefs::APZKeyboardEnabled()) {
+  if (StaticPrefs::APZKeyboardEnabled()) {
     // Update the focus target for async keyboard scrolling. This will be
     // forwarded to APZ by nsDisplayList::PaintRoot. We need to to do this
     // before we enter the paint phase because dispatching eVoid events can
     // cause layout to happen.
     mAPZFocusTarget = FocusTarget(this, mAPZFocusSequenceNumber);
   }
 
   nsPresContext* presContext = GetPresContext();
--- a/layout/base/ZoomConstraintsClient.cpp
+++ b/layout/base/ZoomConstraintsClient.cpp
@@ -2,23 +2,23 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ZoomConstraintsClient.h"
 
 #include <inttypes.h>
-#include "gfxPrefs.h"
 #include "LayersLogging.h"
 #include "mozilla/layers/APZCCallbackHelper.h"
 #include "mozilla/layers/ScrollableLayerGuid.h"
 #include "mozilla/layers/ZoomConstraints.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/PresShell.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/dom/Document.h"
 #include "mozilla/dom/Event.h"
 #include "nsIFrame.h"
 #include "nsLayoutUtils.h"
 #include "nsPoint.h"
 #include "nsView.h"
 #include "nsViewportInfo.h"
 #include "Units.h"
@@ -146,18 +146,18 @@ ZoomConstraintsClient::Observe(nsISuppor
                                const char16_t* aData) {
   if (SameCOMIdentity(aSubject, ToSupports(mDocument)) &&
       BEFORE_FIRST_PAINT.EqualsASCII(aTopic)) {
     ZCC_LOG("Got a before-first-paint event in %p\n", this);
     RefreshZoomConstraints();
   } else if (NS_PREF_CHANGED.EqualsASCII(aTopic)) {
     ZCC_LOG("Got a pref-change event in %p\n", this);
     // We need to run this later because all the pref change listeners need
-    // to execute before we can be guaranteed that gfxPrefs::ForceUserScalable()
-    // returns the updated value.
+    // to execute before we can be guaranteed that
+    // StaticPrefs::ForceUserScalable() returns the updated value.
 
     RefPtr<nsRunnableMethod<ZoomConstraintsClient>> event =
         NewRunnableMethod("ZoomConstraintsClient::RefreshZoomConstraints", this,
                           &ZoomConstraintsClient::RefreshZoomConstraints);
     mDocument->Dispatch(TaskCategory::Other, event.forget());
   }
   return NS_OK;
 }
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -109,16 +109,17 @@
 #include "mozilla/LookAndFeel.h"
 #include "UnitTransforms.h"
 #include "TiledLayerBuffer.h"  // For TILEDLAYERBUFFER_TILE_SIZE
 #include "ClientLayerManager.h"
 #include "nsRefreshDriver.h"
 #include "nsIContentViewer.h"
 #include "LayersLogging.h"
 #include "mozilla/Preferences.h"
+#include "mozilla/StaticPrefs.h"
 #include "nsFrameSelection.h"
 #include "FrameLayerBuilder.h"
 #include "mozilla/layers/APZUtils.h"  // for apz::CalculatePendingDisplayPort
 #include "mozilla/layers/CompositorBridgeChild.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/StyleAnimationValue.h"
 #include "mozilla/ServoStyleSet.h"
 #include "mozilla/WheelHandlingHelper.h"  // for WheelHandlingUtils
@@ -762,17 +763,17 @@ bool nsLayoutUtils::AllowZoomingForDocum
 float nsLayoutUtils::GetCurrentAPZResolutionScale(PresShell* aPresShell) {
   return aPresShell ? aPresShell->GetCumulativeNonRootScaleResolution() : 1.0;
 }
 
 // Return the maximum displayport size, based on the LayerManager's maximum
 // supported texture size. The result is in app units.
 static nscoord GetMaxDisplayPortSize(nsIContent* aContent,
                                      nsPresContext* aFallbackPrescontext) {
-  MOZ_ASSERT(!gfxPrefs::LayersTilesEnabled(),
+  MOZ_ASSERT(!StaticPrefs::LayersTilesEnabled(),
              "Do not clamp displayports if tiling is enabled");
 
   // Pick a safe maximum displayport size for sanity purposes. This is the
   // lowest maximum texture size on tileless-platforms (Windows, D3D10).
   // If the gfx.max-texture-size pref is set, further restrict the displayport
   // size to fit within that, because the compositor won't upload stuff larger
   // than this size.
   nscoord safeMaximum = aFallbackPrescontext
@@ -899,17 +900,17 @@ static nsRect GetDisplayPortFromMarginsD
   //   the choosing of the resolution to display-list building time.
   ScreenSize alignment;
 
   PresShell* presShell = presContext->PresShell();
   MOZ_ASSERT(presShell);
 
   if (presShell->IsDisplayportSuppressed()) {
     alignment = ScreenSize(1, 1);
-  } else if (gfxPrefs::LayersTilesEnabled()) {
+  } else if (StaticPrefs::LayersTilesEnabled()) {
     // Don't align to tiles if they are too large, because we could expand
     // the displayport by a lot which can take more paint time. It's a tradeoff
     // though because if we don't align to tiles we have more waste on upload.
     IntSize tileSize = gfxVars::TileSize();
     alignment = ScreenSize(std::min(256, tileSize.width),
                            std::min(256, tileSize.height));
   } else {
     // If we're not drawing with tiles then we need to be careful about not
@@ -921,17 +922,17 @@ static nsRect GetDisplayPortFromMarginsD
   // Avoid division by zero.
   if (alignment.width == 0) {
     alignment.width = 128;
   }
   if (alignment.height == 0) {
     alignment.height = 128;
   }
 
-  if (gfxPrefs::LayersTilesEnabled()) {
+  if (StaticPrefs::LayersTilesEnabled()) {
     // Expand the rect by the margins
     screenRect.Inflate(aMarginsData->mMargins);
   } else {
     // Calculate the displayport to make sure we fit within the max texture size
     // when not tiling.
     nscoord maxSizeAppUnits = GetMaxDisplayPortSize(aContent, presContext);
     MOZ_ASSERT(maxSizeAppUnits < nscoord_MAX);
 
@@ -1133,17 +1134,17 @@ static bool GetDisplayPortImpl(
   } else if (isDisplayportSuppressed ||
              nsLayoutUtils::ShouldDisableApzForElement(aContent)) {
     DisplayPortMarginsPropertyData noMargins(ScreenMargin(), 1);
     result = GetDisplayPortFromMarginsData(aContent, &noMargins, aMultiplier);
   } else {
     result = GetDisplayPortFromMarginsData(aContent, marginsData, aMultiplier);
   }
 
-  if (!gfxPrefs::LayersTilesEnabled()) {
+  if (!StaticPrefs::LayersTilesEnabled()) {
     // Perform the desired error handling if the displayport dimensions
     // exceeds the maximum allowed size
     nscoord maxSize = GetMaxDisplayPortSize(aContent, nullptr);
     if (result.width > maxSize || result.height > maxSize) {
       switch (aBehaviour) {
         case MaxSizeExceededBehaviour::Assert:
           NS_ASSERTION(false, "Displayport must be a valid texture size");
           break;
@@ -9895,17 +9896,17 @@ bool nsLayoutUtils::ShouldHandleMetaView
     case nsIDocShell::META_VIEWPORT_OVERRIDE_ENABLED:
       return true;
     case nsIDocShell::META_VIEWPORT_OVERRIDE_DISABLED:
       return false;
     default:
       MOZ_ASSERT(metaViewportOverride ==
                  nsIDocShell::META_VIEWPORT_OVERRIDE_NONE);
       // The META_VIEWPORT_OVERRIDE_NONE case means that there is no override
-      // and we rely solely on the gfxPrefs.
+      // and we rely solely on the StaticPrefs.
       return StaticPrefs::MetaViewportEnabled();
   }
 }
 
 /* static */
 ComputedStyle* nsLayoutUtils::StyleForScrollbar(nsIFrame* aScrollbarPart) {
   // Get the closest content node which is not an anonymous scrollbar
   // part. It should be the originating element of the scrollbar part.
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -2032,17 +2032,17 @@ ScrollFrameHelper::ScrollFrameHelper(nsC
       mMinimumScaleSizeChanged(false),
       mVelocityQueue(aOuter->PresContext()) {
   if (LookAndFeel::GetInt(LookAndFeel::eIntID_UseOverlayScrollbars) != 0) {
     mScrollbarActivity = new ScrollbarActivity(do_QueryFrame(aOuter));
   }
 
   EnsureFrameVisPrefsCached();
 
-  if (IsAlwaysActive() && gfxPrefs::LayersTilesEnabled() &&
+  if (IsAlwaysActive() && StaticPrefs::LayersTilesEnabled() &&
       !nsLayoutUtils::UsesAsyncScrolling(mOuter) && mOuter->GetContent()) {
     // If we have tiling but no APZ, then set a 0-margin display port on
     // active scroll containers so that we paint by whole tile increments
     // when scrolling.
     nsLayoutUtils::SetDisplayPortMargins(
         mOuter->GetContent(), mOuter->PresShell(), ScreenMargin(), 0);
     nsLayoutUtils::SetZeroMarginDisplayPortOnAsyncScrollableAncestors(mOuter);
   }
--- a/layout/painting/FrameLayerBuilder.cpp
+++ b/layout/painting/FrameLayerBuilder.cpp
@@ -6123,17 +6123,17 @@ static bool ChooseScaleAndSetTransform(
       aContainerFrame, aContainerItem, aVisibleRect, aIncomingScale.mXScale,
       aIncomingScale.mYScale, transform2d, canDraw2D);
 
   // If this is a transform container layer, then pre-rendering might
   // mean we try render a layer bigger than the max texture size. If we have
   // tiling, that's not a problem, since we'll automatically choose a tiled
   // layer for layers of that size. If not, we need to apply clamping to
   // prevent this.
-  if (aTransform && !gfxPrefs::LayersTilesEnabled()) {
+  if (aTransform && !StaticPrefs::LayersTilesEnabled()) {
     RestrictScaleToMaxLayerSize(scale, aVisibleRect, aContainerFrame, aLayer);
   }
 
   // Store the inverse of our resolution-scale on the layer
   aLayer->SetBaseTransform(transform);
   aLayer->SetPreScale(1.0f / scale.width, 1.0f / scale.height);
   aLayer->SetInheritedScale(aIncomingScale.mXScale, aIncomingScale.mYScale);
 
@@ -7069,17 +7069,17 @@ void FrameLayerBuilder::PaintItems(std::
 
 /**
  * Returns true if it is preferred to draw the list of display
  * items separately for each rect in the visible region rather
  * than clipping to a complex region.
  */
 static bool ShouldDrawRectsSeparately(DrawTarget* aDrawTarget,
                                       DrawRegionClip aClip) {
-  if (!gfxPrefs::LayoutPaintRectsSeparately() ||
+  if (!StaticPrefs::LayoutPaintRectsSeparately() ||
       aClip == DrawRegionClip::NONE) {
     return false;
   }
 
   return !aDrawTarget->SupportsRegionClipping();
 }
 
 static void DrawForcedBackgroundColor(DrawTarget& aDrawTarget,
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -6581,17 +6581,17 @@ void nsDisplayOwnLayer::WriteDebugInfo(s
 
 nsDisplayRenderRoot::nsDisplayRenderRoot(
     nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, nsDisplayList* aList,
     const ActiveScrolledRoot* aActiveScrolledRoot, wr::RenderRoot aRenderRoot)
     : nsDisplayWrapList(aBuilder, aFrame, aList, aActiveScrolledRoot, true),
       mRenderRoot(aRenderRoot),
       mBuiltWRCommands(false) {
   MOZ_ASSERT(aRenderRoot != wr::RenderRoot::Default);
-  MOZ_ASSERT(gfxPrefs::WebRenderSplitRenderRoots());
+  MOZ_ASSERT(StaticPrefs::WebRenderSplitRenderRoots());
   ExpandDisplayListBuilderRenderRootRect(aBuilder);
   MOZ_COUNT_CTOR(nsDisplayRenderRoot);
 }
 
 void nsDisplayRenderRoot::Destroy(nsDisplayListBuilder* aBuilder) {
   if (mBuiltWRCommands && aBuilder) {
     aBuilder->SetNeedsDisplayListBuild(mRenderRoot);
   }
--- a/modules/libpref/StaticPrefs.h
+++ b/modules/libpref/StaticPrefs.h
@@ -8,16 +8,17 @@
 #define mozilla_StaticPrefs_h
 
 #include "gfxPlatform.h"
 #include "mozilla/Assertions.h"
 #include "mozilla/Atomics.h"
 #include "mozilla/TypeTraits.h"
 #include "MainThreadUtils.h"
 #include <atomic>
+#include <cmath>  // for M_PI
 
 namespace mozilla {
 
 // These typedefs are for use within StaticPrefList.h.
 
 typedef const char* String;
 
 typedef Atomic<bool, Relaxed> RelaxedAtomicBool;
--- a/modules/libpref/init/StaticPrefList.h
+++ b/modules/libpref/init/StaticPrefList.h
@@ -3180,289 +3180,406 @@ VARCACHE_PREF(
    telemetry_origin_telemetry_test_mode_enabled,
   RelaxedAtomicBool, false
 )
 
 //---------------------------------------------------------------------------
 // Start of previous gfxPrefs
 //---------------------------------------------------------------------------
 
-  // The apz prefs are explained in AsyncPanZoomController.cpp
 VARCACHE_PREF(Live, "accessibility.browsewithcaret", AccessibilityBrowseWithCaret, RelaxedAtomicBool, false);
-
-  // The apz prefs are explained in AsyncPanZoomController.cpp
+VARCACHE_PREF(Once, "layers.gpu-process.enabled",            GPUProcessEnabled, RelaxedAtomicBool, false);
+// The apz prefs are explained in AsyncPanZoomController.cpp
 VARCACHE_PREF(Live, "apz.allow_double_tap_zooming",          APZAllowDoubleTapZooming, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "apz.allow_immediate_handoff",           APZAllowImmediateHandoff, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "apz.allow_zooming",                     APZAllowZooming, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "apz.android.chrome_fling_physics.enabled", APZUseChromeFlingPhysics, RelaxedAtomicBool, false);
-VARCACHE_PREF(Live, "apz.android.chrome_fling_physics.friction", APZChromeFlingPhysicsFriction, AtomicFloat,  0.015f);
-VARCACHE_PREF(Live, "apz.android.chrome_fling_physics.inflexion", APZChromeFlingPhysicsInflexion, AtomicFloat,  0.35f);
-VARCACHE_PREF(Live, "apz.android.chrome_fling_physics.stop_threshold", APZChromeFlingPhysicsStopThreshold, AtomicFloat,  0.1f);
+VARCACHE_PREF(Live, "apz.android.chrome_fling_physics.friction", APZChromeFlingPhysicsFriction, AtomicFloat, 0.015f);
+VARCACHE_PREF(Live, "apz.android.chrome_fling_physics.inflexion", APZChromeFlingPhysicsInflexion, AtomicFloat, 0.35f);
+VARCACHE_PREF(Live, "apz.android.chrome_fling_physics.stop_threshold", APZChromeFlingPhysicsStopThreshold, AtomicFloat, 0.1f);
 VARCACHE_PREF(Live, "apz.autoscroll.enabled",                APZAutoscrollEnabled, RelaxedAtomicBool, false);
-VARCACHE_PREF(Live, "apz.axis_lock.breakout_angle",          APZAxisBreakoutAngle, AtomicFloat,  float(M_PI / 8.0) /* 22.5 degrees */);
-VARCACHE_PREF(Live, "apz.axis_lock.breakout_threshold",      APZAxisBreakoutThreshold, AtomicFloat,  1.0f / 32.0f);
-VARCACHE_PREF(Live, "apz.axis_lock.direct_pan_angle",        APZAllowedDirectPanAngle, AtomicFloat,  float(M_PI / 3.0) /* 60 degrees */);
-VARCACHE_PREF(Live, "apz.axis_lock.lock_angle",              APZAxisLockAngle, AtomicFloat,  float(M_PI / 6.0) /* 30 degrees */);
+VARCACHE_PREF(Live, "apz.axis_lock.breakout_angle",          APZAxisBreakoutAngle, AtomicFloat, float(M_PI / 8.0) /* 22.5 degrees */);
+VARCACHE_PREF(Live, "apz.axis_lock.breakout_threshold",      APZAxisBreakoutThreshold, AtomicFloat, 1.0f / 32.0f);
+VARCACHE_PREF(Live, "apz.axis_lock.direct_pan_angle",        APZAllowedDirectPanAngle, AtomicFloat, float(M_PI / 3.0) /* 60 degrees */);
+VARCACHE_PREF(Live, "apz.axis_lock.lock_angle",              APZAxisLockAngle, AtomicFloat, float(M_PI / 6.0) /* 30 degrees */);
 VARCACHE_PREF(Live, "apz.axis_lock.mode",                    APZAxisLockMode, RelaxedAtomicInt32, 0);
 VARCACHE_PREF(Live, "apz.content_response_timeout",          APZContentResponseTimeout, RelaxedAtomicInt32, 400);
 VARCACHE_PREF(Live, "apz.danger_zone_x",                     APZDangerZoneX, RelaxedAtomicInt32, 50);
 VARCACHE_PREF(Live, "apz.danger_zone_y",                     APZDangerZoneY, RelaxedAtomicInt32, 100);
 VARCACHE_PREF(Live, "apz.disable_for_scroll_linked_effects", APZDisableForScrollLinkedEffects, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "apz.displayport_expiry_ms",             APZDisplayPortExpiryTime, RelaxedAtomicUint32, 15000);
 VARCACHE_PREF(Live, "apz.drag.enabled",                      APZDragEnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "apz.drag.initial.enabled",              APZDragInitiationEnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "apz.drag.touch.enabled",                APZTouchDragEnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "apz.enlarge_displayport_when_clipped",  APZEnlargeDisplayPortWhenClipped, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "apz.fixed-margin-override.enabled",     APZFixedMarginOverrideEnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "apz.fixed-margin-override.bottom",      APZFixedMarginOverrideBottom, RelaxedAtomicInt32, 0);
 VARCACHE_PREF(Live, "apz.fixed-margin-override.top",         APZFixedMarginOverrideTop, RelaxedAtomicInt32, 0);
-VARCACHE_PREF(Live, "apz.fling_accel_base_mult",             APZFlingAccelBaseMultiplier, AtomicFloat,  1.0f);
+VARCACHE_PREF(Live, "apz.fling_accel_base_mult",             APZFlingAccelBaseMultiplier, AtomicFloat, 1.0f);
 VARCACHE_PREF(Live, "apz.fling_accel_interval_ms",           APZFlingAccelInterval, RelaxedAtomicInt32, 500);
-VARCACHE_PREF(Live, "apz.fling_accel_supplemental_mult",     APZFlingAccelSupplementalMultiplier, AtomicFloat,  1.0f);
-VARCACHE_PREF(Live, "apz.fling_accel_min_velocity",          APZFlingAccelMinVelocity, AtomicFloat,  1.5f);
-VARCACHE_PREF(Live, "apz.fling_curve_threshold_inches_per_ms", APZCurveThreshold, AtomicFloat,  -1.0f);
-VARCACHE_PREF(Live, "apz.fling_friction",                    APZFlingFriction, AtomicFloat,  0.002f);
-VARCACHE_PREF(Live, "apz.fling_min_velocity_threshold",      APZFlingMinVelocityThreshold, AtomicFloat,  0.5f);
-VARCACHE_PREF(Live, "apz.fling_stop_on_tap_threshold",       APZFlingStopOnTapThreshold, AtomicFloat,  0.05f);
-VARCACHE_PREF(Live, "apz.fling_stopped_threshold",           APZFlingStoppedThreshold, AtomicFloat,  0.01f);
+VARCACHE_PREF(Live, "apz.fling_accel_supplemental_mult",     APZFlingAccelSupplementalMultiplier, AtomicFloat, 1.0f);
+VARCACHE_PREF(Live, "apz.fling_accel_min_velocity",          APZFlingAccelMinVelocity, AtomicFloat, 1.5f);
+VARCACHE_PREF(Once, "apz.fling_curve_function_x1",           APZCurveFunctionX1, AtomicFloat, 0.0f);
+VARCACHE_PREF(Once, "apz.fling_curve_function_x2",           APZCurveFunctionX2, AtomicFloat, 1.0f);
+VARCACHE_PREF(Once, "apz.fling_curve_function_y1",           APZCurveFunctionY1, AtomicFloat, 0.0f);
+VARCACHE_PREF(Once, "apz.fling_curve_function_y2",           APZCurveFunctionY2, AtomicFloat, 1.0f);
+VARCACHE_PREF(Live, "apz.fling_curve_threshold_inches_per_ms", APZCurveThreshold, AtomicFloat, -1.0f);
+VARCACHE_PREF(Live, "apz.fling_friction",                    APZFlingFriction, AtomicFloat, 0.002f);
+VARCACHE_PREF(Live, "apz.fling_min_velocity_threshold",      APZFlingMinVelocityThreshold, AtomicFloat, 0.5f);
+VARCACHE_PREF(Live, "apz.fling_stop_on_tap_threshold",       APZFlingStopOnTapThreshold, AtomicFloat, 0.05f);
+VARCACHE_PREF(Live, "apz.fling_stopped_threshold",           APZFlingStoppedThreshold, AtomicFloat, 0.01f);
 VARCACHE_PREF(Live, "apz.frame_delay.enabled",               APZFrameDelayEnabled, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "apz.keyboard.enabled",                  APZKeyboardEnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "apz.keyboard.passive-listeners",        APZKeyboardPassiveListeners, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "apz.max_tap_time",                      APZMaxTapTime, RelaxedAtomicInt32, 300);
-VARCACHE_PREF(Live, "apz.max_velocity_inches_per_ms",        APZMaxVelocity, AtomicFloat,  -1.0f);
-VARCACHE_PREF(Live, "apz.min_skate_speed",                   APZMinSkateSpeed, AtomicFloat,  1.0f);
+VARCACHE_PREF(Live, "apz.max_velocity_inches_per_ms",        APZMaxVelocity, AtomicFloat, -1.0f);
+VARCACHE_PREF(Once, "apz.max_velocity_queue_size",           APZMaxVelocityQueueSize, RelaxedAtomicUint32, 5);
+VARCACHE_PREF(Live, "apz.min_skate_speed",                   APZMinSkateSpeed, AtomicFloat, 1.0f);
 VARCACHE_PREF(Live, "apz.minimap.enabled",                   APZMinimap, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "apz.one_touch_pinch.enabled",           APZOneTouchPinchEnabled, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "apz.overscroll.enabled",                APZOverscrollEnabled, RelaxedAtomicBool, false);
-VARCACHE_PREF(Live, "apz.overscroll.min_pan_distance_ratio", APZMinPanDistanceRatio, AtomicFloat,  1.0f);
-VARCACHE_PREF(Live, "apz.overscroll.spring_stiffness",       APZOverscrollSpringStiffness, AtomicFloat,  0.001f);
-VARCACHE_PREF(Live, "apz.overscroll.stop_distance_threshold", APZOverscrollStopDistanceThreshold, AtomicFloat,  5.0f);
+VARCACHE_PREF(Live, "apz.overscroll.min_pan_distance_ratio", APZMinPanDistanceRatio, AtomicFloat, 1.0f);
+VARCACHE_PREF(Live, "apz.overscroll.spring_stiffness",       APZOverscrollSpringStiffness, AtomicFloat, 0.001f);
+VARCACHE_PREF(Live, "apz.overscroll.stop_distance_threshold", APZOverscrollStopDistanceThreshold, AtomicFloat, 5.0f);
 VARCACHE_PREF(Live, "apz.paint_skipping.enabled",            APZPaintSkipping, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "apz.peek_messages.enabled",             APZPeekMessages, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "apz.pinch_lock.mode",                   APZPinchLockMode, RelaxedAtomicInt32, 1);
-VARCACHE_PREF(Live, "apz.pinch_lock.scroll_lock_threshold",  APZPinchLockScrollLockThreshold, AtomicFloat,  1.0f / 32.0f);
-VARCACHE_PREF(Live, "apz.pinch_lock.span_breakout_threshold", APZPinchLockSpanBreakoutThreshold, AtomicFloat,  1.0f / 32.0f);
-VARCACHE_PREF(Live, "apz.pinch_lock.span_lock_threshold",    APZPinchLockSpanLockThreshold, AtomicFloat,  1.0f / 32.0f);
+VARCACHE_PREF(Live, "apz.pinch_lock.scroll_lock_threshold",  APZPinchLockScrollLockThreshold, AtomicFloat, 1.0f / 32.0f);
+VARCACHE_PREF(Live, "apz.pinch_lock.span_breakout_threshold", APZPinchLockSpanBreakoutThreshold, AtomicFloat, 1.0f / 32.0f);
+VARCACHE_PREF(Live, "apz.pinch_lock.span_lock_threshold",    APZPinchLockSpanLockThreshold, AtomicFloat, 1.0f / 32.0f);
+VARCACHE_PREF(Once, "apz.pinch_lock.buffer_max_age",         APZPinchLockBufferMaxAge, RelaxedAtomicInt32, 50);
 VARCACHE_PREF(Live, "apz.popups.enabled",                    APZPopupsEnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "apz.printtree",                         APZPrintTree, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "apz.record_checkerboarding",            APZRecordCheckerboarding, RelaxedAtomicBool, false);
-VARCACHE_PREF(Live, "apz.second_tap_tolerance",              APZSecondTapTolerance, AtomicFloat,  0.5f);
+VARCACHE_PREF(Live, "apz.second_tap_tolerance",              APZSecondTapTolerance, AtomicFloat, 0.5f);
 VARCACHE_PREF(Live, "apz.test.fails_with_native_injection",  APZTestFailsWithNativeInjection, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "apz.test.logging_enabled",              APZTestLoggingEnabled, RelaxedAtomicBool, false);
-VARCACHE_PREF(Live, "apz.touch_move_tolerance",              APZTouchMoveTolerance, AtomicFloat,  0.1f);
-VARCACHE_PREF(Live, "apz.touch_start_tolerance",             APZTouchStartTolerance, AtomicFloat,  1.0f/4.5f);
-VARCACHE_PREF(Live, "apz.velocity_bias",                     APZVelocityBias, AtomicFloat,  0.0f);
+VARCACHE_PREF(Live, "apz.touch_move_tolerance",              APZTouchMoveTolerance, AtomicFloat, 0.1f);
+VARCACHE_PREF(Live, "apz.touch_start_tolerance",             APZTouchStartTolerance, AtomicFloat, 1.0f/4.5f);
+VARCACHE_PREF(Live, "apz.velocity_bias",                     APZVelocityBias, AtomicFloat, 0.0f);
 VARCACHE_PREF(Live, "apz.velocity_relevance_time_ms",        APZVelocityRelevanceTime, RelaxedAtomicUint32, 150);
-VARCACHE_PREF(Live, "apz.x_skate_highmem_adjust",            APZXSkateHighMemAdjust, AtomicFloat,  0.0f);
-VARCACHE_PREF(Live, "apz.x_skate_size_multiplier",           APZXSkateSizeMultiplier, AtomicFloat,  1.5f);
-VARCACHE_PREF(Live, "apz.x_stationary_size_multiplier",      APZXStationarySizeMultiplier, AtomicFloat,  3.0f);
-VARCACHE_PREF(Live, "apz.y_skate_highmem_adjust",            APZYSkateHighMemAdjust, AtomicFloat,  0.0f);
-VARCACHE_PREF(Live, "apz.y_skate_size_multiplier",           APZYSkateSizeMultiplier, AtomicFloat,  2.5f);
-VARCACHE_PREF(Live, "apz.y_stationary_size_multiplier",      APZYStationarySizeMultiplier, AtomicFloat,  3.5f);
+VARCACHE_PREF(Live, "apz.x_skate_highmem_adjust",            APZXSkateHighMemAdjust, AtomicFloat, 0.0f);
+VARCACHE_PREF(Live, "apz.x_skate_size_multiplier",           APZXSkateSizeMultiplier, AtomicFloat, 1.5f);
+VARCACHE_PREF(Live, "apz.x_stationary_size_multiplier",      APZXStationarySizeMultiplier, AtomicFloat, 3.0f);
+VARCACHE_PREF(Live, "apz.y_skate_highmem_adjust",            APZYSkateHighMemAdjust, AtomicFloat, 0.0f);
+VARCACHE_PREF(Live, "apz.y_skate_size_multiplier",           APZYSkateSizeMultiplier, AtomicFloat, 2.5f);
+VARCACHE_PREF(Live, "apz.y_stationary_size_multiplier",      APZYStationarySizeMultiplier, AtomicFloat, 3.5f);
 VARCACHE_PREF(Live, "apz.zoom_animation_duration_ms",        APZZoomAnimationDuration, RelaxedAtomicInt32, 250);
 VARCACHE_PREF(Live, "apz.scale_repaint_delay_ms",            APZScaleRepaintDelay, RelaxedAtomicInt32, 500);
 VARCACHE_PREF(Live, "apz.relative-update.enabled",           APZRelativeUpdate, RelaxedAtomicBool, false);
 
 VARCACHE_PREF(Live, "browser.ui.scroll-toolbar-threshold",   ToolbarScrollThreshold, RelaxedAtomicInt32, 10);
 VARCACHE_PREF(Live, "browser.ui.zoom.force-user-scalable",   ForceUserScalable, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "browser.viewport.desktopWidth",         DesktopViewportWidth, RelaxedAtomicInt32, 980);
 
 VARCACHE_PREF(Live, "dom.ipc.plugins.asyncdrawing.enabled",  PluginAsyncDrawingEnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "dom.meta-viewport.enabled",             MetaViewportEnabled, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "dom.vr.enabled",                        VREnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "dom.vr.autoactivate.enabled",           VRAutoActivateEnabled, RelaxedAtomicBool, false);
-VARCACHE_PREF(Live, "dom.vr.controller_trigger_threshold",   VRControllerTriggerThreshold, AtomicFloat,  0.1f);
+VARCACHE_PREF(Live, "dom.vr.controller_trigger_threshold",   VRControllerTriggerThreshold, AtomicFloat, 0.1f);
+VARCACHE_PREF(Once, "dom.vr.external.enabled",               VRExternalEnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "dom.vr.external.notdetected.timeout",   VRExternalNotDetectedTimeout, RelaxedAtomicInt32, 60000);
 VARCACHE_PREF(Live, "dom.vr.external.quit.timeout",          VRExternalQuitTimeout, RelaxedAtomicInt32, 10000);
 VARCACHE_PREF(Live, "dom.vr.navigation.timeout",             VRNavigationTimeout, RelaxedAtomicInt32, 1000);
+VARCACHE_PREF(Once, "dom.vr.oculus.enabled",                 VROculusEnabled, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "dom.vr.oculus.invisible.enabled",       VROculusInvisibleEnabled, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "dom.vr.oculus.present.timeout",         VROculusPresentTimeout, RelaxedAtomicInt32, 500);
 VARCACHE_PREF(Live, "dom.vr.oculus.quit.timeout",            VROculusQuitTimeout, RelaxedAtomicInt32, 10000);
+VARCACHE_PREF(Once, "dom.vr.openvr.enabled",                 VROpenVREnabled, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "dom.vr.openvr.action_input",             VROpenVRActionInputEnabled, RelaxedAtomicBool, true);
+VARCACHE_PREF(Once, "dom.vr.osvr.enabled",                   VROSVREnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "dom.vr.controller.enumerate.interval",  VRControllerEnumerateInterval, RelaxedAtomicInt32, 1000);
 VARCACHE_PREF(Live, "dom.vr.display.enumerate.interval",     VRDisplayEnumerateInterval, RelaxedAtomicInt32, 5000);
 VARCACHE_PREF(Live, "dom.vr.inactive.timeout",               VRInactiveTimeout, RelaxedAtomicInt32, 5000);
 VARCACHE_PREF(Live, "dom.vr.poseprediction.enabled",         VRPosePredictionEnabled, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "dom.vr.require-gesture",                VRRequireGesture, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "dom.vr.puppet.enabled",                 VRPuppetEnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "dom.vr.puppet.submitframe",             VRPuppetSubmitFrame, RelaxedAtomicUint32, 0);
 VARCACHE_PREF(Live, "dom.vr.display.rafMaxDuration",         VRDisplayRafMaxDuration, RelaxedAtomicUint32, 50);
+VARCACHE_PREF(Once, "dom.vr.process.enabled",                VRProcessEnabled, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "dom.vr.process.startup_timeout_ms",     VRProcessTimeoutMs, RelaxedAtomicInt32, 5000);
+VARCACHE_PREF(Once, "dom.vr.service.enabled",                VRServiceEnabled, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "dom.w3c_pointer_events.enabled",        PointerEventsEnabled, RelaxedAtomicBool, false);
 
 VARCACHE_PREF(Live, "general.smoothScroll",                  SmoothScrollEnabled, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "general.smoothScroll.currentVelocityWeighting",
-                SmoothScrollCurrentVelocityWeighting, AtomicFloat,  0.25);
+              SmoothScrollCurrentVelocityWeighting, AtomicFloat, 0.25);
 VARCACHE_PREF(Live, "general.smoothScroll.durationToIntervalRatio",
-                SmoothScrollDurationToIntervalRatio, RelaxedAtomicInt32, 200);
+              SmoothScrollDurationToIntervalRatio, RelaxedAtomicInt32, 200);
 VARCACHE_PREF(Live, "general.smoothScroll.lines.durationMaxMS",
-                LineSmoothScrollMaxDurationMs, RelaxedAtomicInt32, 150);
+              LineSmoothScrollMaxDurationMs, RelaxedAtomicInt32, 150);
 VARCACHE_PREF(Live, "general.smoothScroll.lines.durationMinMS",
-                LineSmoothScrollMinDurationMs, RelaxedAtomicInt32, 150);
+              LineSmoothScrollMinDurationMs, RelaxedAtomicInt32, 150);
 VARCACHE_PREF(Live, "general.smoothScroll.mouseWheel",       WheelSmoothScrollEnabled, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "general.smoothScroll.mouseWheel.durationMaxMS",
-                WheelSmoothScrollMaxDurationMs, RelaxedAtomicInt32, 400);
+              WheelSmoothScrollMaxDurationMs, RelaxedAtomicInt32, 400);
 VARCACHE_PREF(Live, "general.smoothScroll.mouseWheel.durationMinMS",
-                WheelSmoothScrollMinDurationMs, RelaxedAtomicInt32, 200);
+              WheelSmoothScrollMinDurationMs, RelaxedAtomicInt32, 200);
 VARCACHE_PREF(Live, "general.smoothScroll.other.durationMaxMS",
-                OtherSmoothScrollMaxDurationMs, RelaxedAtomicInt32, 150);
+              OtherSmoothScrollMaxDurationMs, RelaxedAtomicInt32, 150);
 VARCACHE_PREF(Live, "general.smoothScroll.other.durationMinMS",
-                OtherSmoothScrollMinDurationMs, RelaxedAtomicInt32, 150);
+              OtherSmoothScrollMinDurationMs, RelaxedAtomicInt32, 150);
 VARCACHE_PREF(Live, "general.smoothScroll.pages",            PageSmoothScrollEnabled, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "general.smoothScroll.pages.durationMaxMS",
-                PageSmoothScrollMaxDurationMs, RelaxedAtomicInt32, 150);
+              PageSmoothScrollMaxDurationMs, RelaxedAtomicInt32, 150);
 VARCACHE_PREF(Live, "general.smoothScroll.pages.durationMinMS",
-                PageSmoothScrollMinDurationMs, RelaxedAtomicInt32, 150);
+              PageSmoothScrollMinDurationMs, RelaxedAtomicInt32, 150);
 VARCACHE_PREF(Live, "general.smoothScroll.pixels.durationMaxMS",
-                PixelSmoothScrollMaxDurationMs, RelaxedAtomicInt32, 150);
+              PixelSmoothScrollMaxDurationMs, RelaxedAtomicInt32, 150);
 VARCACHE_PREF(Live, "general.smoothScroll.pixels.durationMinMS",
-                PixelSmoothScrollMinDurationMs, RelaxedAtomicInt32, 150);
+              PixelSmoothScrollMinDurationMs, RelaxedAtomicInt32, 150);
 VARCACHE_PREF(Live, "general.smoothScroll.stopDecelerationWeighting",
-                SmoothScrollStopDecelerationWeighting, AtomicFloat, 0.4f);
+              SmoothScrollStopDecelerationWeighting, AtomicFloat, 0.4f);
 
 VARCACHE_PREF(Live, "general.smoothScroll.msdPhysics.enabled",
-                SmoothScrollMSDPhysicsEnabled, RelaxedAtomicBool, false);
+              SmoothScrollMSDPhysicsEnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "general.smoothScroll.msdPhysics.continuousMotionMaxDeltaMS",
-                SmoothScrollMSDPhysicsContinuousMotionMaxDeltaMS, RelaxedAtomicInt32, 120);
+              SmoothScrollMSDPhysicsContinuousMotionMaxDeltaMS, RelaxedAtomicInt32, 120);
 VARCACHE_PREF(Live, "general.smoothScroll.msdPhysics.motionBeginSpringConstant",
-                SmoothScrollMSDPhysicsMotionBeginSpringConstant, RelaxedAtomicInt32, 1250);
+              SmoothScrollMSDPhysicsMotionBeginSpringConstant, RelaxedAtomicInt32, 1250);
 VARCACHE_PREF(Live, "general.smoothScroll.msdPhysics.slowdownMinDeltaMS",
-                SmoothScrollMSDPhysicsSlowdownMinDeltaMS, RelaxedAtomicInt32, 12);
+              SmoothScrollMSDPhysicsSlowdownMinDeltaMS, RelaxedAtomicInt32, 12);
 VARCACHE_PREF(Live, "general.smoothScroll.msdPhysics.slowdownMinDeltaRatio",
-                SmoothScrollMSDPhysicsSlowdownMinDeltaRatio, AtomicFloat, 1.3f);
+              SmoothScrollMSDPhysicsSlowdownMinDeltaRatio, AtomicFloat, 1.3f);
 VARCACHE_PREF(Live, "general.smoothScroll.msdPhysics.slowdownSpringConstant",
-                SmoothScrollMSDPhysicsSlowdownSpringConstant, RelaxedAtomicInt32, 2000);
+              SmoothScrollMSDPhysicsSlowdownSpringConstant, RelaxedAtomicInt32, 2000);
 VARCACHE_PREF(Live, "general.smoothScroll.msdPhysics.regularSpringConstant",
-                SmoothScrollMSDPhysicsRegularSpringConstant, RelaxedAtomicInt32, 1000);
-
+              SmoothScrollMSDPhysicsRegularSpringConstant, RelaxedAtomicInt32, 1000);
+
+VARCACHE_PREF(Once, "gfx.android.rgb16.force",               AndroidRGB16Force, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "gfx.apitrace.enabled",                  UseApitrace, RelaxedAtomicBool, false);
+#if defined(RELEASE_OR_BETA)
+// "Skip" means this is locked to the default value in beta and release.
+VARCACHE_PREF(Skip, "gfx.blocklist.all",                     BlocklistAll, RelaxedAtomicInt32, 0);
+#else
+VARCACHE_PREF(Once, "gfx.blocklist.all",                     BlocklistAll, RelaxedAtomicInt32, 0);
+#endif
 #if defined(MOZ_WIDGET_ANDROID)
-  // Overrides the glClear color used when the surface origin is not (0, 0)
-  // Used for drawing a border around the content.
+// Overrides the glClear color used when the surface origin is not (0, 0)
+// Used for drawing a border around the content.
 VARCACHE_PREF(Live, "gfx.compositor.override.clear-color.r", CompositorOverrideClearColorR, AtomicFloat, 0.0f);
 VARCACHE_PREF(Live, "gfx.compositor.override.clear-color.g", CompositorOverrideClearColorG, AtomicFloat, 0.0f);
 VARCACHE_PREF(Live, "gfx.compositor.override.clear-color.b", CompositorOverrideClearColorB, AtomicFloat, 0.0f);
 VARCACHE_PREF(Live, "gfx.compositor.override.clear-color.a", CompositorOverrideClearColorA, AtomicFloat, 0.0f);
 #endif // defined(MOZ_WIDGET_ANDROID)
 VARCACHE_PREF(Live, "gfx.compositor.clearstate",             CompositorClearState, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "gfx.compositor.glcontext.opaque",       CompositorGLContextOpaque, RelaxedAtomicBool, false);
-  // 0x7fff is the maximum supported xlib surface size and is more than enough for canvases.
+// 0x7fff is the maximum supported xlib surface size and is more than enough for canvases.
 VARCACHE_PREF(Live, "gfx.canvas.max-size",                   MaxCanvasSize, RelaxedAtomicInt32, 0x7fff);
 
 VARCACHE_PREF(Live, "gfx.color_management.enablev4",         CMSEnableV4, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "gfx.color_management.mode",             CMSMode, RelaxedAtomicInt32,-1);
-  // The zero default here should match QCMS_INTENT_DEFAULT from qcms.h
+// The zero default here should match QCMS_INTENT_DEFAULT from qcms.h
 VARCACHE_PREF(Live, "gfx.color_management.rendering_intent", CMSRenderingIntent, RelaxedAtomicInt32, 0);
 VARCACHE_PREF(Live, "gfx.content.always-paint",              AlwaysPaint, RelaxedAtomicBool, false);
-  // Size in megabytes
+// Size in megabytes
+VARCACHE_PREF(Once, "gfx.content.skia-font-cache-size",      SkiaContentFontCacheSize, RelaxedAtomicInt32, 5);
+
+VARCACHE_PREF(Once, "gfx.device-reset.limit",                DeviceResetLimitCount, RelaxedAtomicInt32, 10);
+VARCACHE_PREF(Once, "gfx.device-reset.threshold-ms",         DeviceResetThresholdMilliseconds, RelaxedAtomicInt32, -1);
+
+VARCACHE_PREF(Once, "gfx.direct2d.disabled",                 Direct2DDisabled, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "gfx.direct2d.force-enabled",            Direct2DForceEnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "gfx.direct2d.destroy-dt-on-paintthread",Direct2DDestroyDTOnPaintThread, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "gfx.direct3d11.reuse-decoder-device",   Direct3D11ReuseDecoderDevice, RelaxedAtomicInt32, -1);
 VARCACHE_PREF(Live, "gfx.direct3d11.allow-keyed-mutex",      Direct3D11AllowKeyedMutex, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "gfx.direct3d11.use-double-buffering",   Direct3D11UseDoubleBuffering, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "gfx.direct3d11.enable-debug-layer",     Direct3D11EnableDebugLayer, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "gfx.direct3d11.break-on-error",         Direct3D11BreakOnError, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "gfx.direct3d11.sleep-on-create-device", Direct3D11SleepOnCreateDevice, RelaxedAtomicInt32, 0);
 VARCACHE_PREF(Live, "gfx.downloadable_fonts.keep_color_bitmaps", KeepColorBitmaps, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "gfx.downloadable_fonts.validate_variation_tables", ValidateVariationTables, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "gfx.downloadable_fonts.otl_validation", ValidateOTLTables, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "gfx.draw-color-bars",                   CompositorDrawColorBars, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "gfx.e10s.hide-plugins-for-scroll",      HidePluginsForScroll, RelaxedAtomicBool, true);
+VARCACHE_PREF(Once, "gfx.e10s.font-list.shared",             SharedFontList, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "gfx.layerscope.enabled",                LayerScopeEnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "gfx.layerscope.port",                   LayerScopePort, RelaxedAtomicInt32, 23456);
+VARCACHE_PREF(Once, "gfx.logging.crash.length",              GfxLoggingCrashLength, RelaxedAtomicUint32, 16);
 VARCACHE_PREF(Live, "gfx.logging.painted-pixel-count.enabled",GfxLoggingPaintedPixelCountEnabled, RelaxedAtomicBool, false);
+// The maximums here are quite conservative, we can tighten them if problems show up.
+VARCACHE_PREF(Once, "gfx.logging.texture-usage.enabled",     GfxLoggingTextureUsageEnabled, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "gfx.logging.peak-texture-usage.enabled",GfxLoggingPeakTextureUsageEnabled, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "gfx.logging.slow-frames.enabled",       LoggingSlowFramesEnabled, RelaxedAtomicBool, false);
+// Use gfxPlatform::MaxAllocSize instead of the pref directly
+VARCACHE_PREF(Once, "gfx.max-alloc-size",                    MaxAllocSizeDoNotUseDirectly, RelaxedAtomicInt32, (int32_t)500000000);
+// Use gfxPlatform::MaxTextureSize instead of the pref directly
+VARCACHE_PREF(Once, "gfx.max-texture-size",                  MaxTextureSizeDoNotUseDirectly, RelaxedAtomicInt32, (int32_t)32767);
 VARCACHE_PREF(Live, "gfx.partialpresent.force",              PartialPresent, RelaxedAtomicInt32, 0);
 VARCACHE_PREF(Live, "gfx.perf-warnings.enabled",             PerfWarnings, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "gfx.testing.device-reset",              DeviceResetForTesting, RelaxedAtomicInt32, 0);
 VARCACHE_PREF(Live, "gfx.testing.device-fail",               DeviceFailForTesting, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "gfx.text.disable-aa",                   DisableAllTextAA, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "gfx.ycbcr.accurate-conversion",         YCbCrAccurateConversion, RelaxedAtomicBool, false);
 
-  // Disable surface sharing due to issues with compatible FBConfigs on
-  // NVIDIA drivers as described in bug 1193015.
+// Disable surface sharing due to issues with compatible FBConfigs on
+// NVIDIA drivers as described in bug 1193015.
 VARCACHE_PREF(Live, "gfx.use-glx-texture-from-pixmap",       UseGLXTextureFromPixmap, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "gfx.use-iosurface-textures",            UseIOSurfaceTextures, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "gfx.use-mutex-on-present",              UseMutexOnPresent, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "gfx.use-surfacetexture-textures",       UseSurfaceTextureTextures, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "gfx.allow-texture-direct-mapping",      AllowTextureDirectMapping, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "gfx.vsync.collect-scroll-transforms",   CollectScrollTransforms, RelaxedAtomicBool, false);
-
+VARCACHE_PREF(Once, "gfx.vsync.compositor.unobserve-count",  CompositorUnobserveCount, RelaxedAtomicInt32, 10);
+
+VARCACHE_PREF(Once, "gfx.webrender.all",                     WebRenderAll, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "gfx.webrender.all.qualified",           WebRenderAllQualified, RelaxedAtomicBool, true);
+VARCACHE_PREF(Once,
+              "gfx.webrender.all.qualified.default",
+              WebRenderAllQualifiedDefault,
+              bool,
+              false);
 VARCACHE_PREF(Live, "gfx.webrender.blob-images",             WebRenderBlobImages, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "gfx.webrender.blob.invalidation",       WebRenderBlobInvalidation, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "gfx.webrender.blob.paint-flashing",     WebRenderBlobPaintFlashing, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "gfx.webrender.dl.dump-parent",          WebRenderDLDumpParent, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "gfx.webrender.dl.dump-content",         WebRenderDLDumpContent, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "gfx.webrender.enabled",                 WebRenderEnabledDoNotUseDirectly, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "gfx.webrender.force-disabled",          WebRenderForceDisabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "gfx.webrender.highlight-painted-layers",WebRenderHighlightPaintedLayers, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "gfx.webrender.late-scenebuild-threshold", WebRenderLateSceneBuildThreshold, RelaxedAtomicInt32, 4);
 VARCACHE_PREF(Live, "gfx.webrender.max-filter-ops-per-chain", WebRenderMaxFilterOpsPerChain, RelaxedAtomicUint32, 64);
 VARCACHE_PREF(Live, "gfx.webrender.picture-caching",         WebRenderPictureCaching, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "gfx.webrender.split-render-roots",      WebRenderSplitRenderRoots, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "gfx.webrender.start-debug-server",      WebRenderStartDebugServer, RelaxedAtomicBool, false);
 
+// Use vsync events generated by hardware
+VARCACHE_PREF(Once, "gfx.work-around-driver-bugs",           WorkAroundDriverBugs, RelaxedAtomicBool, true);
+
 VARCACHE_PREF(Live, "gl.allow-high-power",                   GLAllowHighPower, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "gl.ignore-dx-interop2-blacklist",       IgnoreDXInterop2Blacklist, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "gl.msaa-level",                         MSAALevel, RelaxedAtomicUint32, 2);
 #if defined(XP_MACOSX)
 VARCACHE_PREF(Live, "gl.multithreaded",                      GLMultithreaded, RelaxedAtomicBool, false);
 #endif
 VARCACHE_PREF(Live, "gl.require-hardware",                   RequireHardwareGL, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "gl.use-tls-is-current",                 UseTLSIsCurrent, RelaxedAtomicInt32, 0);
 
 VARCACHE_PREF(Live, "image.animated.decode-on-demand.threshold-kb", ImageAnimatedDecodeOnDemandThresholdKB, RelaxedAtomicUint32, 20480);
 VARCACHE_PREF(Live, "image.animated.decode-on-demand.batch-size", ImageAnimatedDecodeOnDemandBatchSize, RelaxedAtomicUint32, 6);
 VARCACHE_PREF(Live, "image.animated.decode-on-demand.recycle", ImageAnimatedDecodeOnDemandRecycle, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "image.animated.resume-from-last-displayed", ImageAnimatedResumeFromLastDisplayed, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "image.cache.factor2.threshold-surfaces", ImageCacheFactor2ThresholdSurfaces, RelaxedAtomicInt32, -1);
 VARCACHE_PREF(Live, "image.cache.max-rasterized-svg-threshold-kb", ImageCacheMaxRasterizedSVGThresholdKB, RelaxedAtomicInt32, 90*1024);
+VARCACHE_PREF(Once, "image.cache.size",                      ImageCacheSize, RelaxedAtomicInt32, 5*1024*1024);
+VARCACHE_PREF(Once, "image.cache.timeweight",                ImageCacheTimeWeight, RelaxedAtomicInt32, 500);
 VARCACHE_PREF(Live, "image.decode-immediately.enabled",      ImageDecodeImmediatelyEnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "image.downscale-during-decode.enabled", ImageDownscaleDuringDecodeEnabled, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "image.infer-src-animation.threshold-ms", ImageInferSrcAnimationThresholdMS, RelaxedAtomicUint32, 2000);
 VARCACHE_PREF(Live, "image.layout_network_priority",         ImageLayoutNetworkPriority, RelaxedAtomicBool, true);
+VARCACHE_PREF(Once, "image.mem.decode_bytes_at_a_time",      ImageMemDecodeBytesAtATime, RelaxedAtomicUint32, 200000);
 VARCACHE_PREF(Live, "image.mem.discardable",                 ImageMemDiscardable, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "image.mem.animated.discardable",        ImageMemAnimatedDiscardable, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "image.mem.animated.use_heap",           ImageMemAnimatedUseHeap, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "image.mem.debug-reporting",             ImageMemDebugReporting, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "image.mem.shared",                      ImageMemShared, RelaxedAtomicBool, true);
+VARCACHE_PREF(Once, "image.mem.surfacecache.discard_factor", ImageMemSurfaceCacheDiscardFactor, RelaxedAtomicUint32, 1);
+VARCACHE_PREF(Once, "image.mem.surfacecache.max_size_kb",    ImageMemSurfaceCacheMaxSizeKB, RelaxedAtomicUint32, 100 * 1024);
+VARCACHE_PREF(Once, "image.mem.surfacecache.min_expiration_ms", ImageMemSurfaceCacheMinExpirationMS, RelaxedAtomicUint32, 60*1000);
+VARCACHE_PREF(Once, "image.mem.surfacecache.size_factor",    ImageMemSurfaceCacheSizeFactor, RelaxedAtomicUint32, 64);
 VARCACHE_PREF(Live, "image.mem.volatile.min_threshold_kb",   ImageMemVolatileMinThresholdKB, RelaxedAtomicInt32, -1);
+VARCACHE_PREF(Once, "image.multithreaded_decoding.limit",    ImageMTDecodingLimit, RelaxedAtomicInt32, -1);
+VARCACHE_PREF(Once, "image.multithreaded_decoding.idle_timeout", ImageMTDecodingIdleTimeout, RelaxedAtomicInt32, -1);
 VARCACHE_PREF(Live, "image.webp.enabled",                    ImageWebPEnabled, RelaxedAtomicBool, false);
 
-  // Instead, use gfxConfig::IsEnabled(Feature::HW_COMPOSITING).
+VARCACHE_PREF(Once, "layers.acceleration.disabled",          LayersAccelerationDisabledDoNotUseDirectly, RelaxedAtomicBool, false);
+// Instead, use gfxConfig::IsEnabled(Feature::HW_COMPOSITING).
 
 VARCACHE_PREF(Live, "layers.acceleration.draw-fps",          LayersDrawFPS, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.acceleration.draw-fps.print-histogram",  FPSPrintHistogram, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.acceleration.draw-fps.write-to-file", WriteFPSToFile, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "layers.acceleration.force-enabled",     LayersAccelerationForceEnabledDoNotUseDirectly, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.advanced.basic-layer.enabled",          LayersAdvancedBasicLayerEnabled, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "layers.amd-switchable-gfx.enabled",     LayersAMDSwitchableGfxEnabled, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "layers.async-pan-zoom.enabled",         AsyncPanZoomEnabledDoNotUseDirectly, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "layers.bench.enabled",                  LayersBenchEnabled, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "layers.bufferrotation.enabled",         BufferRotationEnabled, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "layers.child-process-shutdown",         ChildProcessShutdown, RelaxedAtomicBool, true);
+#ifdef MOZ_GFX_OPTIMIZE_MOBILE
+// If MOZ_GFX_OPTIMIZE_MOBILE is defined, we force component alpha off
+// and ignore the preference.
+VARCACHE_PREF(Skip, "layers.componentalpha.enabled",         ComponentAlphaEnabled, RelaxedAtomicBool, false);
+#else
+// If MOZ_GFX_OPTIMIZE_MOBILE is not defined, we actually take the
+// preference value, defaulting to true.
+VARCACHE_PREF(Once, "layers.componentalpha.enabled",         ComponentAlphaEnabled, RelaxedAtomicBool, true);
+#endif
+VARCACHE_PREF(Once, "layers.d3d11.force-warp",               LayersD3D11ForceWARP, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.deaa.enabled",                   LayersDEAAEnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.draw-bigimage-borders",          DrawBigImageBorders, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.draw-borders",                   DrawLayerBorders, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.draw-tile-borders",              DrawTileBorders, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.draw-layer-info",                DrawLayerInfo, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.dump",                           LayersDump, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.dump-texture",                   LayersDumpTexture, RelaxedAtomicBool, false);
 #ifdef MOZ_DUMP_PAINTING
 VARCACHE_PREF(Live, "layers.dump-client-layers",             DumpClientLayers, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.dump-decision",                  LayersDumpDecision, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.dump-host-layers",               DumpHostLayers, RelaxedAtomicBool, false);
 #endif
 
-  // 0 is "no change" for contrast, positive values increase it, negative values
-  // decrease it until we hit mid gray at -1 contrast, after that it gets weird.
+// 0 is "no change" for contrast, positive values increase it, negative values
+// decrease it until we hit mid gray at -1 contrast, after that it gets weird.
 VARCACHE_PREF(Live, "layers.effect.contrast",                LayersEffectContrast, AtomicFloat, 0.0f);
 VARCACHE_PREF(Live, "layers.effect.grayscale",               LayersEffectGrayscale, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.effect.invert",                  LayersEffectInvert, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "layers.enable-tiles",                   LayersTilesEnabled, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "layers.enable-tiles-if-skia-pomtp",     LayersTilesEnabledIfSkiaPOMTP, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.flash-borders",                  FlashLayerBorders, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "layers.force-shmem-tiles",              ForceShmemTiles, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "layers.gpu-process.allow-software",     GPUProcessAllowSoftware, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "layers.gpu-process.force-enabled",      GPUProcessForceEnabled, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "layers.gpu-process.ipc_reply_timeout_ms", GPUProcessIPCReplyTimeoutMs, RelaxedAtomicInt32, 10000);
 VARCACHE_PREF(Live, "layers.gpu-process.max_restarts",       GPUProcessMaxRestarts, RelaxedAtomicInt32, 1);
-  // Note: This pref will only be used if it is less than layers.gpu-process.max_restarts.
+// Note: This pref will only be used if it is less than layers.gpu-process.max_restarts.
 VARCACHE_PREF(Live, "layers.gpu-process.max_restarts_with_decoder", GPUProcessMaxRestartsWithDecoder, RelaxedAtomicInt32, 0);
+VARCACHE_PREF(Once, "layers.gpu-process.startup_timeout_ms", GPUProcessTimeoutMs, RelaxedAtomicInt32, 5000);
 VARCACHE_PREF(Live, "layers.low-precision-buffer",           UseLowPrecisionBuffer, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.low-precision-opacity",          LowPrecisionOpacity, AtomicFloat, 1.0f);
 VARCACHE_PREF(Live, "layers.low-precision-resolution",       LowPrecisionResolution, AtomicFloat, 0.25f);
 VARCACHE_PREF(Live, "layers.max-active",                     MaxActiveLayers, RelaxedAtomicInt32, -1);
+VARCACHE_PREF(Once, "layers.mlgpu.enabled",                  AdvancedLayersEnabledDoNotUseDirectly, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "layers.mlgpu.enable-buffer-cache",      AdvancedLayersEnableBufferCache, RelaxedAtomicBool, true);
+VARCACHE_PREF(Once, "layers.mlgpu.enable-buffer-sharing",    AdvancedLayersEnableBufferSharing, RelaxedAtomicBool, true);
+VARCACHE_PREF(Once, "layers.mlgpu.enable-clear-view",        AdvancedLayersEnableClearView, RelaxedAtomicBool, true);
+VARCACHE_PREF(Once, "layers.mlgpu.enable-cpu-occlusion",     AdvancedLayersEnableCPUOcclusion, RelaxedAtomicBool, true);
+VARCACHE_PREF(Once, "layers.mlgpu.enable-depth-buffer",      AdvancedLayersEnableDepthBuffer, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.mlgpu.enable-invalidation",      AdvancedLayersUseInvalidation, RelaxedAtomicBool, true);
+VARCACHE_PREF(Once, "layers.mlgpu.enable-on-windows7",       AdvancedLayersEnableOnWindows7, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "layers.mlgpu.enable-container-resizing", AdvancedLayersEnableContainerResizing, RelaxedAtomicBool, true);
+VARCACHE_PREF(Once, "layers.offmainthreadcomposition.force-disabled", LayersOffMainThreadCompositionForceDisabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.offmainthreadcomposition.frame-rate", LayersCompositionFrameRate, RelaxedAtomicInt32,-1);
+VARCACHE_PREF(Once, "layers.omtp.capture-limit",             LayersOMTPCaptureLimit, RelaxedAtomicUint32, 25 * 1024 * 1024);
 VARCACHE_PREF(Live, "layers.omtp.dump-capture",              LayersOMTPDumpCapture, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "layers.omtp.paint-workers",             LayersOMTPPaintWorkers, RelaxedAtomicInt32, 1);
 VARCACHE_PREF(Live, "layers.omtp.release-capture-on-main-thread", LayersOMTPReleaseCaptureOnMainThread, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.orientation.sync.timeout",       OrientationSyncMillis, RelaxedAtomicUint32, (uint32_t)0);
+VARCACHE_PREF(Once, "layers.prefer-opengl",                  LayersPreferOpenGL, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.progressive-paint",              ProgressivePaint, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.shared-buffer-provider.enabled", PersistentBufferProviderSharedEnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.single-tile.enabled",            LayersSingleTileEnabled, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "layers.force-synchronous-resize",       LayersForceSynchronousResize, RelaxedAtomicBool, true);
 
-  // We allow for configurable and rectangular tile size to avoid wasting memory on devices whose
-  // screen size does not align nicely to the default tile size. Although layers can be any size,
-  // they are often the same size as the screen, especially for width.
+// We allow for configurable and rectangular tile size to avoid wasting memory on devices whose
+// screen size does not align nicely to the default tile size. Although layers can be any size,
+// they are often the same size as the screen, especially for width.
+VARCACHE_PREF(Once, "layers.tile-width",                     LayersTileWidth, RelaxedAtomicInt32, 256);
+VARCACHE_PREF(Once, "layers.tile-height",                    LayersTileHeight, RelaxedAtomicInt32, 256);
+VARCACHE_PREF(Once, "layers.tile-initial-pool-size",         LayersTileInitialPoolSize, RelaxedAtomicUint32, (uint32_t)50);
+VARCACHE_PREF(Once, "layers.tile-pool-unused-size",          LayersTilePoolUnusedSize, RelaxedAtomicUint32, (uint32_t)10);
+VARCACHE_PREF(Once, "layers.tile-pool-shrink-timeout",       LayersTilePoolShrinkTimeout, RelaxedAtomicUint32, (uint32_t)50);
+VARCACHE_PREF(Once, "layers.tile-pool-clear-timeout",        LayersTilePoolClearTimeout, RelaxedAtomicUint32, (uint32_t)5000);
+VARCACHE_PREF(Once, "layers.tiles.adjust",                   LayersTilesAdjust, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "layers.tiles.retain-back-buffer",       LayersTileRetainBackBuffer, RelaxedAtomicBool, true);
+VARCACHE_PREF(Once, "layers.tiles.edge-padding",             TileEdgePaddingEnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.tiles.fade-in.enabled",          LayerTileFadeInEnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.tiles.fade-in.duration-ms",      LayerTileFadeInDuration, RelaxedAtomicUint32, 250);
 VARCACHE_PREF(Live, "layers.transaction.warning-ms",         LayerTransactionWarning, RelaxedAtomicUint32, 200);
+VARCACHE_PREF(Once, "layers.uniformity-info",                UniformityInfo, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "layers.use-image-offscreen-surfaces",   UseImageOffscreenSurfaces, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "layers.draw-mask-debug",                DrawMaskLayer, RelaxedAtomicBool, false);
 
 VARCACHE_PREF(Live, "layers.geometry.opengl.enabled",        OGLLayerGeometry, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.geometry.basic.enabled",         BasicLayerGeometry, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layers.geometry.d3d11.enabled",         D3D11LayerGeometry, RelaxedAtomicBool, false);
 
 VARCACHE_PREF(Live, "layout.animation.prerender.partial", PartiallyPrerenderAnimatedContent, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layout.animation.prerender.viewport-ratio-limit-x", AnimationPrerenderViewportRatioLimitX, AtomicFloat, 1.125f);
@@ -3487,92 +3604,100 @@ VARCACHE_PREF(Live, "layout.display-list
 VARCACHE_PREF(Live, "layout.display-list.rebuild-frame-limit", LayoutRebuildFrameLimit, RelaxedAtomicUint32, 500);
 VARCACHE_PREF(Live, "layout.display-list.dump",              LayoutDumpDisplayList, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layout.display-list.dump-content",      LayoutDumpDisplayListContent, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layout.display-list.dump-parent",       LayoutDumpDisplayListParent, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layout.display-list.show-rebuild-area", LayoutDisplayListShowArea, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layout.display-list.flatten-transform", LayoutFlattenTransform, RelaxedAtomicBool, true);
 
 VARCACHE_PREF(Live, "layout.min-active-layer-size",          LayoutMinActiveLayerSize, int, 64);
+VARCACHE_PREF(Once, "layout.paint_rects_separately",         LayoutPaintRectsSeparately, RelaxedAtomicBool, true);
 
 // This and code dependent on it should be removed once containerless scrolling looks stable.
 VARCACHE_PREF(Live, "layout.scroll.root-frame-containers",   LayoutUseContainersForRootFrames,RelaxedAtomicBool, false);
 // This pref is to be set by test code only.
 VARCACHE_PREF(Live, "layout.scrollbars.always-layerize-track", AlwaysLayerizeScrollbarTrackTestOnly, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "layout.smaller-painted-layers",         LayoutSmallerPaintedLayers, RelaxedAtomicBool, false);
 
+VARCACHE_PREF(Once, "media.hardware-video-decoding.force-enabled",
+                                                              HardwareVideoDecodingForceEnabled, RelaxedAtomicBool, false);
 #ifdef XP_WIN
 VARCACHE_PREF(Live, "media.wmf.dxva.d3d11.enabled", PDMWMFAllowD3D11, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "media.wmf.dxva.max-videos", PDMWMFMaxDXVAVideos, RelaxedAtomicUint32, 8);
 VARCACHE_PREF(Live, "media.wmf.use-nv12-format", PDMWMFUseNV12Format, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "media.wmf.force.allow-p010-format", PDMWMFForceAllowP010Format, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "media.wmf.use-sync-texture", PDMWMFUseSyncTexture, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "media.wmf.low-latency.enabled", PDMWMFLowLatencyEnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "media.wmf.low-latency.force-disabled", PDMWMFLowLatencyForceDisabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "media.wmf.skip-blacklist", PDMWMFSkipBlacklist, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "media.wmf.deblacklisting-for-telemetry-in-gpu-process", PDMWMFDeblacklistingForTelemetryInGPUProcess, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "media.wmf.amd.highres.enabled", PDMWMFAMDHighResEnabled, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "media.wmf.allow-unsupported-resolutions", PDMWMFAllowUnsupportedResolutions, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "media.wmf.vp9.enabled", MediaWmfVp9Enabled, RelaxedAtomicBool, true);
 #endif
 
-  // These affect how line scrolls from wheel events will be accelerated.
+// These affect how line scrolls from wheel events will be accelerated.
 VARCACHE_PREF(Live, "mousewheel.acceleration.factor",        MouseWheelAccelerationFactor, RelaxedAtomicInt32, -1);
 VARCACHE_PREF(Live, "mousewheel.acceleration.start",         MouseWheelAccelerationStart, RelaxedAtomicInt32, -1);
 
-  // This affects whether events will be routed through APZ or not.
+// This affects whether events will be routed through APZ or not.
 VARCACHE_PREF(Live, "mousewheel.system_scroll_override_on_root_content.enabled",
-                                                               MouseWheelHasRootScrollDeltaOverride, RelaxedAtomicBool, false);
+                                                              MouseWheelHasRootScrollDeltaOverride, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "mousewheel.system_scroll_override_on_root_content.horizontal.factor",
-                                                               MouseWheelRootScrollHorizontalFactor, RelaxedAtomicInt32, 0);
+                                                              MouseWheelRootScrollHorizontalFactor, RelaxedAtomicInt32, 0);
 VARCACHE_PREF(Live, "mousewheel.system_scroll_override_on_root_content.vertical.factor",
-                                                               MouseWheelRootScrollVerticalFactor, RelaxedAtomicInt32, 0);
+                                                              MouseWheelRootScrollVerticalFactor, RelaxedAtomicInt32, 0);
 VARCACHE_PREF(Live, "mousewheel.transaction.ignoremovedelay",MouseWheelIgnoreMoveDelayMs, RelaxedAtomicInt32, (int32_t)100);
 VARCACHE_PREF(Live, "mousewheel.transaction.timeout",        MouseWheelTransactionTimeoutMs, RelaxedAtomicInt32, (int32_t)1500);
 
 VARCACHE_PREF(Live, "nglayout.debug.widget_update_flashing", WidgetUpdateFlashing, RelaxedAtomicBool, false);
 
 VARCACHE_PREF(Live, "print.font-variations-as-paths",        PrintFontVariationsAsPaths, RelaxedAtomicBool, true);
 
 VARCACHE_PREF(Live, "privacy.resistFingerprinting",          ResistFingerprinting, RelaxedAtomicBool, false);
 
+VARCACHE_PREF(Once, "slider.snapMultiplier",                 SliderSnapMultiplier, RelaxedAtomicInt32, 0);
+
 VARCACHE_PREF(Live, "test.events.async.enabled",             TestEventsAsyncEnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "test.mousescroll",                      MouseScrollTestingEnabled, RelaxedAtomicBool, false);
 
 VARCACHE_PREF(Live, "toolkit.scrollbox.horizontalScrollDistance", ToolkitHorizontalScrollDistance, RelaxedAtomicInt32, 5);
 VARCACHE_PREF(Live, "toolkit.scrollbox.verticalScrollDistance",   ToolkitVerticalScrollDistance, RelaxedAtomicInt32, 3);
 
 VARCACHE_PREF(Live, "ui.click_hold_context_menus.delay",     UiClickHoldContextMenusDelay, RelaxedAtomicInt32, 500);
 
-  // WebGL (for pref access from Worker threads)
+// WebGL (for pref access from Worker threads)
 VARCACHE_PREF(Live, "webgl.1.allow-core-profiles",           WebGL1AllowCoreProfile, RelaxedAtomicBool, false);
 
 VARCACHE_PREF(Live, "webgl.all-angle-options",               WebGLAllANGLEOptions, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "webgl.angle.force-d3d11",               WebGLANGLEForceD3D11, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "webgl.angle.try-d3d11",                 WebGLANGLETryD3D11, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "webgl.angle.force-warp",                WebGLANGLEForceWARP, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "webgl.can-lose-context-in-foreground",  WebGLCanLoseContextInForeground, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "webgl.default-low-power",               WebGLDefaultLowPower, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "webgl.default-no-alpha",                WebGLDefaultNoAlpha, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "webgl.disable-angle",                   WebGLDisableANGLE, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "webgl.disable-wgl",                     WebGLDisableWGL, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "webgl.disable-extensions",              WebGLDisableExtensions, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "webgl.dxgl.enabled",                    WebGLDXGLEnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "webgl.dxgl.needs-finish",               WebGLDXGLNeedsFinish, RelaxedAtomicBool, false);
 
 VARCACHE_PREF(Live, "webgl.disable-fail-if-major-performance-caveat",
-                WebGLDisableFailIfMajorPerformanceCaveat, RelaxedAtomicBool, false);
+              WebGLDisableFailIfMajorPerformanceCaveat, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "webgl.disable-DOM-blit-uploads",
-                WebGLDisableDOMBlitUploads, RelaxedAtomicBool, false);
+              WebGLDisableDOMBlitUploads, RelaxedAtomicBool, false);
 
 VARCACHE_PREF(Live, "webgl.disabled",                        WebGLDisabled, RelaxedAtomicBool, false);
 
 VARCACHE_PREF(Live, "webgl.enable-draft-extensions",         WebGLDraftExtensionsEnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "webgl.enable-privileged-extensions",    WebGLPrivilegedExtensionsEnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "webgl.enable-surface-texture",          WebGLSurfaceTextureEnabled, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "webgl.enable-webgl2",                   WebGL2Enabled, RelaxedAtomicBool, true);
 VARCACHE_PREF(Live, "webgl.force-enabled",                   WebGLForceEnabled, RelaxedAtomicBool, false);
+VARCACHE_PREF(Once, "webgl.force-layers-readback",           WebGLForceLayersReadback, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "webgl.force-index-validation",          WebGLForceIndexValidation, RelaxedAtomicInt32, 0);
 VARCACHE_PREF(Live, "webgl.lose-context-on-memory-pressure", WebGLLoseContextOnMemoryPressure, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "webgl.max-contexts",                    WebGLMaxContexts, RelaxedAtomicUint32, 32);
 VARCACHE_PREF(Live, "webgl.max-contexts-per-principal",      WebGLMaxContextsPerPrincipal, RelaxedAtomicUint32, 16);
 VARCACHE_PREF(Live, "webgl.max-warnings-per-context",        WebGLMaxWarningsPerContext, RelaxedAtomicUint32, 32);
 VARCACHE_PREF(Live, "webgl.min_capability_mode",             WebGLMinCapabilityMode, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "webgl.msaa-force",                      WebGLForceMSAA, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "webgl.msaa-samples",                    WebGLMsaaSamples, RelaxedAtomicUint32, 4);
@@ -3580,16 +3705,17 @@ VARCACHE_PREF(Live, "webgl.prefer-16bpp"
 VARCACHE_PREF(Live, "webgl.allow-immediate-queries",         WebGLImmediateQueries, RelaxedAtomicBool, false);
 VARCACHE_PREF(Live, "webgl.allow-fb-invalidation",           WebGLFBInvalidation, RelaxedAtomicBool, false);
 
 VARCACHE_PREF(Live, "webgl.perf.max-warnings",                    WebGLMaxPerfWarnings, RelaxedAtomicInt32, 0);
 VARCACHE_PREF(Live, "webgl.perf.max-acceptable-fb-status-invals", WebGLMaxAcceptableFBStatusInvals, RelaxedAtomicInt32, 0);
 VARCACHE_PREF(Live, "webgl.perf.spew-frame-allocs",          WebGLSpewFrameAllocs, RelaxedAtomicBool, true);
 
 VARCACHE_PREF(Live, "widget.window-transforms.disabled",     WindowTransformsDisabled, RelaxedAtomicBool, false);
+
 //---------------------------------------------------------------------------
 // End of old gfxPrefs
 //---------------------------------------------------------------------------
 
 //---------------------------------------------------------------------------
 // End of prefs
 //---------------------------------------------------------------------------
 
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -731,17 +731,17 @@ pref("apz.overscroll.stop_velocity_thres
 pref("apz.overscroll.stretch_factor", "0.35");
 pref("apz.paint_skipping.enabled", true);
 // Fetch displayport updates early from the message queue
 pref("apz.peek_messages.enabled", true);
 pref("apz.pinch_lock.mode", 1);
 pref("apz.pinch_lock.scoll_lock_threshold", "0.03125");  // 1/32 inches
 pref("apz.pinch_lock.span_breakout_threshold", "0.03125");  // 1/32 inches
 pref("apz.pinch_lock.span_lock_threshold", "0.03125");  // 1/32 inches
-pref("apz.pinch_lock.buffer_max_age", "50"); // milliseconds
+pref("apz.pinch_lock.buffer_max_age", 50); // milliseconds
 pref("apz.popups.enabled", false);
 pref("apz.relative-update.enabled", true);
 
 // Whether to print the APZC tree for debugging
 pref("apz.printtree", false);
 
 #ifdef NIGHTLY_BUILD
 pref("apz.record_checkerboarding", true);
--- a/widget/GfxInfoBase.cpp
+++ b/widget/GfxInfoBase.cpp
@@ -18,16 +18,17 @@
 #include "mozilla/Services.h"
 #include "mozilla/Observer.h"
 #include "nsIObserver.h"
 #include "nsIObserverService.h"
 #include "nsTArray.h"
 #include "nsXULAppAPI.h"
 #include "nsIXULAppInfo.h"
 #include "mozilla/Preferences.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/gfx/GPUProcessManager.h"
 #include "mozilla/gfx/Logging.h"
 #include "mozilla/gfx/gfxVars.h"
 #include "mozilla/layers/PaintThread.h"
 #include "gfxPrefs.h"
 #include "gfxPlatform.h"
 #include "gfxConfig.h"
@@ -596,17 +597,17 @@ nsresult GfxInfoBase::Init() {
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 GfxInfoBase::GetFeatureStatus(int32_t aFeature, nsACString& aFailureId,
                               int32_t* aStatus) {
-  int32_t blocklistAll = gfxPrefs::BlocklistAll();
+  int32_t blocklistAll = StaticPrefs::BlocklistAll();
   if (blocklistAll > 0) {
     gfxCriticalErrorOnce(gfxCriticalError::DefaultOptions(false))
         << "Forcing blocklisting all features";
     *aStatus = FEATURE_BLOCKED_DEVICE;
     aFailureId = "FEATURE_FAILURE_BLOCK_ALL";
     return NS_OK;
   } else if (blocklistAll < 0) {
     gfxCriticalErrorOnce(gfxCriticalError::DefaultOptions(false))
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -43,20 +43,20 @@
 #include "npapi.h"
 #include "X11UndefineNone.h"
 #include "base/thread.h"
 #include "prdtoa.h"
 #include "prenv.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/Unused.h"
 #include "nsContentUtils.h"
-#include "gfxPrefs.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/MouseEvents.h"
 #include "GLConsts.h"
+#include "mozilla/StaticPrefs.h"
 #include "mozilla/Unused.h"
 #include "mozilla/IMEStateManager.h"
 #include "mozilla/VsyncDispatcher.h"
 #include "mozilla/layers/IAPZCTreeManager.h"
 #include "mozilla/layers/APZEventState.h"
 #include "mozilla/layers/APZInputBridge.h"
 #include "mozilla/layers/APZThreadUtils.h"
 #include "mozilla/layers/ChromeProcessController.h"
@@ -852,17 +852,17 @@ void nsBaseWidget::ConfigureAPZCTreeMana
   ConfigureAPZControllerThread();
 
   float dpi = GetDPI();
   // On Android the main thread is not the controller thread
   APZThreadUtils::RunOnControllerThread(
       NewRunnableMethod<float>("layers::IAPZCTreeManager::SetDPI", mAPZC,
                                &IAPZCTreeManager::SetDPI, dpi));
 
-  if (gfxPrefs::APZKeyboardEnabled()) {
+  if (StaticPrefs::APZKeyboardEnabled()) {
     KeyboardMap map = nsXBLWindowKeyHandler::CollectKeyboardShortcuts();
     // On Android the main thread is not the controller thread
     APZThreadUtils::RunOnControllerThread(NewRunnableMethod<KeyboardMap>(
         "layers::IAPZCTreeManager::SetKeyboardMap", mAPZC,
         &IAPZCTreeManager::SetKeyboardMap, map));
   }
 
   RefPtr<IAPZCTreeManager> treeManager = mAPZC;  // for capture by the lambdas