Bug 1550422 - P25. Remove now unused gfxPrefs. r?jrmuizel! draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Fri, 17 May 2019 00:38:20 +1000
changeset 2008601 f94d45088b99b4a20ad915181e44563cf04d79f7
parent 2008600 b043b4ab98105639814878a811d2b3c04593f638
child 2008602 5082cd58122982f9c888d5170a52a76a365fb3d5
child 2008646 85e88cb636db7c04e7950c1474b3fc5c5a57f848
child 2009191 3b99396eb44fe429d27d05f8a95d1307f37e1934
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 - P25. Remove now unused gfxPrefs. r?jrmuizel! And with some tidying some comments and removing stray #include "gfxPrefs.h" Differential Revision: https://phabricator.services.mozilla.com/D31468
devtools/server/actors/highlighters/utils/canvas.js
dom/base/Document.cpp
dom/base/TextInputProcessor.cpp
dom/base/nsImageLoadingContent.cpp
dom/canvas/WebGL2ContextQueries.cpp
dom/canvas/WebGLContextExtensions.cpp
dom/canvas/WebGLExtensionDisjointTimerQuery.cpp
dom/canvas/WebGLFormats.cpp
dom/canvas/WebGLQuery.cpp
dom/html/HTMLCanvasElement.cpp
dom/ipc/BrowserChild.cpp
dom/ipc/BrowserParent.cpp
dom/ipc/ContentParent.cpp
dom/media/AudioStream.cpp
dom/media/Benchmark.cpp
dom/media/systemservices/MediaSystemResourceManager.cpp
dom/plugins/ipc/PluginInstanceParent.cpp
gfx/config/gfxConfig.h
gfx/config/gfxVars.h
gfx/gl/GLContextProviderEAGL.mm
gfx/gl/GLContextProviderWGL.cpp
gfx/gl/GLLibraryEGL.cpp
gfx/gl/SharedSurfaceD3D11Interop.cpp
gfx/ipc/GPUParent.cpp
gfx/ipc/GraphicsMessages.ipdlh
gfx/layers/FrameMetrics.cpp
gfx/layers/FrameMetrics.h
gfx/layers/LayerScope.cpp
gfx/layers/apz/src/APZInputBridge.cpp
gfx/layers/apz/src/AndroidAPZ.cpp
gfx/layers/apz/src/AndroidFlingPhysics.h
gfx/layers/apz/src/Axis.cpp
gfx/layers/apz/src/DesktopFlingPhysics.h
gfx/layers/apz/src/GenericFlingAnimation.h
gfx/layers/apz/src/GenericScrollAnimation.cpp
gfx/layers/apz/src/GestureEventListener.cpp
gfx/layers/apz/src/HitTestingTreeNode.cpp
gfx/layers/apz/src/InputBlockState.cpp
gfx/layers/apz/src/InputQueue.cpp
gfx/layers/apz/src/KeyboardScrollAnimation.cpp
gfx/layers/apz/test/gtest/APZCBasicTester.h
gfx/layers/apz/test/gtest/APZCTreeManagerTester.h
gfx/layers/apz/test/gtest/InputUtils.h
gfx/layers/apz/test/gtest/TestBasic.cpp
gfx/layers/apz/test/gtest/TestHitTesting.cpp
gfx/layers/apz/test/gtest/TestSnapping.cpp
gfx/layers/apz/util/APZCCallbackHelper.cpp
gfx/layers/apz/util/APZEventState.cpp
gfx/layers/apz/util/CheckerboardReportService.cpp
gfx/layers/basic/BasicCompositor.cpp
gfx/layers/basic/BasicLayerManager.cpp
gfx/layers/client/ClientPaintedLayer.cpp
gfx/layers/client/ContentClient.cpp
gfx/layers/composite/LayerManagerComposite.cpp
gfx/layers/composite/TextureHost.cpp
gfx/layers/ipc/CompositorBridgeParent.cpp
gfx/layers/ipc/ISurfaceAllocator.cpp
gfx/layers/ipc/ShadowLayers.cpp
gfx/layers/wr/WebRenderLayerManager.cpp
gfx/tests/gtest/TestCompositor.cpp
gfx/tests/gtest/TestGfxPrefs.cpp
gfx/tests/gtest/TestTextureCompatibility.cpp
gfx/tests/gtest/TestVsync.cpp
gfx/tests/gtest/moz.build
gfx/tests/marionette/test_pref_rollout_workaround.py
gfx/thebes/gfxContext.cpp
gfx/thebes/gfxMacPlatformFontList.mm
gfx/thebes/gfxPlatform.cpp
gfx/thebes/gfxPrefs.cpp
gfx/thebes/gfxPrefs.h
gfx/thebes/moz.build
gfx/vr/VRDisplayClient.cpp
gfx/vr/VRDisplayLocal.cpp
gfx/vr/ipc/VRParent.cpp
image/DecoderFactory.cpp
image/Downscaler.cpp
image/DownscalingFilter.h
image/IDecodingTask.cpp
image/Image.cpp
image/ImageFactory.cpp
image/build/nsImageModule.cpp
image/imgFrame.cpp
image/test/gtest/Common.cpp
image/test/gtest/TestBlendAnimationFilter.cpp
js/xpconnect/src/XPCShellImpl.cpp
layout/base/AccessibleCaretEventHub.cpp
layout/base/MobileViewportManager.cpp
layout/base/TouchManager.cpp
layout/base/gtest/TestAccessibleCaretEventHub.cpp
layout/base/nsPresContext.cpp
layout/base/nsRefreshDriver.cpp
layout/forms/nsButtonFrameRenderer.cpp
layout/generic/ScrollAnimationBezierPhysics.cpp
layout/generic/ScrollAnimationMSDPhysics.cpp
layout/generic/ScrollSnap.cpp
layout/generic/nsBulletFrame.cpp
layout/generic/nsCanvasFrame.h
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsTextFrame.cpp
layout/painting/DisplayListChecker.cpp
layout/svg/nsFilterInstance.cpp
layout/svg/nsSVGIntegrationUtils.cpp
layout/tables/nsTableFrame.cpp
layout/xul/nsBoxFrame.cpp
layout/xul/nsSliderFrame.cpp
toolkit/content/aboutSupport.js
toolkit/xre/nsAppRunner.cpp
view/nsViewManager.cpp
widget/GfxInfoBase.cpp
widget/nsXPLookAndFeel.cpp
widget/windows/WinCompositorWidget.cpp
widget/windows/nsWindow.cpp
widget/windows/nsWindowBase.cpp
--- a/devtools/server/actors/highlighters/utils/canvas.js
+++ b/devtools/server/actors/highlighters/utils/canvas.js
@@ -22,18 +22,18 @@ const { getComputedStyle } = require("./
 
 // We create a <canvas> element that has always 4096x4096 physical pixels, to displays
 // our grid's overlay.
 // Then, we move the element around when needed, to give the perception that it always
 // covers the screen (See bug 1345434).
 //
 // This canvas size value is the safest we can use because most GPUs can handle it.
 // It's also far from the maximum canvas memory allocation limit (4096x4096x4 is
-// 67.108.864 bytes, where the limit is 500.000.000 bytes, see:
-// http://searchfox.org/mozilla-central/source/gfx/thebes/gfxPrefs.h#401).
+// 67.108.864 bytes, where the limit is 500.000.000 bytes, see MaxAllocSizeDoNotUseDirectly in:
+// https://searchfox.org/mozilla-central/source/modules/libpref/init/StaticPrefList.h).
 //
 // Note:
 // Once bug 1232491 lands, we could try to refactor this code to use the values from
 // the displayport API instead.
 //
 // Using a fixed value should also solve bug 1348293.
 const CANVAS_SIZE = 4096;
 
--- a/dom/base/Document.cpp
+++ b/dom/base/Document.cpp
@@ -261,17 +261,16 @@
 #include "nsIDocumentEncoder.h"
 #include "nsIDocumentActivity.h"
 #include "nsIStructuredCloneContainer.h"
 #include "nsIMutableArray.h"
 #include "mozilla/dom/DOMStringList.h"
 #include "nsWindowSizes.h"
 #include "mozilla/dom/Location.h"
 #include "mozilla/dom/FontFaceSet.h"
-#include "gfxPrefs.h"
 #include "nsISupportsPrimitives.h"
 #include "mozilla/ServoStyleSet.h"
 #include "mozilla/StyleSheet.h"
 #include "mozilla/StyleSheetInlines.h"
 #include "mozilla/dom/SVGDocument.h"
 #include "mozilla/dom/SVGSVGElement.h"
 #include "mozilla/dom/DocGroup.h"
 #include "mozilla/dom/TabGroup.h"
--- a/dom/base/TextInputProcessor.cpp
+++ b/dom/base/TextInputProcessor.cpp
@@ -1,15 +1,14 @@
 /* -*- 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/dom/Event.h"
 #include "mozilla/EventForwards.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/TextEventDispatcher.h"
 #include "mozilla/TextEvents.h"
 #include "mozilla/TextInputProcessor.h"
 #include "mozilla/widget/IMEData.h"
 #include "mozilla/dom/KeyboardEvent.h"
--- a/dom/base/nsImageLoadingContent.cpp
+++ b/dom/base/nsImageLoadingContent.cpp
@@ -34,18 +34,16 @@
 
 #include "nsIFrame.h"
 
 #include "nsContentUtils.h"
 #include "nsLayoutUtils.h"
 #include "nsIContentPolicy.h"
 #include "SVGObserverUtils.h"
 
-#include "gfxPrefs.h"
-
 #include "mozAutoDocUpdate.h"
 #include "mozilla/AsyncEventDispatcher.h"
 #include "mozilla/AutoRestore.h"
 #include "mozilla/EventStateManager.h"
 #include "mozilla/EventStates.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/ImageTracker.h"
 #include "mozilla/dom/ScriptSettings.h"
--- a/dom/canvas/WebGL2ContextQueries.cpp
+++ b/dom/canvas/WebGL2ContextQueries.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 4; 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 "WebGL2Context.h"
 #include "GLContext.h"
 #include "WebGLQuery.h"
-#include "gfxPrefs.h"
 #include "nsThreadUtils.h"
 
 namespace mozilla {
 
 /*
  * We fake ANY_SAMPLES_PASSED and ANY_SAMPLES_PASSED_CONSERVATIVE with
  * SAMPLES_PASSED on desktop.
  *
--- a/dom/canvas/WebGLContextExtensions.cpp
+++ b/dom/canvas/WebGLContextExtensions.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 4; 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 "WebGLContext.h"
 #include "WebGLContextUtils.h"
 #include "WebGLExtensions.h"
-#include "gfxPrefs.h"
 #include "GLContext.h"
 
 #include "nsString.h"
 #include "nsContentUtils.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/BindingDeclarations.h"
 #include "AccessCheck.h"
 
--- a/dom/canvas/WebGLExtensionDisjointTimerQuery.cpp
+++ b/dom/canvas/WebGLExtensionDisjointTimerQuery.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 "WebGLExtensions.h"
 
-#include "gfxPrefs.h"
 #include "GLContext.h"
 #include "mozilla/dom/ToJSValue.h"
 #include "mozilla/dom/WebGLRenderingContextBinding.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "WebGLContext.h"
 #include "WebGLQuery.h"
 
 namespace mozilla {
--- a/dom/canvas/WebGLFormats.cpp
+++ b/dom/canvas/WebGLFormats.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 4; 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 "WebGLFormats.h"
 
-#include "gfxPrefs.h"
 #include "GLContext.h"
 #include "GLDefs.h"
 #include "mozilla/gfx/Logging.h"
 #include "mozilla/StaticMutex.h"
 
 namespace mozilla {
 namespace webgl {
 
--- a/dom/canvas/WebGLQuery.cpp
+++ b/dom/canvas/WebGLQuery.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 20; 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 "WebGLQuery.h"
 
-#include "gfxPrefs.h"
 #include "GLContext.h"
 #include "mozilla/dom/WebGL2RenderingContextBinding.h"
 #include "nsContentUtils.h"
 #include "WebGLContext.h"
 
 namespace mozilla {
 
 ////
--- a/dom/html/HTMLCanvasElement.cpp
+++ b/dom/html/HTMLCanvasElement.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 "mozilla/dom/HTMLCanvasElement.h"
 
-#include "gfxPrefs.h"
 #include "ImageEncoder.h"
 #include "jsapi.h"
 #include "jsfriendapi.h"
 #include "Layers.h"
 #include "MediaSegment.h"
 #include "mozilla/Assertions.h"
 #include "mozilla/Base64.h"
 #include "mozilla/CheckedInt.h"
--- a/dom/ipc/BrowserChild.cpp
+++ b/dom/ipc/BrowserChild.cpp
@@ -3,17 +3,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 "base/basictypes.h"
 
 #include "BrowserChild.h"
 
-#include "gfxPrefs.h"
 #ifdef ACCESSIBILITY
 #  include "mozilla/a11y/DocAccessibleChild.h"
 #endif
 #include "Layers.h"
 #include "ContentChild.h"
 #include "BrowserParent.h"
 #include "js/JSON.h"
 #include "mozilla/Preferences.h"
--- a/dom/ipc/BrowserParent.cpp
+++ b/dom/ipc/BrowserParent.cpp
@@ -91,17 +91,16 @@
 #include "FilePickerParent.h"
 #include "BrowserChild.h"
 #include "LoadContext.h"
 #include "nsNetCID.h"
 #include "nsIAuthInformation.h"
 #include "nsIAuthPromptCallback.h"
 #include "nsAuthInformationHolder.h"
 #include "nsICancelable.h"
-#include "gfxPrefs.h"
 #include "gfxUtils.h"
 #include "nsILoginManagerPrompter.h"
 #include "nsPIWindowRoot.h"
 #include "nsIAuthPrompt2.h"
 #include "gfxDrawable.h"
 #include "ImageOps.h"
 #include "UnitTransforms.h"
 #include <algorithm>
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -201,17 +201,16 @@
 #include "URIUtils.h"
 #include "nsIWebBrowserChrome.h"
 #include "nsIDocShell.h"
 #include "nsDocShell.h"
 #include "nsOpenURIInFrameParams.h"
 #include "mozilla/net/NeckoMessageUtils.h"
 #include "gfxPlatform.h"
 #include "gfxPlatformFontList.h"
-#include "gfxPrefs.h"
 #include "prio.h"
 #include "private/pprio.h"
 #include "ContentProcessManager.h"
 #include "mozilla/dom/BlobURLProtocolHandler.h"
 #include "mozilla/dom/ipc/StructuredCloneData.h"
 #include "mozilla/PerformanceMetricsCollector.h"
 #include "mozilla/psm/PSMContentListener.h"
 #include "nsPluginHost.h"
--- a/dom/media/AudioStream.cpp
+++ b/dom/media/AudioStream.cpp
@@ -13,17 +13,16 @@
 #include "mozilla/Monitor.h"
 #include "mozilla/Mutex.h"
 #include "mozilla/Sprintf.h"
 #include "mozilla/Unused.h"
 #include <algorithm>
 #include "mozilla/Telemetry.h"
 #include "CubebUtils.h"
 #include "nsPrintfCString.h"
-#include "gfxPrefs.h"
 #include "AudioConverter.h"
 #if defined(XP_WIN)
 #  include "nsXULAppAPI.h"
 #endif
 
 namespace mozilla {
 
 #undef LOG
--- a/dom/media/Benchmark.cpp
+++ b/dom/media/Benchmark.cpp
@@ -6,17 +6,16 @@
 
 #include "Benchmark.h"
 
 #include "BufferMediaResource.h"
 #include "MediaData.h"
 #include "PDMFactory.h"
 #include "VideoUtils.h"
 #include "WebMDemuxer.h"
-#include "gfxPrefs.h"
 #include "mozilla/AbstractThread.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/SharedThreadPool.h"
 #include "mozilla/StaticMutex.h"
 #include "mozilla/StaticPrefs.h"
 #include "mozilla/SystemGroup.h"
 #include "mozilla/TaskQueue.h"
 #include "mozilla/Telemetry.h"
@@ -163,17 +162,16 @@ void Benchmark::Dispose() {
   MOZ_ASSERT(OnThread());
 
   mKeepAliveUntilComplete = nullptr;
 }
 
 void Benchmark::Init() {
   MOZ_ASSERT(NS_IsMainThread());
   gfxVars::Initialize();
-  gfxPrefs::GetSingleton();
 }
 
 BenchmarkPlayback::BenchmarkPlayback(Benchmark* aGlobalState,
                                      MediaDataDemuxer* aDemuxer)
     : QueueObject(new TaskQueue(GetMediaThreadPool(MediaThreadType::PLAYBACK),
                                 "BenchmarkPlayback::QueueObject")),
       mGlobalState(aGlobalState),
       mDecoderTaskQueue(
--- a/dom/media/systemservices/MediaSystemResourceManager.cpp
+++ b/dom/media/systemservices/MediaSystemResourceManager.cpp
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* 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/TaskQueue.h"
 
-#include "gfxPrefs.h"
 #include "MediaSystemResourceManagerChild.h"
 #include "mozilla/layers/ImageBridgeChild.h"
 
 #include "MediaSystemResourceManager.h"
 
 namespace mozilla {
 
 using namespace mozilla::ipc;
--- a/dom/plugins/ipc/PluginInstanceParent.cpp
+++ b/dom/plugins/ipc/PluginInstanceParent.cpp
@@ -30,17 +30,16 @@
 #  include "gfxXlibSurface.h"
 #endif
 #include "gfxUtils.h"
 #include "mozilla/gfx/2D.h"
 #include "Layers.h"
 #include "ImageContainer.h"
 #include "GLContext.h"
 #include "GLContextProvider.h"
-#include "gfxPrefs.h"
 #include "LayersLogging.h"
 #include "mozilla/layers/TextureWrapperImage.h"
 #include "mozilla/layers/TextureClientRecycleAllocator.h"
 #include "mozilla/layers/ImageBridgeChild.h"
 #if defined(XP_WIN)
 #  include "mozilla/layers/D3D11ShareHandleImage.h"
 #  include "mozilla/gfx/DeviceManagerDx.h"
 #  include "mozilla/layers/TextureD3D11.h"
--- a/gfx/config/gfxConfig.h
+++ b/gfx/config/gfxConfig.h
@@ -15,17 +15,17 @@
 namespace mozilla {
 namespace gfx {
 
 // Defined in GraphicsMessages.ipdlh.
 class FeatureFailure;
 
 // Manages the history and state of a graphics feature. The flow of a feature
 // is:
-//   - A default value, set by all.js, gfxPrefs, or gfxPlatform.
+//   - A default value, set by all.js, or gfxPlatform.
 //   - A user value, set by an external value or user pref.
 //   - An environment value, determined by system/hardware factors or
 //   nsIGfxInfo.
 //   - A runtime value, determined by any failures encountered after enabling
 //     the feature.
 //
 // Each state change for a feature is recorded in this class.
 class gfxConfig {
--- a/gfx/config/gfxVars.h
+++ b/gfx/config/gfxVars.h
@@ -51,17 +51,17 @@ class gfxVarReceiver;
   _(AllowD3D11KeyedMutex, bool, false)                             \
   _(SystemTextQuality, int32_t, 5 /* CLEARTYPE_QUALITY */)         \
   _(LayersWindowRecordingPath, nsCString, nsCString())
 
 /* Add new entries above this line. */
 
 // Some graphics settings are computed on the UI process and must be
 // communicated to content and GPU processes. gfxVars helps facilitate
-// this. Its function is similar to gfxPrefs, except rather than hold
+// this. Its function is similar to StaticPrefs, except rather than hold
 // user preferences, it holds dynamically computed values.
 //
 // Each variable in GFX_VARS_LIST exposes the following static methods:
 //
 //    const DataType& CxxName();
 //    void SetCxxName(const DataType& aValue);
 //
 // Note that the setter may only be called in the UI process; a gfxVar must be
--- a/gfx/gl/GLContextProviderEAGL.mm
+++ b/gfx/gl/GLContextProviderEAGL.mm
@@ -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 "GLContextProvider.h"
 #include "GLContextEAGL.h"
 #include "nsDebug.h"
 #include "nsIWidget.h"
-#include "gfxPrefs.h"
 #include "gfxFailure.h"
 #include "prenv.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/layers/CompositorOptions.h"
 #include "mozilla/widget/CompositorWidget.h"
 #include "GeckoProfiler.h"
 
 #import <UIKit/UIKit.h>
--- a/gfx/gl/GLContextProviderWGL.cpp
+++ b/gfx/gl/GLContextProviderWGL.cpp
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "GLContextProvider.h"
 #include "GLContextWGL.h"
 #include "GLLibraryLoader.h"
 #include "nsDebug.h"
 #include "nsIWidget.h"
 #include "gfxPlatform.h"
-#include "gfxPrefs.h"
 #include "gfxWindowsSurface.h"
 
 #include "gfxCrashReporterUtils.h"
 
 #include "prenv.h"
 
 #include "mozilla/gfx/gfxVars.h"
 #include "mozilla/Preferences.h"
--- a/gfx/gl/GLLibraryEGL.cpp
+++ b/gfx/gl/GLLibraryEGL.cpp
@@ -25,17 +25,16 @@
 
 #  include <d3d11.h>
 #endif
 #include "OGLShaderProgram.h"
 #include "prenv.h"
 #include "prsystem.h"
 #include "GLContext.h"
 #include "GLContextProvider.h"
-#include "gfxPrefs.h"
 #include "ScopedGLHelpers.h"
 #ifdef MOZ_WIDGET_GTK
 #  include <gdk/gdk.h>
 #  ifdef MOZ_WAYLAND
 #    include <gdk/gdkwayland.h>
 #    include <dlfcn.h>
 #  endif  // MOZ_WIDGET_GTK
 #endif    // MOZ_WAYLAND
@@ -81,17 +80,16 @@ PRLibrary* LoadApitraceLibrary() {
   // on android as we can use LD_PRELOAD or other tricks
   // 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 (!StaticPrefs::UseApitrace()) {
     return nullptr;
   }
 
   static PRLibrary* sApitraceLibrary = nullptr;
   if (sApitraceLibrary) return sApitraceLibrary;
 
   nsAutoCString logFile;
--- a/gfx/gl/SharedSurfaceD3D11Interop.cpp
+++ b/gfx/gl/SharedSurfaceD3D11Interop.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 "SharedSurfaceD3D11Interop.h"
 
 #include <d3d11.h>
 #include <d3d11_1.h>
-#include "gfxPrefs.h"
 #include "GLContext.h"
 #include "WGLLibrary.h"
 #include "nsPrintfCString.h"
 #include "mozilla/gfx/DeviceManagerDx.h"
 
 namespace mozilla {
 namespace gl {
 
--- a/gfx/ipc/GPUParent.cpp
+++ b/gfx/ipc/GPUParent.cpp
@@ -5,17 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifdef XP_WIN
 #  include "WMF.h"
 #endif
 #include "GPUParent.h"
 #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"
@@ -105,18 +104,16 @@ bool GPUParent::Init(base::ProcessId aPa
     // We need to quit this process if the buildID doesn't match the parent's.
     // This can occur when an update occurred in the background.
     ProcessChild::QuickExit();
   }
 
   // Init crash reporter support.
   CrashReporterClient::InitSingleton(this);
 
-  // Ensure gfxPrefs are initialized.
-  gfxPrefs::GetSingleton();
   gfxConfig::Init();
   gfxVars::Initialize();
   gfxPlatform::InitNullMetadata();
   // Ensure our Factory is initialised, mainly for gfx logging to work.
   gfxPlatform::InitMoz2DLogging();
   mlg::InitializeMemoryReporters();
 #if defined(XP_WIN)
   DeviceManagerDx::Init();
@@ -547,15 +544,14 @@ void GPUParent::ActorDestroy(ActorDestro
 #endif
 
 #if defined(XP_WIN)
   DeviceManagerDx::Shutdown();
 #endif
   LayerTreeOwnerTracker::Shutdown();
   gfxVars::Shutdown();
   gfxConfig::Shutdown();
-  gfxPrefs::DestroySingleton();
   CrashReporterClient::DestroySingleton();
   XRE_ShutdownChildProcess();
 }
 
 }  // namespace gfx
 }  // namespace mozilla
--- a/gfx/ipc/GraphicsMessages.ipdlh
+++ b/gfx/ipc/GraphicsMessages.ipdlh
@@ -12,29 +12,16 @@ using mozilla::gfx::BackendType from "mo
 using mozilla::gfx::IntSize from "mozilla/gfx/Point.h";
 using gfxImageFormat from "mozilla/gfx/Types.h";
 using mozilla::gfx::D3D11Checks::VideoFormatOption from "mozilla/gfx/D3D11Checks.h";
 using mozilla::gfx::D3D11Checks::VideoFormatOptionSet from "mozilla/gfx/D3D11Checks.h";
 
 namespace mozilla {
 namespace gfx {
 
-union GfxPrefValue {
-  bool;
-  int32_t;
-  uint32_t;
-  float;
-  nsCString;
-};
-
-struct GfxPrefSetting {
-  int32_t index;
-  GfxPrefValue value;
-};
-
 struct D3D11DeviceStatus
 {
   bool isWARP;
   bool textureSharingWorks;
   uint32_t featureLevel;
   DxgiAdapterDesc adapter;
   int32_t sequenceNumber;
   VideoFormatOptionSet formatOptions;
--- a/gfx/layers/FrameMetrics.cpp
+++ b/gfx/layers/FrameMetrics.cpp
@@ -1,16 +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 "FrameMetrics.h"
-#include "gfxPrefs.h"
+
 #include "nsStyleConsts.h"
 #include "nsStyleStruct.h"
 #include "mozilla/WritingModes.h"
 
 namespace mozilla {
 namespace layers {
 
 const ScrollableLayerGuid::ViewID ScrollableLayerGuid::NULL_SCROLL_ID = 0;
--- a/gfx/layers/FrameMetrics.h
+++ b/gfx/layers/FrameMetrics.h
@@ -974,17 +974,17 @@ struct ScrollMetadata {
   }
   bool GetHasScrollgrab() const { return mHasScrollgrab; }
   void SetIsLayersIdRoot(bool aValue) { mIsLayersIdRoot = aValue; }
   bool IsLayersIdRoot() const { return mIsLayersIdRoot; }
   void SetIsAutoDirRootContentRTL(bool aValue) {
     mIsAutoDirRootContentRTL = aValue;
   }
   bool IsAutoDirRootContentRTL() const { return mIsAutoDirRootContentRTL; }
-  // Implemented out of line because the implementation needs gfxPrefs.h
+  // Implemented out of line because the implementation needs StaticPrefs.h
   // and we don't want to include that from FrameMetrics.h.
   void SetUsesContainerScrolling(bool aValue);
   bool UsesContainerScrolling() const { return mUsesContainerScrolling; }
   void SetForceDisableApz(bool aForceDisable) {
     mForceDisableApz = aForceDisable;
   }
   bool IsApzForceDisabled() const { return mForceDisableApz; }
   void SetResolutionUpdated(bool aUpdated) { mResolutionUpdated = aUpdated; }
--- a/gfx/layers/LayerScope.cpp
+++ b/gfx/layers/LayerScope.cpp
@@ -16,17 +16,17 @@
 
 #include "mozilla/layers/CompositorOGL.h"
 #include "mozilla/layers/CompositorThread.h"
 #include "mozilla/layers/LayerManagerComposite.h"
 #include "mozilla/layers/TextureHostOGL.h"
 
 #include "gfxContext.h"
 #include "gfxUtils.h"
-#include "gfxPrefs.h"
+
 #include "nsIWidget.h"
 
 #include "GLContext.h"
 #include "GLContextProvider.h"
 #include "GLReadTexImageHelper.h"
 
 #include "nsIServiceManager.h"
 #include "nsIConsoleService.h"
--- a/gfx/layers/apz/src/APZInputBridge.cpp
+++ b/gfx/layers/apz/src/APZInputBridge.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 "mozilla/layers/APZInputBridge.h"
 
-#include "gfxPrefs.h"                       // for gfxPrefs
 #include "InputData.h"                      // for MouseInput, etc
 #include "mozilla/dom/WheelEventBinding.h"  // for WheelEvent constants
 #include "mozilla/EventStateManager.h"      // for EventStateManager
 #include "mozilla/layers/APZThreadUtils.h"  // for AssertOnControllerThread, etc
 #include "mozilla/MouseEvents.h"            // for WidgetMouseEvent
 #include "mozilla/TextEvents.h"             // for WidgetKeyboardEvent
 #include "mozilla/TouchEvents.h"            // for WidgetTouchEvent
 #include "mozilla/WheelHandlingHelper.h"    // for WheelDeltaHorizontalizer,
--- a/gfx/layers/apz/src/AndroidAPZ.cpp
+++ b/gfx/layers/apz/src/AndroidAPZ.cpp
@@ -6,17 +6,16 @@
 
 #include "AndroidAPZ.h"
 
 #include "AndroidFlingPhysics.h"
 #include "AndroidVelocityTracker.h"
 #include "AsyncPanZoomController.h"
 #include "GeneratedJNIWrappers.h"
 #include "GenericFlingAnimation.h"
-#include "gfxPrefs.h"
 #include "OverscrollHandoffState.h"
 #include "SimpleVelocityTracker.h"
 #include "ViewConfiguration.h"
 #include "mozilla/StaticPrefs.h"
 
 #define ANDROID_APZ_LOG(...)
 // #define ANDROID_APZ_LOG(...) printf_stderr("ANDROID_APZ: " __VA_ARGS__)
 
--- a/gfx/layers/apz/src/AndroidFlingPhysics.h
+++ b/gfx/layers/apz/src/AndroidFlingPhysics.h
@@ -4,17 +4,16 @@
  * 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_layers_AndroidFlingPhysics_h_
 #define mozilla_layers_AndroidFlingPhysics_h_
 
 #include "AsyncPanZoomController.h"
 #include "Units.h"
-#include "gfxPrefs.h"
 #include "mozilla/Assertions.h"
 
 namespace mozilla {
 namespace layers {
 
 class AndroidFlingPhysics {
  public:
   void Init(const ParentLayerPoint& aVelocity, float aPLPPI);
--- a/gfx/layers/apz/src/Axis.cpp
+++ b/gfx/layers/apz/src/Axis.cpp
@@ -18,17 +18,16 @@
 #include "mozilla/gfx/Rect.h"               // for RoundedIn
 #include "mozilla/layers/APZThreadUtils.h"  // for AssertOnControllerThread
 #include "mozilla/mozalloc.h"               // for operator new
 #include "mozilla/FloatingPoint.h"          // for FuzzyEqualsAdditive
 #include "nsMathUtils.h"                    // for NS_lround
 #include "nsPrintfCString.h"                // for nsPrintfCString
 #include "nsThreadUtils.h"                  // for NS_DispatchToMainThread, etc
 #include "nscore.h"                         // for NS_IMETHOD
-#include "gfxPrefs.h"                       // for the preferences
 
 #define AXIS_LOG(...)
 // #define AXIS_LOG(...) printf_stderr("AXIS: " __VA_ARGS__)
 
 namespace mozilla {
 namespace layers {
 
 bool FuzzyEqualsCoordinate(float aValue1, float aValue2) {
--- a/gfx/layers/apz/src/DesktopFlingPhysics.h
+++ b/gfx/layers/apz/src/DesktopFlingPhysics.h
@@ -4,17 +4,16 @@
  * 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_layers_DesktopFlingPhysics_h_
 #define mozilla_layers_DesktopFlingPhysics_h_
 
 #include "AsyncPanZoomController.h"
 #include "Units.h"
-#include "gfxPrefs.h"
 #include "mozilla/Assertions.h"
 
 #define FLING_PHYS_LOG(...)
 // #define FLING_PHYS_LOG(...) printf_stderr("FLING: " __VA_ARGS__)
 
 namespace mozilla {
 namespace layers {
 
--- a/gfx/layers/apz/src/GenericFlingAnimation.h
+++ b/gfx/layers/apz/src/GenericFlingAnimation.h
@@ -10,17 +10,16 @@
 #include "APZUtils.h"
 #include "AsyncPanZoomAnimation.h"
 #include "AsyncPanZoomController.h"
 #include "FrameMetrics.h"
 #include "Layers.h"
 #include "LayersLogging.h"
 #include "Units.h"
 #include "OverscrollHandoffState.h"
-#include "gfxPrefs.h"
 #include "mozilla/Assertions.h"
 #include "mozilla/Monitor.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/TimeStamp.h"
 #include "nsThreadUtils.h"
 
 #define FLING_LOG(...)
 // #define FLING_LOG(...) printf_stderr("FLING: " __VA_ARGS__)
--- a/gfx/layers/apz/src/GenericScrollAnimation.cpp
+++ b/gfx/layers/apz/src/GenericScrollAnimation.cpp
@@ -3,17 +3,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 "GenericScrollAnimation.h"
 
 #include "AsyncPanZoomController.h"
 #include "FrameMetrics.h"
-#include "gfxPrefs.h"
 #include "nsPoint.h"
 #include "ScrollAnimationPhysics.h"
 #include "ScrollAnimationBezierPhysics.h"
 #include "ScrollAnimationMSDPhysics.h"
 
 namespace mozilla {
 namespace layers {
 
--- a/gfx/layers/apz/src/GestureEventListener.cpp
+++ b/gfx/layers/apz/src/GestureEventListener.cpp
@@ -5,17 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #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__)
 
--- a/gfx/layers/apz/src/HitTestingTreeNode.cpp
+++ b/gfx/layers/apz/src/HitTestingTreeNode.cpp
@@ -1,16 +1,15 @@
 /* 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 "HitTestingTreeNode.h"
 
 #include "AsyncPanZoomController.h"  // for AsyncPanZoomController
-#include "gfxPrefs.h"
 #include "LayersLogging.h"            // for Stringify
 #include "mozilla/gfx/Point.h"        // for Point4D
 #include "mozilla/layers/APZUtils.h"  // for CompleteAsyncTransform
 #include "mozilla/layers/AsyncCompositionManager.h"  // for ViewTransform::operator Matrix4x4()
 #include "mozilla/layers/AsyncDragMetrics.h"  // for AsyncDragMetrics
 #include "nsPrintfCString.h"                  // for nsPrintfCString
 #include "UnitTransforms.h"                   // for ViewAs
 
--- a/gfx/layers/apz/src/InputBlockState.cpp
+++ b/gfx/layers/apz/src/InputBlockState.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 "InputBlockState.h"
 
 #include "APZUtils.h"
 #include "AsyncPanZoomController.h"  // for AsyncPanZoomController
 #include "ScrollAnimationPhysics.h"  // for kScrollSeriesTimeoutMs
-#include "gfxPrefs.h"                // for gfxPrefs
+
 #include "mozilla/MouseEvents.h"
 #include "mozilla/Telemetry.h"                // for Telemetry
 #include "mozilla/layers/IAPZCTreeManager.h"  // for AllowedTouchBehavior
 #include "OverscrollHandoffState.h"
 #include "QueuedInput.h"
 
 #define TBS_LOG(...)
 // #define TBS_LOG(...) printf_stderr("TBS: " __VA_ARGS__)
--- a/gfx/layers/apz/src/InputQueue.cpp
+++ b/gfx/layers/apz/src/InputQueue.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 "InputQueue.h"
 
 #include "AsyncPanZoomController.h"
-#include "gfxPrefs.h"
+
 #include "InputBlockState.h"
 #include "LayersLogging.h"
 #include "mozilla/layers/APZThreadUtils.h"
 #include "OverscrollHandoffState.h"
 #include "QueuedInput.h"
 
 #define INPQ_LOG(...)
 // #define INPQ_LOG(...) printf_stderr("INPQ: " __VA_ARGS__)
--- a/gfx/layers/apz/src/KeyboardScrollAnimation.cpp
+++ b/gfx/layers/apz/src/KeyboardScrollAnimation.cpp
@@ -2,18 +2,16 @@
 /* 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 "KeyboardScrollAnimation.h"
 #include "ScrollAnimationBezierPhysics.h"
 
-#include "gfxPrefs.h"
-
 namespace mozilla {
 namespace layers {
 
 static ScrollAnimationBezierPhysicsSettings SettingsForType(
     KeyboardScrollAction::KeyboardScrollActionType aType) {
   int32_t minMS = 0;
   int32_t maxMS = 0;
 
--- a/gfx/layers/apz/test/gtest/APZCBasicTester.h
+++ b/gfx/layers/apz/test/gtest/APZCBasicTester.h
@@ -7,30 +7,29 @@
 #ifndef mozilla_layers_APZCBasicTester_h
 #define mozilla_layers_APZCBasicTester_h
 
 /**
  * Defines a test fixture used for testing a single APZC.
  */
 
 #include "APZTestCommon.h"
-#include "gfxPrefs.h"
+
 #include "mozilla/layers/APZSampler.h"
 #include "mozilla/layers/APZUpdater.h"
 
 class APZCBasicTester : public APZCTesterBase {
  public:
   explicit APZCBasicTester(
       AsyncPanZoomController::GestureBehavior aGestureBehavior =
           AsyncPanZoomController::DEFAULT_GESTURES)
       : mGestureBehavior(aGestureBehavior) {}
 
  protected:
   virtual void SetUp() {
-    gfxPrefs::GetSingleton();
     APZThreadUtils::SetThreadAssertionsEnabled(false);
     APZThreadUtils::SetControllerThread(MessageLoop::current());
 
     tm = new TestAPZCTreeManager(mcc);
     updater = new APZUpdater(tm, false);
     sampler = new APZSampler(tm, false);
     apzc = new TestAsyncPanZoomController(
         LayersId{0}, mcc, tm, wr::RenderRoot::Default, mGestureBehavior);
--- a/gfx/layers/apz/test/gtest/APZCTreeManagerTester.h
+++ b/gfx/layers/apz/test/gtest/APZCTreeManagerTester.h
@@ -9,24 +9,23 @@
 
 /**
  * Defines a test fixture used for testing multiple APZCs interacting in
  * an APZCTreeManager.
  */
 
 #include "APZTestCommon.h"
 #include "gfxPlatform.h"
-#include "gfxPrefs.h"
+
 #include "mozilla/layers/APZSampler.h"
 #include "mozilla/layers/APZUpdater.h"
 
 class APZCTreeManagerTester : public APZCTesterBase {
  protected:
   virtual void SetUp() {
-    gfxPrefs::GetSingleton();
     gfxPlatform::GetPlatform();
     APZThreadUtils::SetThreadAssertionsEnabled(false);
     APZThreadUtils::SetControllerThread(MessageLoop::current());
 
     manager = new TestAPZCTreeManager(mcc);
     updater = new APZUpdater(manager, false);
     sampler = new APZSampler(manager, false);
   }
--- a/gfx/layers/apz/test/gtest/InputUtils.h
+++ b/gfx/layers/apz/test/gtest/InputUtils.h
@@ -8,17 +8,16 @@
 #define mozilla_layers_InputUtils_h
 
 /**
  * Defines a set of utility functions for generating input events
  * to an APZC/APZCTM during APZ gtests.
  */
 
 #include "APZTestCommon.h"
-#include "gfxPrefs.h"
 
 /* The InputReceiver template parameter used in the helper functions below needs
  * to be a class that implements functions with the signatures:
  * nsEventStatus ReceiveInputEvent(const InputData& aEvent,
  *                                 ScrollableLayerGuid* aGuid,
  *                                 uint64_t* aOutInputBlockId);
  * void SetAllowedTouchBehavior(uint64_t aInputBlockId,
  *                              const nsTArray<uint32_t>& aBehaviours);
--- a/gfx/layers/apz/test/gtest/TestBasic.cpp
+++ b/gfx/layers/apz/test/gtest/TestBasic.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 "APZCBasicTester.h"
 #include "APZTestCommon.h"
-#include "gfxPrefs.h"
+
 #include "InputUtils.h"
 
 TEST_F(APZCBasicTester, Overzoom) {
   // the visible area of the document in CSS pixels is x=10 y=0 w=100 h=100
   FrameMetrics fm;
   fm.SetCompositionBounds(ParentLayerRect(0, 0, 100, 100));
   fm.SetScrollableRect(CSSRect(0, 0, 125, 150));
   fm.SetScrollOffset(CSSPoint(10, 0));
--- a/gfx/layers/apz/test/gtest/TestHitTesting.cpp
+++ b/gfx/layers/apz/test/gtest/TestHitTesting.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 "APZCTreeManagerTester.h"
 #include "APZTestCommon.h"
-#include "gfxPrefs.h"
+
 #include "InputUtils.h"
 
 class APZHitTestingTester : public APZCTreeManagerTester {
  protected:
   ScreenToParentLayerMatrix4x4 transformToApzc;
   ParentLayerToScreenMatrix4x4 transformToGecko;
 
   already_AddRefed<AsyncPanZoomController> GetTargetAPZC(
--- a/gfx/layers/apz/test/gtest/TestSnapping.cpp
+++ b/gfx/layers/apz/test/gtest/TestSnapping.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 "APZCTreeManagerTester.h"
 #include "APZTestCommon.h"
-#include "gfxPrefs.h"
+
 #include "InputUtils.h"
 #include "mozilla/StaticPrefs.h"
 
 class APZCSnappingTester : public APZCTreeManagerTester {};
 
 TEST_F(APZCSnappingTester, Bug1265510) {
   SCOPED_GFX_VAR(UseWebRender, bool, false);
 
--- a/gfx/layers/apz/util/APZCCallbackHelper.cpp
+++ b/gfx/layers/apz/util/APZCCallbackHelper.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 "APZCCallbackHelper.h"
 
 #include "TouchActionHelper.h"
 #include "gfxPlatform.h"  // For gfxPlatform::UseTiling
-#include "gfxPrefs.h"
+
 #include "LayersLogging.h"  // For Stringify
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/MouseEventBinding.h"
 #include "mozilla/dom/BrowserParent.h"
 #include "mozilla/IntegerPrintfMacros.h"
 #include "mozilla/layers/LayerTransactionChild.h"
 #include "mozilla/layers/ShadowLayers.h"
 #include "mozilla/layers/WebRenderLayerManager.h"
--- a/gfx/layers/apz/util/APZEventState.cpp
+++ b/gfx/layers/apz/util/APZEventState.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 "APZEventState.h"
 
 #include "ActiveElementManager.h"
 #include "APZCCallbackHelper.h"
-#include "gfxPrefs.h"
+
 #include "LayersLogging.h"
 #include "mozilla/BasicEvents.h"
 #include "mozilla/dom/MouseEventBinding.h"
 #include "mozilla/dom/BrowserChild.h"
 #include "mozilla/dom/TabGroup.h"
 #include "mozilla/IntegerPrintfMacros.h"
 #include "mozilla/Move.h"
 #include "mozilla/Preferences.h"
--- a/gfx/layers/apz/util/CheckerboardReportService.cpp
+++ b/gfx/layers/apz/util/CheckerboardReportService.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 "CheckerboardReportService.h"
 
-#include "gfxPrefs.h"                 // for gfxPrefs
 #include "jsapi.h"                    // for JS_Now
 #include "MainThreadUtils.h"          // for NS_IsMainThread
 #include "mozilla/Assertions.h"       // for MOZ_ASSERT
 #include "mozilla/ClearOnShutdown.h"  // for ClearOnShutdown
 #include "mozilla/Unused.h"
 #include "mozilla/dom/CheckerboardReportServiceBinding.h"  // for dom::CheckerboardReports
 #include "mozilla/gfx/GPUParent.h"
 #include "mozilla/gfx/GPUProcessManager.h"
--- a/gfx/layers/basic/BasicCompositor.cpp
+++ b/gfx/layers/basic/BasicCompositor.cpp
@@ -19,17 +19,16 @@
 #include "mozilla/gfx/ssse3-scaler.h"
 #include "mozilla/layers/ImageDataSerializer.h"
 #include "mozilla/SSE.h"
 #include "gfxPlatform.h"
 #include "gfxUtils.h"
 #include "YCbCrUtils.h"
 #include <algorithm>
 #include "ImageContainer.h"
-#include "gfxPrefs.h"
 
 namespace mozilla {
 using namespace mozilla::gfx;
 
 namespace layers {
 
 class DataTextureSourceBasic : public DataTextureSource,
                                public TextureSourceBasic {
--- a/gfx/layers/basic/BasicLayerManager.cpp
+++ b/gfx/layers/basic/BasicLayerManager.cpp
@@ -18,17 +18,17 @@
 #include "RenderTrace.h"            // for RenderTraceLayers, etc
 #include "basic/BasicImplData.h"    // for BasicImplData
 #include "basic/BasicLayers.h"      // for BasicLayerManager, etc
 #include "gfxASurface.h"            // for gfxASurface, etc
 #include "gfxContext.h"             // for gfxContext, etc
 #include "gfxImageSurface.h"        // for gfxImageSurface
 #include "gfxMatrix.h"              // for gfxMatrix
 #include "gfxPlatform.h"            // for gfxPlatform
-#include "gfxPrefs.h"               // for gfxPrefs
+
 #include "gfxPoint.h"               // for IntSize, gfxPoint
 #include "gfxRect.h"                // for gfxRect
 #include "gfxUtils.h"               // for gfxUtils
 #include "gfx2DGlue.h"              // for thebes --> moz2d transition
 #include "mozilla/Assertions.h"     // for MOZ_ASSERT, etc
 #include "mozilla/WidgetUtils.h"    // for ScreenRotation
 #include "mozilla/gfx/2D.h"         // for DrawTarget
 #include "mozilla/gfx/BasePoint.h"  // for BasePoint
--- a/gfx/layers/client/ClientPaintedLayer.cpp
+++ b/gfx/layers/client/ClientPaintedLayer.cpp
@@ -8,17 +8,17 @@
 #include "ClientTiledPaintedLayer.h"    // for ClientTiledPaintedLayer
 #include <stdint.h>                     // for uint32_t
 #include "GeckoProfiler.h"              // for AUTO_PROFILER_LABEL
 #include "client/ClientLayerManager.h"  // for ClientLayerManager, etc
 #include "gfxContext.h"                 // for gfxContext
 #include "gfx2DGlue.h"
 #include "gfxEnv.h"              // for gfxEnv
 #include "gfxRect.h"             // for gfxRect
-#include "gfxPrefs.h"            // for gfxPrefs
+
 #include "mozilla/Assertions.h"  // for MOZ_ASSERT, etc
 #include "mozilla/gfx/2D.h"      // for DrawTarget
 #include "mozilla/gfx/DrawEventRecorder.h"
 #include "mozilla/gfx/Matrix.h"  // for Matrix
 #include "mozilla/gfx/Rect.h"    // for Rect, IntRect
 #include "mozilla/gfx/Types.h"   // for Float, etc
 #include "mozilla/layers/LayersTypes.h"
 #include "mozilla/Preferences.h"
--- a/gfx/layers/client/ContentClient.cpp
+++ b/gfx/layers/client/ContentClient.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 "mozilla/layers/ContentClient.h"
 #include "BasicLayers.h"            // for BasicLayerManager
 #include "gfxContext.h"             // for gfxContext, etc
 #include "gfxPlatform.h"            // for gfxPlatform
 #include "gfxEnv.h"                 // for gfxEnv
-#include "gfxPrefs.h"               // for gfxPrefs
+
 #include "gfxPoint.h"               // for IntSize, gfxPoint
 #include "gfxUtils.h"               // for gfxUtils
 #include "ipc/ShadowLayers.h"       // for ShadowLayerForwarder
 #include "mozilla/ArrayUtils.h"     // for ArrayLength
 #include "mozilla/gfx/2D.h"         // for DrawTarget, Factory
 #include "mozilla/gfx/BasePoint.h"  // for BasePoint
 #include "mozilla/gfx/BaseSize.h"   // for BaseSize
 #include "mozilla/gfx/Rect.h"       // for Rect
--- a/gfx/layers/composite/LayerManagerComposite.cpp
+++ b/gfx/layers/composite/LayerManagerComposite.cpp
@@ -20,17 +20,17 @@
 #include "LayerScope.h"                    // for LayerScope Tool
 #include "protobuf/LayerScopePacket.pb.h"  // for protobuf (LayerScope)
 #include "PaintedLayerComposite.h"         // for PaintedLayerComposite
 #include "TiledContentHost.h"
 #include "Units.h"                           // for ScreenIntRect
 #include "UnitTransforms.h"                  // for ViewAs
 #include "apz/src/AsyncPanZoomController.h"  // for AsyncPanZoomController
 #include "gfxEnv.h"                          // for gfxEnv
-#include "gfxPrefs.h"                        // for gfxPrefs
+
 #ifdef XP_MACOSX
 #  include "gfxPlatformMac.h"
 #endif
 #include "gfxRect.h"                    // for gfxRect
 #include "gfxUtils.h"                   // for frame color util
 #include "mozilla/Assertions.h"         // for MOZ_ASSERT, etc
 #include "mozilla/RefPtr.h"             // for RefPtr, already_AddRefed
 #include "mozilla/gfx/2D.h"             // for DrawTarget
--- a/gfx/layers/composite/TextureHost.cpp
+++ b/gfx/layers/composite/TextureHost.cpp
@@ -31,17 +31,17 @@
 #include "mozilla/webrender/WebRenderAPI.h"
 #include "nsAString.h"
 #include "mozilla/RefPtr.h"   // for nsRefPtr
 #include "nsPrintfCString.h"  // for nsPrintfCString
 #include "mozilla/layers/PTextureParent.h"
 #include "mozilla/Unused.h"
 #include <limits>
 #include "../opengl/CompositorOGL.h"
-#include "gfxPrefs.h"
+
 #include "gfxUtils.h"
 #include "IPDLActor.h"
 
 #ifdef MOZ_ENABLE_D3D10_LAYER
 #  include "../d3d11/CompositorD3D11.h"
 #endif
 
 #ifdef MOZ_X11
--- a/gfx/layers/ipc/CompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/CompositorBridgeParent.cpp
@@ -25,17 +25,16 @@
 #  include "gfxPlatformGtk.h"  // for gfxPlatform
 #endif
 #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
 #include "mozilla/gfx/gfxVars.h"
 #include "mozilla/gfx/GPUParent.h"
 #include "mozilla/layers/AnimationHelper.h"  // for CompositorAnimationStorage
--- a/gfx/layers/ipc/ISurfaceAllocator.cpp
+++ b/gfx/layers/ipc/ISurfaceAllocator.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 "ISurfaceAllocator.h"
 
-#include "gfxPrefs.h"
 #include "mozilla/layers/ImageBridgeParent.h"  // for ImageBridgeParent
 #include "mozilla/layers/TextureHost.h"        // for TextureHost
 #include "mozilla/layers/TextureForwarder.h"
 #include "mozilla/layers/CompositableForwarder.h"
 
 namespace mozilla {
 namespace layers {
 
--- a/gfx/layers/ipc/ShadowLayers.cpp
+++ b/gfx/layers/ipc/ShadowLayers.cpp
@@ -9,17 +9,17 @@
 #include <set>                  // for _Rb_tree_const_iterator, etc
 #include <vector>               // for vector
 #include "GeckoProfiler.h"      // for AUTO_PROFILER_LABEL
 #include "ISurfaceAllocator.h"  // for IsSurfaceDescriptorValid
 #include "Layers.h"             // for Layer
 #include "RenderTrace.h"        // for RenderTraceScope
 #include "gfx2DGlue.h"          // for Moz2D transition helpers
 #include "gfxPlatform.h"        // for gfxImageFormat, gfxPlatform
-#include "gfxPrefs.h"
+
 //#include "gfxSharedImageSurface.h"      // for gfxSharedImageSurface
 #include "ipc/IPCMessageUtils.h"  // for gfxContentType, null_t
 #include "IPDLActor.h"
 #include "mozilla/Assertions.h"  // for MOZ_ASSERT, etc
 #include "mozilla/dom/TabGroup.h"
 #include "mozilla/gfx/Point.h"                  // for IntSize
 #include "mozilla/layers/CompositableClient.h"  // for CompositableClient, etc
 #include "mozilla/layers/CompositorBridgeChild.h"
--- a/gfx/layers/wr/WebRenderLayerManager.cpp
+++ b/gfx/layers/wr/WebRenderLayerManager.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 "WebRenderLayerManager.h"
 
 #include "BasicLayers.h"
-#include "gfxPrefs.h"
+
 #include "GeckoProfiler.h"
 #include "LayersLogging.h"
 #include "mozilla/dom/BrowserChild.h"
 #include "mozilla/dom/TabGroup.h"
 #include "mozilla/gfx/DrawEventRecorder.h"
 #include "mozilla/layers/CompositorBridgeChild.h"
 #include "mozilla/layers/StackingContextHelper.h"
 #include "mozilla/layers/TextureClient.h"
--- a/gfx/tests/gtest/TestCompositor.cpp
+++ b/gfx/tests/gtest/TestCompositor.cpp
@@ -1,14 +1,13 @@
 /* vim:set ts=2 sw=2 sts=2 et: */
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
-#include "gfxPrefs.h"
 #include "gfxUtils.h"
 #include "gtest/gtest.h"
 #include "TestLayers.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/layers/BasicCompositor.h"  // for BasicCompositor
 #include "mozilla/layers/Compositor.h"       // for Compositor
 #include "mozilla/layers/CompositorOGL.h"    // for CompositorOGL
deleted file mode 100644
--- a/gfx/tests/gtest/TestGfxPrefs.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/* -*- 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 "gtest/gtest.h"
-
-#include "gfxPrefs.h"
-#ifdef GFX_DECL_PREF
-#  error "This is not supposed to be defined outside of gfxPrefs.h"
-#endif
-
-// If the default values for any of these preferences change,
-// just modify the test to match. We are only testing against
-// a particular value to make sure we receive the correct
-// result through this API.
-
-TEST(GfxPrefs, Singleton)
-{
-  gfxPrefs::GetSingleton();
-  ASSERT_TRUE(gfxPrefs::SingletonExists());
-}
-
-TEST(GfxPrefs, OnceValues)
-{
-  gfxPrefs::GetSingleton();
-  ASSERT_TRUE(gfxPrefs::SingletonExists());
-
-  // Once boolean, default true
-  ASSERT_TRUE(StaticPrefs::WorkAroundDriverBugs());
-
-  // Once boolean, default false
-  ASSERT_FALSE(StaticPrefs::UseApitrace());
-
-  // Once uint32_t, default 5
-  ASSERT_TRUE(StaticPrefs::APZMaxVelocityQueueSize() == 5);
-
-  // Once float, default 0 (should be OK with ==)
-  ASSERT_TRUE(StaticPrefs::APZCurveFunctionX1() == 0.0f);
-}
-
-TEST(GfxPrefs, Set)
-{
-  gfxPrefs::GetSingleton();
-  ASSERT_TRUE(gfxPrefs::SingletonExists());
-
-  // Once boolean, default false
-  ASSERT_FALSE(StaticPrefs::UseApitrace());
-  StaticPrefs::SetUseApitrace(true);
-  ASSERT_TRUE(StaticPrefs::UseApitrace());
-  StaticPrefs::SetUseApitrace(false);
-  ASSERT_FALSE(StaticPrefs::UseApitrace());
-
-  // Once float, default 0
-  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[] = {
-      13.4,
-      3324243.42,
-      0.332424342,
-      864.0,
-      86400 * 100000000.0 * 10000000000.0 * 10000000000.0 * 100.0,
-      86400.0 * 366.0 * 100.0 + 14243.44332};
-  for (size_t i = 0; i < mozilla::ArrayLength(testVal); i++) {
-    ASSERT_TRUE(SimpleNoCLibDtoA(testVal[i], testBuffer, sizeof(testBuffer)));
-    ASSERT_TRUE(fabs(1.0 - atof(testBuffer) / testVal[i]) < 0.0001);
-  }
-
-  // We do not like negative numbers (random limitation)
-  ASSERT_FALSE(SimpleNoCLibDtoA(-864.0, testBuffer, sizeof(testBuffer)));
-
-  // It won't fit into 32:
-  ASSERT_FALSE(
-      SimpleNoCLibDtoA(testVal[4], testBuffer, sizeof(testBuffer) / 2));
-}
--- a/gfx/tests/gtest/TestTextureCompatibility.cpp
+++ b/gfx/tests/gtest/TestTextureCompatibility.cpp
@@ -17,16 +17,17 @@
 #include "TestLayers.h"
 #include "TextureHelper.h"
 
 using mozilla::gfx::Feature;
 using mozilla::gfx::gfxConfig;
 using mozilla::layers::BasicCompositor;
 using mozilla::layers::Compositor;
 using mozilla::layers::CompositorOptions;
+using mozilla::layers::ISurfaceAllocator;
 using mozilla::layers::LayersBackend;
 using mozilla::layers::TestSurfaceAllocator;
 using mozilla::layers::TextureClient;
 using mozilla::layers::TextureHost;
 using mozilla::widget::CompositorWidget;
 using mozilla::widget::InProcessCompositorWidget;
 
 /**
--- a/gfx/tests/gtest/TestVsync.cpp
+++ b/gfx/tests/gtest/TestVsync.cpp
@@ -1,17 +1,17 @@
 /* vim:set ts=2 sw=2 sts=2 et: */
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
 #include "gfxPlatform.h"
-#include "gfxPrefs.h"
+
 #include "MainThreadUtils.h"
 #include "nsIThread.h"
 #include "mozilla/RefPtr.h"
 #include "SoftwareVsyncSource.h"
 #include "VsyncSource.h"
 #include "mozilla/Monitor.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/VsyncDispatcher.h"
@@ -65,17 +65,16 @@ class TestVsyncObserver : public VsyncOb
  private:
   Monitor mVsyncMonitor;
 };
 
 class VsyncTester : public ::testing::Test {
  protected:
   explicit VsyncTester() {
     gfxPlatform::GetPlatform();
-    gfxPrefs::GetSingleton();
     mVsyncSource = gfxPlatform::GetPlatform()->GetHardwareVsync();
     MOZ_RELEASE_ASSERT(mVsyncSource, "GFX: Vsync source not found.");
   }
 
   virtual ~VsyncTester() { mVsyncSource = nullptr; }
 
   RefPtr<VsyncSource> mVsyncSource;
 };
--- a/gfx/tests/gtest/moz.build
+++ b/gfx/tests/gtest/moz.build
@@ -30,17 +30,16 @@ UNIFIED_SOURCES += [
 if not(CONFIG['OS_TARGET'] == 'WINNT' and CONFIG['CPU_ARCH'] == 'aarch64'):
     UNIFIED_SOURCES += [
         'TestVsync.cpp',
     ]
 
 if CONFIG['OS_TARGET'] != 'Android':
     UNIFIED_SOURCES += [
         'TestCompositor.cpp',
-        'TestGfxPrefs.cpp',
         'TestRect.cpp',
         'TestTextureCompatibility.cpp',
     ]
 
 UNIFIED_SOURCES += [ '/gfx/2d/unittest/%s' % p for p in [
     'TestBase.cpp',
     'TestBugs.cpp',
     'TestCairo.cpp',
--- a/gfx/tests/marionette/test_pref_rollout_workaround.py
+++ b/gfx/tests/marionette/test_pref_rollout_workaround.py
@@ -19,17 +19,17 @@ class WrPrefRolloutWorkAroundTestCase(Ma
        Normandy sets default prefs when rolling out a pref change, but
        gfx starts up before Normandy can set the pref's default value
        so we save the default value on shutdown, and check it on startup.
        This test verifies that we save and load the default value,
        and that the right compositor is enabled due to the rollout.
     '''
 
     def test_wr_rollout_workaround_on_non_qualifying_hw(self):
-        # Override the gfxPref so that WR is not enabled, as it would be before a rollout.
+        # Override the StaticPrefs so that WR is not enabled, as it would be before a rollout.
         self.marionette.set_pref(pref=gfx_rollout_override, value=False)
         # Set HW override so we behave as if we on non-qualifying hardware.
         self.marionette.set_pref(pref=hw_qualified_override, value=False)
         # Ensure we don't fallback to the basic compositor for some spurious reason.
         self.marionette.set_pref(pref='layers.acceleration.force-enabled', value=True)
 
         # Restart browser. Gfx will observe hardware qualification override, and
         # gfx rollout override prefs. We should then be running in a browser which
--- a/gfx/thebes/gfxContext.cpp
+++ b/gfx/thebes/gfxContext.cpp
@@ -12,17 +12,17 @@
 
 #include "gfxContext.h"
 
 #include "gfxMatrix.h"
 #include "gfxUtils.h"
 #include "gfxASurface.h"
 #include "gfxPattern.h"
 #include "gfxPlatform.h"
-#include "gfxPrefs.h"
+
 #include "GeckoProfiler.h"
 #include "gfx2DGlue.h"
 #include "mozilla/gfx/PathHelpers.h"
 #include "mozilla/gfx/DrawTargetTiled.h"
 #include <algorithm>
 #include "TextDrawTarget.h"
 
 #if XP_WIN
--- a/gfx/thebes/gfxMacPlatformFontList.mm
+++ b/gfx/thebes/gfxMacPlatformFontList.mm
@@ -750,17 +750,17 @@ class gfxMacFontFamily : public gfxFontF
 };
 
 void gfxMacFontFamily::LocalizedName(nsACString& aLocalizedName) {
   nsAutoreleasePool localPool;
 
   // It's unsafe to call HasOtherFamilyNames off the main thread because
   // it entrains FindStyleVariations, which calls GetWeightOverride, which
   // retrieves prefs.  And the pref names can change (via user overrides),
-  // so we can't use gfxPrefs to access them.
+  // so we can't use StaticPrefs to access them.
   if (NS_IsMainThread() && !HasOtherFamilyNames()) {
     aLocalizedName = mName;
     return;
   }
 
   NSString* family = GetNSStringForString(NS_ConvertUTF8toUTF16(mName));
   NSString* localized = [sFontManager localizedNameForFamily:family face:nil];
 
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -27,17 +27,17 @@
 #include "mozilla/IntegerPrintfMacros.h"
 
 #include "mozilla/Logging.h"
 #include "mozilla/Services.h"
 #include "nsAppDirectoryServiceDefs.h"
 
 #include "gfxCrashReporterUtils.h"
 #include "gfxPlatform.h"
-#include "gfxPrefs.h"
+
 #include "gfxEnv.h"
 #include "gfxTextRun.h"
 #include "gfxUserFontSet.h"
 #include "gfxConfig.h"
 #include "VRProcessManager.h"
 #include "VRThread.h"
 
 #ifdef XP_WIN
@@ -837,18 +837,16 @@ void gfxPlatform::Init() {
   MOZ_RELEASE_ASSERT(!XRE_IsRDDProcess(), "GFX: Not allowed in RDD process.");
   MOZ_RELEASE_ASSERT(NS_IsMainThread(), "GFX: Not in main thread.");
 
   if (gEverInitialized) {
     MOZ_CRASH("Already started???");
   }
   gEverInitialized = true;
 
-  // Initialize the preferences by creating the singleton.
-  gfxPrefs::GetSingleton();
   gfxVars::Initialize();
 
   gfxConfig::Init();
 
   if (XRE_IsParentProcess() || recordreplay::IsRecordingOrReplaying()) {
     GPUProcessManager::Initialize();
     RDDProcessManager::Initialize();
 
@@ -1235,17 +1233,16 @@ void gfxPlatform::Shutdown() {
     RDDProcessManager::Shutdown();
   }
 
   gfx::Factory::ShutDown();
 
   delete gGfxPlatformPrefsLock;
 
   gfxVars::Shutdown();
-  gfxPrefs::DestroySingleton();
   gfxFont::DestroySingletons();
 
   gfxConfig::Shutdown();
 
   gPlatform->WillShutdown();
 
   delete gPlatform;
   gPlatform = nullptr;
@@ -2346,18 +2343,16 @@ void gfxPlatform::InitAcceleration() {
   InitCompositorAccelerationPrefs();
 
   // If this is called for the first time on a non-main thread, we're screwed.
   // At the moment there's no explicit guarantee that the main thread calls
   // this before the compositor thread, but let's at least make the assumption
   // explicit.
   MOZ_ASSERT(NS_IsMainThread(), "can only initialize prefs on the main thread");
 
-  gfxPrefs::GetSingleton();
-
   nsCOMPtr<nsIGfxInfo> gfxInfo = services::GetGfxInfo();
   nsCString discardFailureId;
   int32_t status;
 
   if (XRE_IsParentProcess()) {
     gfxVars::SetBrowserTabsRemoteAutostart(BrowserTabsRemoteAutostart());
     gfxVars::SetOffscreenFormat(GetOffscreenFormat());
     gfxVars::SetRequiresAcceleratedGLContextForCompositorOGL(
@@ -3237,21 +3232,16 @@ bool gfxPlatform::AsyncPanZoomEnabled() 
   // this requirement.
   if (!BrowserTabsRemoteAutostart()) {
     return false;
   }
 #endif
 #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 StaticPrefs::AsyncPanZoomEnabledDoNotUseDirectly();
 #endif
 }
 
 /*static*/
 bool gfxPlatform::PerfWarnings() { return StaticPrefs::PerfWarnings(); }
 
 void gfxPlatform::GetAcceleratedCompositorBackends(
deleted file mode 100644
--- a/gfx/thebes/gfxPrefs.cpp
+++ /dev/null
@@ -1,277 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; 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 "gfxPrefs.h"
-
-#include "MainThreadUtils.h"
-#include "nsXULAppAPI.h"
-#include "mozilla/Preferences.h"
-#include "mozilla/Unused.h"
-#include "mozilla/gfx/gfxVars.h"
-#include "mozilla/gfx/Logging.h"
-#include "mozilla/gfx/GPUChild.h"
-#include "mozilla/gfx/GPUProcessManager.h"
-#include "VRProcessManager.h"
-#include "VRChild.h"
-
-using namespace mozilla;
-
-nsTArray<gfxPrefs::Pref*>* gfxPrefs::sGfxPrefList = nullptr;
-gfxPrefs* gfxPrefs::sInstance = nullptr;
-bool gfxPrefs::sInstanceHasBeenDestroyed = false;
-
-gfxPrefs& gfxPrefs::CreateAndInitializeSingleton() {
-  MOZ_ASSERT(!sInstanceHasBeenDestroyed,
-             "Should never recreate a gfxPrefs instance!");
-  sGfxPrefList = new nsTArray<Pref*>();
-  sInstance = new gfxPrefs;
-  sInstance->Init();
-  MOZ_ASSERT(SingletonExists());
-  return *sInstance;
-}
-
-void gfxPrefs::DestroySingleton() {
-  if (sInstance) {
-    delete sInstance;
-    sInstance = nullptr;
-    sInstanceHasBeenDestroyed = true;
-  }
-  MOZ_ASSERT(!SingletonExists());
-}
-
-bool gfxPrefs::SingletonExists() { return sInstance != nullptr; }
-
-gfxPrefs::gfxPrefs() {
-  // UI, content, and plugin processes use XPCOM and should have prefs
-  // ready by the time we initialize gfxPrefs.
-  MOZ_ASSERT_IF(XRE_IsContentProcess() || XRE_IsParentProcess() ||
-                    XRE_GetProcessType() == GeckoProcessType_Plugin,
-                Preferences::IsServiceAvailable());
-
-  gfxPrefs::AssertMainThread();
-}
-
-void gfxPrefs::Init() {
-}
-
-gfxPrefs::~gfxPrefs() {
-  gfxPrefs::AssertMainThread();
-  delete sGfxPrefList;
-  sGfxPrefList = nullptr;
-}
-
-void gfxPrefs::AssertMainThread() {
-  MOZ_ASSERT(NS_IsMainThread(), "this code must be run on the main thread");
-}
-
-void gfxPrefs::Pref::OnChange() {
-  FireChangeCallback();
-}
-
-void gfxPrefs::Pref::FireChangeCallback() {
-  if (mChangeCallback) {
-    GfxPrefValue value;
-    GetLiveValue(&value);
-    mChangeCallback(value);
-  }
-}
-
-void gfxPrefs::Pref::SetChangeCallback(ChangeCallback aCallback) {
-  mChangeCallback = aCallback;
-
-  if (!IsParentProcess() && IsPrefsServiceAvailable()) {
-    // If we're in the parent process, we watch prefs by default so we can
-    // send changes over to the GPU process. Otherwise, we need to add or
-    // remove a watch for the pref now.
-    if (aCallback) {
-      WatchChanges(Name(), this);
-    } else {
-      UnwatchChanges(Name(), this);
-    }
-  }
-
-  // Fire the callback once to make initialization easier for the caller.
-  FireChangeCallback();
-}
-
-// On lightweight processes such as for GMP and GPU, XPCOM is not initialized,
-// and therefore we don't have access to Preferences. When XPCOM is not
-// available we rely on manual synchronization of gfxPrefs values over IPC.
-/* static */
-bool gfxPrefs::IsPrefsServiceAvailable() {
-  return Preferences::IsServiceAvailable();
-}
-
-/* static */
-bool gfxPrefs::IsParentProcess() { return XRE_IsParentProcess(); }
-
-void gfxPrefs::PrefAddVarCache(bool* aVariable, const nsACString& aPref,
-                               bool aDefault) {
-  MOZ_ASSERT(IsPrefsServiceAvailable());
-  Preferences::AddBoolVarCache(aVariable, aPref, aDefault);
-}
-
-void gfxPrefs::PrefAddVarCache(int32_t* aVariable, const nsACString& aPref,
-                               int32_t aDefault) {
-  MOZ_ASSERT(IsPrefsServiceAvailable());
-  Preferences::AddIntVarCache(aVariable, aPref, aDefault);
-}
-
-void gfxPrefs::PrefAddVarCache(uint32_t* aVariable, const nsACString& aPref,
-                               uint32_t aDefault) {
-  MOZ_ASSERT(IsPrefsServiceAvailable());
-  Preferences::AddUintVarCache(aVariable, aPref, aDefault);
-}
-
-void gfxPrefs::PrefAddVarCache(float* aVariable, const nsACString& aPref,
-                               float aDefault) {
-  MOZ_ASSERT(IsPrefsServiceAvailable());
-  Preferences::AddFloatVarCache(aVariable, aPref, aDefault);
-}
-
-void gfxPrefs::PrefAddVarCache(std::string* aVariable, const nsCString& aPref,
-                               std::string aDefault) {
-  MOZ_ASSERT(IsPrefsServiceAvailable());
-  Preferences::SetCString(aPref.get(), aVariable->c_str());
-}
-
-void gfxPrefs::PrefAddVarCache(AtomicBool* aVariable, const nsACString& aPref,
-                               bool aDefault) {
-  MOZ_ASSERT(IsPrefsServiceAvailable());
-  Preferences::AddAtomicBoolVarCache(aVariable, aPref, aDefault);
-}
-
-void gfxPrefs::PrefAddVarCache(AtomicInt32* aVariable, const nsACString& aPref,
-                               int32_t aDefault) {
-  MOZ_ASSERT(IsPrefsServiceAvailable());
-  Preferences::AddAtomicIntVarCache(aVariable, aPref, aDefault);
-}
-
-void gfxPrefs::PrefAddVarCache(AtomicUint32* aVariable, const nsACString& aPref,
-                               uint32_t aDefault) {
-  MOZ_ASSERT(IsPrefsServiceAvailable());
-  Preferences::AddAtomicUintVarCache(aVariable, aPref, aDefault);
-}
-
-bool gfxPrefs::PrefGet(const char* aPref, bool aDefault) {
-  MOZ_ASSERT(IsPrefsServiceAvailable());
-  return Preferences::GetBool(aPref, aDefault);
-}
-
-int32_t gfxPrefs::PrefGet(const char* aPref, int32_t aDefault) {
-  MOZ_ASSERT(IsPrefsServiceAvailable());
-  return Preferences::GetInt(aPref, aDefault);
-}
-
-uint32_t gfxPrefs::PrefGet(const char* aPref, uint32_t aDefault) {
-  MOZ_ASSERT(IsPrefsServiceAvailable());
-  return Preferences::GetUint(aPref, aDefault);
-}
-
-float gfxPrefs::PrefGet(const char* aPref, float aDefault) {
-  MOZ_ASSERT(IsPrefsServiceAvailable());
-  return Preferences::GetFloat(aPref, aDefault);
-}
-
-std::string gfxPrefs::PrefGet(const char* aPref, std::string aDefault) {
-  MOZ_ASSERT(IsPrefsServiceAvailable());
-
-  nsAutoCString result;
-  Preferences::GetCString(aPref, result);
-
-  if (result.IsEmpty()) {
-    return aDefault;
-  }
-
-  return result.get();
-}
-
-void gfxPrefs::PrefSet(const char* aPref, bool aValue) {
-  MOZ_ASSERT(IsPrefsServiceAvailable());
-  Preferences::SetBool(aPref, aValue);
-}
-
-void gfxPrefs::PrefSet(const char* aPref, int32_t aValue) {
-  MOZ_ASSERT(IsPrefsServiceAvailable());
-  Preferences::SetInt(aPref, aValue);
-}
-
-void gfxPrefs::PrefSet(const char* aPref, uint32_t aValue) {
-  MOZ_ASSERT(IsPrefsServiceAvailable());
-  Preferences::SetUint(aPref, aValue);
-}
-
-void gfxPrefs::PrefSet(const char* aPref, float aValue) {
-  MOZ_ASSERT(IsPrefsServiceAvailable());
-  Preferences::SetFloat(aPref, aValue);
-}
-
-void gfxPrefs::PrefSet(const char* aPref, std::string aValue) {
-  MOZ_ASSERT(IsPrefsServiceAvailable());
-  Preferences::SetCString(aPref, aValue.c_str());
-}
-
-static void OnGfxPrefChanged(const char* aPrefname, gfxPrefs::Pref* aPref) {
-  aPref->OnChange();
-}
-
-void gfxPrefs::WatchChanges(const char* aPrefname, Pref* aPref) {
-  MOZ_ASSERT(IsPrefsServiceAvailable());
-  nsCString name;
-  name.AssignLiteral(aPrefname, strlen(aPrefname));
-  Preferences::RegisterCallback(OnGfxPrefChanged, name, aPref);
-}
-
-void gfxPrefs::UnwatchChanges(const char* aPrefname, Pref* aPref) {
-  // The Preferences service can go offline before gfxPrefs is destroyed.
-  if (IsPrefsServiceAvailable()) {
-    Preferences::UnregisterCallback(OnGfxPrefChanged,
-                                    nsDependentCString(aPrefname), aPref);
-  }
-}
-
-void gfxPrefs::CopyPrefValue(const bool* aValue, GfxPrefValue* aOutValue) {
-  *aOutValue = *aValue;
-}
-
-void gfxPrefs::CopyPrefValue(const int32_t* aValue, GfxPrefValue* aOutValue) {
-  *aOutValue = *aValue;
-}
-
-void gfxPrefs::CopyPrefValue(const uint32_t* aValue, GfxPrefValue* aOutValue) {
-  *aOutValue = *aValue;
-}
-
-void gfxPrefs::CopyPrefValue(const float* aValue, GfxPrefValue* aOutValue) {
-  *aOutValue = *aValue;
-}
-
-void gfxPrefs::CopyPrefValue(const std::string* aValue,
-                             GfxPrefValue* aOutValue) {
-  *aOutValue = nsCString(aValue->c_str());
-}
-
-void gfxPrefs::CopyPrefValue(const GfxPrefValue* aValue, bool* aOutValue) {
-  *aOutValue = aValue->get_bool();
-}
-
-void gfxPrefs::CopyPrefValue(const GfxPrefValue* aValue, int32_t* aOutValue) {
-  *aOutValue = aValue->get_int32_t();
-}
-
-void gfxPrefs::CopyPrefValue(const GfxPrefValue* aValue, uint32_t* aOutValue) {
-  *aOutValue = aValue->get_uint32_t();
-}
-
-void gfxPrefs::CopyPrefValue(const GfxPrefValue* aValue, float* aOutValue) {
-  *aOutValue = aValue->get_float();
-}
-
-void gfxPrefs::CopyPrefValue(const GfxPrefValue* aValue,
-                             std::string* aOutValue) {
-  *aOutValue = aValue->get_nsCString().get();
-}
-
-bool gfxPrefs::OverrideBase_WebRender() { return gfx::gfxVars::UseWebRender(); }
deleted file mode 100644
--- a/gfx/thebes/gfxPrefs.h
+++ /dev/null
@@ -1,370 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; 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/. */
-
-#ifndef GFX_PREFS_H
-#define GFX_PREFS_H
-
-#include <cmath>  // for M_PI
-#include <stdint.h>
-#include <string>
-#include "mozilla/Assertions.h"
-#include "mozilla/Atomics.h"
-#include "mozilla/gfx/LoggingConstants.h"
-#include "nsTArray.h"
-#include "nsString.h"
-
-// First time gfxPrefs::GetSingleton() needs to be called on the main thread,
-// before any of the methods accessing the values are used, but after
-// the Preferences system has been initialized.
-
-// The static methods to access the preference value are safe to call
-// from any thread after that first call.
-
-// To register a preference, you need to add a line in this file using
-// the DECL_GFX_PREF macro.
-//
-// Update argument controls whether we read the preference value and save it
-// or connect with a callback.  See UpdatePolicy enum below.
-// Pref is the string with the preference name.
-// Name argument is the name of the static function to create.
-// Type is the type of the preference - bool, int32_t, uint32_t.
-// Default is the default value for the preference.
-//
-// For example this line in the .h:
-//   DECL_GFX_PREF(Once,"layers.dump",LayersDump,bool,false);
-// means that you can call
-//   bool var = gfxPrefs::LayersDump();
-// from any thread, but that you will only get the preference value of
-// "layers.dump" as it was set at the start of the session (subject to
-// note 2 below). If the value was not set, the default would be false.
-//
-// In another example, this line in the .h:
-//   DECL_GFX_PREF(Live,"gl.msaa-level",MSAALevel,uint32_t,2);
-// means that every time you call
-//   uint32_t var = gfxPrefs::MSAALevel();
-// from any thread, you will get the most up to date preference value of
-// "gl.msaa-level".  If the value is not set, the default would be 2.
-
-// Note 1: Changing a preference from Live to Once is now as simple
-// as changing the Update argument.  If your code worked before, it will
-// keep working, and behave as if the user never changes the preference.
-// Things are a bit more complicated and perhaps even dangerous when
-// going from Once to Live, or indeed setting a preference to be Live
-// in the first place, so be careful.  You need to be ready for the
-// values changing mid execution, and if you're using those preferences
-// in any setup and initialization, you may need to do extra work.
-
-// Note 2: Prefs can be set by using the corresponding Set method. For
-// example, if the accessor is Foo() then calling SetFoo(...) will update
-// the preference and also change the return value of subsequent Foo() calls.
-// This is true even for 'Once' prefs which otherwise do not change if the
-// pref is updated after initialization. Changing gfxPrefs values in content
-// processes will not affect the result in other processes. Changing gfxPrefs
-// values in the GPU process is not supported at all.
-
-#define DECL_GFX_PREF(Update, Prefname, Name, Type, Default)              \
- public:                                                                  \
-  static Type Name() {                                                    \
-    MOZ_ASSERT(SingletonExists());                                        \
-    return GetSingleton().mPref##Name.mValue;                             \
-  }                                                                       \
-  static void Set##Name(Type aVal) {                                      \
-    MOZ_ASSERT(SingletonExists());                                        \
-    GetSingleton().mPref##Name.Set(UpdatePolicy::Update,                  \
-                                   Get##Name##PrefName(), aVal);          \
-  }                                                                       \
-  static const char* Get##Name##PrefName() { return Prefname; }           \
-  static Type Get##Name##PrefDefault() { return Default; }                \
-  static void Set##Name##ChangeCallback(Pref::ChangeCallback aCallback) { \
-    MOZ_ASSERT(SingletonExists());                                        \
-    GetSingleton().mPref##Name.SetChangeCallback(aCallback);              \
-  }                                                                       \
-                                                                          \
- private:                                                                 \
-  PrefTemplate<UpdatePolicy::Update, Type, Get##Name##PrefDefault,        \
-               Get##Name##PrefName>                                       \
-      mPref##Name
-
-// This declares an "override" pref, which is exposed as a "bool" pref by the
-// API, but is internally stored as a tri-state int pref with three possible
-// values:
-// - A value of 0 means that it has been force-disabled, and is exposed as a
-//   false-valued bool.
-// - A value of 1 means that it has been force-enabled, and is exposed as a
-//   true-valued bool.
-// - A value of 2 (the default) means that it returns the provided BaseValue
-//   as a boolean. The BaseValue may be a constant expression or a function.
-// If the prefs defined with this macro are listed in prefs files (e.g. all.js),
-// then they must be listed with an int value (default to 2, but you can use 0
-// or 1 if you want to force it on or off).
-#define DECL_OVERRIDE_PREF(Update, Prefname, Name, BaseValue)             \
- public:                                                                  \
-  static bool Name() {                                                    \
-    MOZ_ASSERT(SingletonExists());                                        \
-    int32_t val = GetSingleton().mPref##Name.mValue;                      \
-    return val == 2 ? !!(BaseValue) : !!val;                              \
-  }                                                                       \
-  static void Set##Name(bool aVal) {                                      \
-    MOZ_ASSERT(SingletonExists());                                        \
-    GetSingleton().mPref##Name.Set(UpdatePolicy::Update,                  \
-                                   Get##Name##PrefName(), aVal ? 1 : 0);  \
-  }                                                                       \
-  static const char* Get##Name##PrefName() { return Prefname; }           \
-  static int32_t Get##Name##PrefDefault() { return 2; }                   \
-  static void Set##Name##ChangeCallback(Pref::ChangeCallback aCallback) { \
-    MOZ_ASSERT(SingletonExists());                                        \
-    GetSingleton().mPref##Name.SetChangeCallback(aCallback);              \
-  }                                                                       \
-                                                                          \
- private:                                                                 \
-  PrefTemplate<UpdatePolicy::Update, int32_t, Get##Name##PrefDefault,     \
-               Get##Name##PrefName>                                       \
-      mPref##Name
-
-namespace mozilla {
-namespace gfx {
-class GfxPrefValue;  // defined in PGPU.ipdl
-}  // namespace gfx
-}  // namespace mozilla
-
-class gfxPrefs;
-class gfxPrefs final {
-  typedef mozilla::gfx::GfxPrefValue GfxPrefValue;
-
-  typedef mozilla::Atomic<bool, mozilla::Relaxed> AtomicBool;
-  typedef mozilla::Atomic<int32_t, mozilla::Relaxed> AtomicInt32;
-  typedef mozilla::Atomic<uint32_t, mozilla::Relaxed> AtomicUint32;
-
- private:
-  // Enums for the update policy.
-  enum class UpdatePolicy {
-    Skip,  // Set the value to default, skip any Preferences calls
-    Once,  // Evaluate the preference once, unchanged during the session
-    Live   // Evaluate the preference and set callback so it stays current/live
-  };
-
- public:
-  class Pref {
-   public:
-    Pref() : mChangeCallback(nullptr) {
-      mIndex = sGfxPrefList->Length();
-      sGfxPrefList->AppendElement(this);
-    }
-
-    size_t Index() const { return mIndex; }
-    void OnChange();
-
-    typedef void (*ChangeCallback)(const GfxPrefValue&);
-    void SetChangeCallback(ChangeCallback aCallback);
-
-    virtual const char* Name() const = 0;
-
-    // Returns true if the value is default, false if changed.
-    virtual bool HasDefaultValue() const = 0;
-
-    // Returns the pref value as a discriminated union.
-    virtual void GetLiveValue(GfxPrefValue* aOutValue) const = 0;
-
-    // Returns the pref value as a discriminated union.
-    virtual void GetCachedValue(GfxPrefValue* aOutValue) const = 0;
-
-    // Change the cached value. GfxPrefValue must be a compatible type.
-    virtual void SetCachedValue(const GfxPrefValue& aOutValue) = 0;
-
-   protected:
-    void FireChangeCallback();
-
-   private:
-    size_t mIndex;
-    ChangeCallback mChangeCallback;
-  };
-
-  static const nsTArray<Pref*>& all() { return *sGfxPrefList; }
-
- private:
-  // We split out a base class to reduce the number of virtual function
-  // instantiations that we do, which saves code size.
-  template <class T>
-  class TypedPref : public Pref {
-   public:
-    explicit TypedPref(T aValue) : mValue(aValue) {}
-
-    void GetCachedValue(GfxPrefValue* aOutValue) const override {
-      CopyPrefValue(&mValue, aOutValue);
-    }
-    void SetCachedValue(const GfxPrefValue& aOutValue) override {
-      T newValue;
-      CopyPrefValue(&aOutValue, &newValue);
-
-      if (mValue != newValue) {
-        mValue = newValue;
-        FireChangeCallback();
-      }
-    }
-
-   protected:
-    T GetLiveValueByName(const char* aPrefName) const {
-      if (IsPrefsServiceAvailable()) {
-        return PrefGet(aPrefName, mValue);
-      }
-      return mValue;
-    }
-
-   public:
-    T mValue;
-  };
-
-  // Since we cannot use const char*, use a function that returns it.
-  template <UpdatePolicy Update, class T, T Default(void),
-            const char* Prefname(void)>
-  class PrefTemplate final : public TypedPref<T> {
-    typedef TypedPref<T> BaseClass;
-
-   public:
-    PrefTemplate() : BaseClass(Default()) {
-      // If not using the Preferences service, values are synced over IPC, so
-      // there's no need to register us as a Preferences observer.
-      if (IsPrefsServiceAvailable()) {
-        Register(Update, Prefname());
-      }
-      // By default we only watch changes in the parent process, to communicate
-      // changes to the GPU process.
-      if (IsParentProcess() && Update == UpdatePolicy::Live) {
-        WatchChanges(Prefname(), this);
-      }
-    }
-    ~PrefTemplate() {
-      if (IsParentProcess() && Update == UpdatePolicy::Live) {
-        UnwatchChanges(Prefname(), this);
-      }
-    }
-    void Register(UpdatePolicy aUpdate, const char* aPreference) {
-      AssertMainThread();
-      switch (aUpdate) {
-        case UpdatePolicy::Skip:
-          break;
-        case UpdatePolicy::Once:
-          this->mValue = PrefGet(aPreference, this->mValue);
-          break;
-        case UpdatePolicy::Live: {
-          nsCString pref;
-          pref.AssignLiteral(aPreference, strlen(aPreference));
-          PrefAddVarCache(&this->mValue, pref, this->mValue);
-        } break;
-        default:
-          MOZ_CRASH("Incomplete switch");
-      }
-    }
-    void Set(UpdatePolicy aUpdate, const char* aPref, T aValue) {
-      AssertMainThread();
-      PrefSet(aPref, aValue);
-      switch (aUpdate) {
-        case UpdatePolicy::Skip:
-        case UpdatePolicy::Live:
-          break;
-        case UpdatePolicy::Once:
-          this->mValue = PrefGet(aPref, this->mValue);
-          break;
-        default:
-          MOZ_CRASH("Incomplete switch");
-      }
-    }
-    const char* Name() const override { return Prefname(); }
-    void GetLiveValue(GfxPrefValue* aOutValue) const override {
-      T value = GetLiveValue();
-      CopyPrefValue(&value, aOutValue);
-    }
-    // When using the Preferences service, the change callback can be triggered
-    // *before* our cached value is updated, so we expose a method to grab the
-    // true live value.
-    T GetLiveValue() const { return BaseClass::GetLiveValueByName(Prefname()); }
-    bool HasDefaultValue() const override { return this->mValue == Default(); }
-  };
-
-  // 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.
-
-  // 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
-
- public:
-  // Manage the singleton:
-  static gfxPrefs& GetSingleton() {
-    return sInstance ? *sInstance : CreateAndInitializeSingleton();
-  }
-  static void DestroySingleton();
-  static bool SingletonExists();
-
- private:
-  static gfxPrefs& CreateAndInitializeSingleton();
-
-  static gfxPrefs* sInstance;
-  static bool sInstanceHasBeenDestroyed;
-  static nsTArray<Pref*>* sGfxPrefList;
-
- private:
-  // The constructor cannot access GetSingleton(), since sInstance (necessarily)
-  // has not been assigned yet. Follow-up initialization that needs
-  // GetSingleton() must be added to Init().
-  void Init();
-
-  static bool IsPrefsServiceAvailable();
-  static bool IsParentProcess();
-  // Creating these to avoid having to include Preferences.h in the .h
-  static void PrefAddVarCache(bool*, const nsACString&, bool);
-  static void PrefAddVarCache(int32_t*, const nsACString&, int32_t);
-  static void PrefAddVarCache(uint32_t*, const nsACString&, uint32_t);
-  static void PrefAddVarCache(float*, const nsACString&, float);
-  static void PrefAddVarCache(std::string*, const nsCString&, std::string);
-  static void PrefAddVarCache(AtomicBool*, const nsACString&, bool);
-  static void PrefAddVarCache(AtomicInt32*, const nsACString&, int32_t);
-  static void PrefAddVarCache(AtomicUint32*, const nsACString&, uint32_t);
-  static bool PrefGet(const char*, bool);
-  static int32_t PrefGet(const char*, int32_t);
-  static uint32_t PrefGet(const char*, uint32_t);
-  static float PrefGet(const char*, float);
-  static std::string PrefGet(const char*, std::string);
-  static void PrefSet(const char* aPref, bool aValue);
-  static void PrefSet(const char* aPref, int32_t aValue);
-  static void PrefSet(const char* aPref, uint32_t aValue);
-  static void PrefSet(const char* aPref, float aValue);
-  static void PrefSet(const char* aPref, std::string aValue);
-  static void WatchChanges(const char* aPrefname, Pref* aPref);
-  static void UnwatchChanges(const char* aPrefname, Pref* aPref);
-  // Creating these to avoid having to include PGPU.h in the .h
-  static void CopyPrefValue(const bool* aValue, GfxPrefValue* aOutValue);
-  static void CopyPrefValue(const int32_t* aValue, GfxPrefValue* aOutValue);
-  static void CopyPrefValue(const uint32_t* aValue, GfxPrefValue* aOutValue);
-  static void CopyPrefValue(const float* aValue, GfxPrefValue* aOutValue);
-  static void CopyPrefValue(const std::string* aValue, GfxPrefValue* aOutValue);
-  static void CopyPrefValue(const GfxPrefValue* aValue, bool* aOutValue);
-  static void CopyPrefValue(const GfxPrefValue* aValue, int32_t* aOutValue);
-  static void CopyPrefValue(const GfxPrefValue* aValue, uint32_t* aOutValue);
-  static void CopyPrefValue(const GfxPrefValue* aValue, float* aOutValue);
-  static void CopyPrefValue(const GfxPrefValue* aValue, std::string* aOutValue);
-
-  static void AssertMainThread();
-
-  // Some wrapper functions for the DECL_OVERRIDE_PREF prefs' base values, so
-  // that we don't to include all sorts of header files into this gfxPrefs.h
-  // file.
-  static bool OverrideBase_WebRender();
-
-  gfxPrefs();
-  ~gfxPrefs();
-  gfxPrefs(const gfxPrefs&) = delete;
-  gfxPrefs& operator=(const gfxPrefs&) = delete;
-};
-
-#undef DECL_GFX_PREF /* Don't need it outside of this file */
-
-#endif /* GFX_PREFS_H */
--- a/gfx/thebes/moz.build
+++ b/gfx/thebes/moz.build
@@ -37,17 +37,16 @@ EXPORTS += [
     'gfxImageSurface.h',
     'gfxLineSegment.h',
     'gfxMathTable.h',
     'gfxMatrix.h',
     'gfxPattern.h',
     'gfxPlatform.h',
     'gfxPlatformFontList.h',
     'gfxPoint.h',
-    'gfxPrefs.h',
     'gfxQuad.h',
     'gfxQuaternion.h',
     'gfxRect.h',
     'gfxSharedImageSurface.h',
     'gfxSkipChars.h',
     'gfxSVGGlyphs.h',
     'gfxTextRun.h',
     'gfxTypes.h',
@@ -175,17 +174,16 @@ SOURCES += [
     'gfxASurface.cpp',
     # on X11, gfxDrawable.cpp includes X headers for an old workaround which
     # we could consider removing soon (affects Ubuntus older than 10.04 LTS)
     # which currently prevent it from joining UNIFIED_SOURCES.
     'gfxDrawable.cpp',
     # gfxFontUtils.cpp and gfxPlatform.cpp include mac system header conflicting with point/size
     'gfxFontUtils.cpp',
     'gfxPlatform.cpp',
-    'gfxPrefs.cpp',
     'PrintTarget.cpp',
     'PrintTargetThebes.cpp',
 ]
 
 UNIFIED_SOURCES += [
     'CJKCompatSVS.cpp',
     'gfxAlphaRecovery.cpp',
     'gfxBaseSharedMemorySurface.cpp',
--- a/gfx/vr/VRDisplayClient.cpp
+++ b/gfx/vr/VRDisplayClient.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 <math.h>
 
 #include "prlink.h"
 #include "prenv.h"
-#include "gfxPrefs.h"
+
 #include "nsIGlobalObject.h"
 #include "nsRefPtrHashtable.h"
 #include "nsString.h"
 #include "mozilla/dom/GamepadManager.h"
 #include "mozilla/dom/Gamepad.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Unused.h"
 #include "nsServiceManagerUtils.h"
--- a/gfx/vr/VRDisplayLocal.cpp
+++ b/gfx/vr/VRDisplayLocal.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 "VRDisplayLocal.h"
 #include "VRThread.h"
-#include "gfxPrefs.h"
+
 #include "gfxVR.h"
 #include "ipc/VRLayerParent.h"
 #include "mozilla/dom/GamepadBinding.h"  // For GamepadMappingType
 #include "mozilla/layers/TextureHost.h"
 
 #if defined(XP_WIN)
 
 #  include <d3d11.h>
--- a/gfx/vr/ipc/VRParent.cpp
+++ b/gfx/vr/ipc/VRParent.cpp
@@ -123,17 +123,16 @@ void VRParent::ActorDestroy(ActorDestroy
   ProcessChild::QuickExit();
 #endif
 
 #if defined(XP_WIN)
   DeviceManagerDx::Shutdown();
 #endif
   gfxVars::Shutdown();
   gfxConfig::Shutdown();
-  gfxPrefs::DestroySingleton();
   CrashReporterClient::DestroySingleton();
   // Only calling XRE_ShutdownChildProcess() at the child process
   // instead of the main process. Otherwise, it will close all child processes
   // that are spawned from the main process.
   XRE_ShutdownChildProcess();
 }
 
 bool VRParent::Init(base::ProcessId aParentPid, const char* aParentBuildID,
@@ -159,18 +158,16 @@ bool VRParent::Init(base::ProcessId aPar
     // We need to quit this process if the buildID doesn't match the parent's.
     // This can occur when an update occurred in the background.
     ProcessChild::QuickExit();
   }
 
   // Init crash reporter support.
   CrashReporterClient::InitSingleton(this);
 
-  // Ensure gfxPrefs are initialized.
-  gfxPrefs::GetSingleton();
   gfxConfig::Init();
   gfxVars::Initialize();
 #if defined(XP_WIN)
   DeviceManagerDx::Init();
 #endif
   if (NS_FAILED(NS_InitMinimalXPCOM())) {
     return false;
   }
--- a/image/DecoderFactory.cpp
+++ b/image/DecoderFactory.cpp
@@ -1,16 +1,15 @@
 /* -*- 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 "DecoderFactory.h"
 
-#include "gfxPrefs.h"
 #include "nsMimeTypes.h"
 #include "mozilla/RefPtr.h"
 
 #include "AnimationSurfaceProvider.h"
 #include "Decoder.h"
 #include "DecodedSurfaceProvider.h"
 #include "IDecodingTask.h"
 #include "ImageOps.h"
--- a/image/Downscaler.cpp
+++ b/image/Downscaler.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 "Downscaler.h"
 
 #include <algorithm>
 #include <ctime>
-#include "gfxPrefs.h"
+
 #include "mozilla/gfx/2D.h"
 
 using std::max;
 using std::swap;
 
 namespace mozilla {
 
 using gfx::IntRect;
--- a/image/DownscalingFilter.h
+++ b/image/DownscalingFilter.h
@@ -18,17 +18,16 @@
 
 #include <algorithm>
 #include <ctime>
 #include <stdint.h>
 
 #include "mozilla/Maybe.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/gfx/2D.h"
-#include "gfxPrefs.h"
 
 #ifdef MOZ_ENABLE_SKIA
 #  include "mozilla/gfx/ConvolutionFilter.h"
 #endif
 
 #include "SurfacePipe.h"
 
 namespace mozilla {
--- a/image/IDecodingTask.cpp
+++ b/image/IDecodingTask.cpp
@@ -1,16 +1,15 @@
 /* -*- 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 "IDecodingTask.h"
 
-#include "gfxPrefs.h"
 #include "nsThreadUtils.h"
 
 #include "Decoder.h"
 #include "DecodePool.h"
 #include "RasterImage.h"
 #include "SurfaceCache.h"
 
 #include "mozilla/SystemGroup.h"
--- a/image/Image.cpp
+++ b/image/Image.cpp
@@ -1,15 +1,15 @@
 /* -*- 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 "Image.h"
-#include "gfxPrefs.h"
+
 #include "Layers.h"  // for LayerManager
 #include "nsRefreshDriver.h"
 #include "nsContentUtils.h"
 #include "mozilla/SizeOfState.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/Tuple.h"  // for Tie
 #include "mozilla/layers/SharedSurfacesChild.h"
 
--- a/image/ImageFactory.cpp
+++ b/image/ImageFactory.cpp
@@ -105,19 +105,16 @@ static void NotifyImageLoading(nsIURI* a
 }
 #endif
 
 /* static */
 already_AddRefed<Image> ImageFactory::CreateImage(
     nsIRequest* aRequest, ProgressTracker* aProgressTracker,
     const nsCString& aMimeType, nsIURI* aURI, bool aIsMultiPart,
     uint32_t aInnerWindowId) {
-  MOZ_ASSERT(gfxPrefs::SingletonExists(),
-             "Pref observers should have been initialized already");
-
   // Compute the image's initialization flags.
   uint32_t imageFlags = ComputeImageFlags(aURI, aMimeType, aIsMultiPart);
 
 #ifdef DEBUG
   // Record the image load for startup performance testing.
   bool match = false;
   if ((NS_SUCCEEDED(aURI->SchemeIs("resource", &match)) && match) ||
       (NS_SUCCEEDED(aURI->SchemeIs("chrome", &match)) && match)) {
--- a/image/build/nsImageModule.cpp
+++ b/image/build/nsImageModule.cpp
@@ -8,32 +8,28 @@
 
 #include "mozilla/ModuleUtils.h"
 
 #include "DecodePool.h"
 #include "ImageFactory.h"
 #include "ShutdownTracker.h"
 #include "SurfaceCache.h"
 
-#include "gfxPrefs.h"
 #include "imgLoader.h"
 
 using namespace mozilla::image;
 
 static bool sInitialized = false;
 nsresult mozilla::image::EnsureModuleInitialized() {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (sInitialized) {
     return NS_OK;
   }
 
-  // Make sure the preferences are initialized
-  gfxPrefs::GetSingleton();
-
   mozilla::image::ShutdownTracker::Initialize();
   mozilla::image::ImageFactory::Initialize();
   mozilla::image::DecodePool::Initialize();
   mozilla::image::SurfaceCache::Initialize();
   imgLoader::GlobalInit();
   sInitialized = true;
   return NS_OK;
 }
--- a/image/imgFrame.cpp
+++ b/image/imgFrame.cpp
@@ -8,17 +8,17 @@
 #include "ImageRegion.h"
 #include "ShutdownTracker.h"
 #include "SurfaceCache.h"
 
 #include "prenv.h"
 
 #include "gfx2DGlue.h"
 #include "gfxPlatform.h"
-#include "gfxPrefs.h"
+
 #include "gfxUtils.h"
 
 #include "GeckoProfiler.h"
 #include "MainThreadUtils.h"
 #include "mozilla/CheckedInt.h"
 #include "mozilla/gfx/gfxVars.h"
 #include "mozilla/gfx/Tools.h"
 #include "mozilla/gfx/SourceSurfaceRawData.h"
--- a/image/test/gtest/Common.cpp
+++ b/image/test/gtest/Common.cpp
@@ -3,17 +3,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 "Common.h"
 
 #include <cstdlib>
 
 #include "gfxPlatform.h"
-#include "gfxPrefs.h"
+
 #include "nsDirectoryServiceDefs.h"
 #include "nsIDirectoryService.h"
 #include "nsIFile.h"
 #include "nsIInputStream.h"
 #include "nsIProperties.h"
 #include "nsNetUtil.h"
 #include "mozilla/RefPtr.h"
 #include "nsStreamUtils.h"
@@ -276,17 +276,16 @@ bool RowHasPixels(SourceSurface* aSurfac
   return true;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 // SurfacePipe Helpers
 ///////////////////////////////////////////////////////////////////////////////
 
 already_AddRefed<Decoder> CreateTrivialDecoder() {
-  gfxPrefs::GetSingleton();
   DecoderType decoderType = DecoderFactory::GetDecoderType("image/gif");
   auto sourceBuffer = MakeNotNull<RefPtr<SourceBuffer>>();
   RefPtr<Decoder> decoder = DecoderFactory::CreateAnonymousDecoder(
       decoderType, sourceBuffer, Nothing(), DefaultDecoderFlags(),
       DefaultSurfaceFlags());
   return decoder.forget();
 }
 
--- a/image/test/gtest/TestBlendAnimationFilter.cpp
+++ b/image/test/gtest/TestBlendAnimationFilter.cpp
@@ -15,17 +15,16 @@
 #include "SurfaceFilters.h"
 #include "SurfacePipe.h"
 
 using namespace mozilla;
 using namespace mozilla::gfx;
 using namespace mozilla::image;
 
 static already_AddRefed<Decoder> CreateTrivialBlendingDecoder() {
-  gfxPrefs::GetSingleton();
   DecoderType decoderType = DecoderFactory::GetDecoderType("image/gif");
   DecoderFlags decoderFlags = DefaultDecoderFlags();
   SurfaceFlags surfaceFlags = DefaultSurfaceFlags();
   auto sourceBuffer = MakeNotNull<RefPtr<SourceBuffer>>();
   return DecoderFactory::CreateAnonymousDecoder(
       decoderType, sourceBuffer, Nothing(), decoderFlags, surfaceFlags);
 }
 
--- a/js/xpconnect/src/XPCShellImpl.cpp
+++ b/js/xpconnect/src/XPCShellImpl.cpp
@@ -34,17 +34,17 @@
 #include "nsCOMPtr.h"
 #include "nsJSPrincipals.h"
 #include "xpcpublic.h"
 #include "xpcprivate.h"
 #include "BackstagePass.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIPrincipal.h"
 #include "nsJSUtils.h"
-#include "gfxPrefs.h"
+
 #include "nsIXULRuntime.h"
 #include "GeckoProfiler.h"
 
 #ifdef ANDROID
 #  include <android/log.h>
 #endif
 
 #ifdef XP_WIN
@@ -1322,18 +1322,16 @@ int XRE_XPCShellMain(int argc, char** ar
     JS::Rooted<JSObject*> glob(cx);
     rv = xpc::InitClassesWithNewWrappedGlobal(
         cx, static_cast<nsIGlobalObject*>(backstagePass), systemprincipal, 0,
         options, &glob);
     if (NS_FAILED(rv)) {
       return 1;
     }
 
-    // Initialize graphics prefs on the main thread, if not already done
-    gfxPrefs::GetSingleton();
     // Initialize e10s check on the main thread, if not already done
     BrowserTabsRemoteAutostart();
 #ifdef XP_WIN
     // Plugin may require audio session if installed plugin can initialize
     // asynchronized.
     AutoAudioSession audioSession;
 
     // Ensure that DLL Services are running
--- a/layout/base/AccessibleCaretEventHub.cpp
+++ b/layout/base/AccessibleCaretEventHub.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 "AccessibleCaretEventHub.h"
 
 #include "AccessibleCaretLogger.h"
 #include "AccessibleCaretManager.h"
 #include "Layers.h"
-#include "gfxPrefs.h"
+
 #include "mozilla/AutoRestore.h"
 #include "mozilla/MouseEvents.h"
 #include "mozilla/PresShell.h"
 #include "mozilla/StaticPrefs.h"
 #include "mozilla/TextEvents.h"
 #include "mozilla/TouchEvents.h"
 #include "mozilla/dom/Document.h"
 #include "mozilla/dom/MouseEventBinding.h"
--- a/layout/base/MobileViewportManager.cpp
+++ b/layout/base/MobileViewportManager.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 "MobileViewportManager.h"
 
-#include "gfxPrefs.h"
 #include "LayersLogging.h"
 #include "mozilla/PresShell.h"
 #include "mozilla/dom/Document.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/EventTarget.h"
 #include "nsIFrame.h"
 #include "nsLayoutUtils.h"
 #include "nsViewManager.h"
--- a/layout/base/TouchManager.cpp
+++ b/layout/base/TouchManager.cpp
@@ -2,17 +2,16 @@
 /* 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 "TouchManager.h"
 
-#include "gfxPrefs.h"
 #include "mozilla/dom/EventTarget.h"
 #include "mozilla/PresShell.h"
 #include "nsIFrame.h"
 #include "nsView.h"
 #include "PositionedEventTargeting.h"
 
 using namespace mozilla::dom;
 
--- a/layout/base/gtest/TestAccessibleCaretEventHub.cpp
+++ b/layout/base/gtest/TestAccessibleCaretEventHub.cpp
@@ -6,17 +6,17 @@
 
 #include "gtest/gtest.h"
 #include "gmock/gmock.h"
 
 #include <iostream>
 #include <string>
 
 #include "AccessibleCaretManager.h"
-#include "gfxPrefs.h"
+
 #include "mozilla/AccessibleCaretEventHub.h"
 #include "mozilla/BasicEvents.h"
 #include "mozilla/MouseEvents.h"
 #include "mozilla/TouchEvents.h"
 
 using ::testing::_;
 using ::testing::AtLeast;
 using ::testing::DefaultValue;
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -61,17 +61,17 @@
 #include "mozilla/dom/PBrowserParent.h"
 #include "mozilla/dom/BrowserChild.h"
 #include "mozilla/dom/BrowserParent.h"
 #include "nsRefreshDriver.h"
 #include "Layers.h"
 #include "LayerUserData.h"
 #include "ClientLayerManager.h"
 #include "mozilla/dom/NotifyPaintEvent.h"
-#include "gfxPrefs.h"
+
 #include "nsIDOMChromeWindow.h"
 #include "nsFrameLoader.h"
 #include "nsContentUtils.h"
 #include "nsPIWindowRoot.h"
 #include "mozilla/Preferences.h"
 #include "gfxTextRun.h"
 #include "nsFontFaceUtils.h"
 #include "nsLayoutStylesheetCache.h"
@@ -334,20 +334,16 @@ bool nsPresContext::IsChrome() const {
 }
 
 bool nsPresContext::IsChromeOriginImage() const {
   return Document()->IsBeingUsedAsImage() &&
          Document()->IsDocumentURISchemeChrome();
 }
 
 void nsPresContext::GetDocumentColorPreferences() {
-  // Make sure the preferences are initialized.  In the normal run,
-  // they would already be, because gfxPlatform would have been created,
-  // but in some reference tests, that is not the case.
-  gfxPrefs::GetSingleton();
   PreferenceSheet::EnsureInitialized();
 }
 
 void nsPresContext::GetUserPreferences() {
   if (!GetPresShell()) {
     // No presshell means nothing to do here.  We'll do this when we
     // get a presshell.
     return;
--- a/layout/base/nsRefreshDriver.cpp
+++ b/layout/base/nsRefreshDriver.cpp
@@ -58,17 +58,17 @@
 #include "mozilla/RestyleManager.h"
 #include "Layers.h"
 #include "imgIContainer.h"
 #include "mozilla/dom/ScriptSettings.h"
 #include "nsDocShell.h"
 #include "nsISimpleEnumerator.h"
 #include "nsJSEnvironment.h"
 #include "mozilla/Telemetry.h"
-#include "gfxPrefs.h"
+
 #include "BackgroundChild.h"
 #include "mozilla/ipc/PBackgroundChild.h"
 #include "mozilla/layout/VsyncChild.h"
 #include "VsyncSource.h"
 #include "mozilla/VsyncDispatcher.h"
 #include "nsThreadUtils.h"
 #include "mozilla/Unused.h"
 #include "mozilla/TimelineConsumers.h"
@@ -984,19 +984,16 @@ static void CreateContentVsyncRefreshTim
   layout::VsyncChild* child = static_cast<layout::VsyncChild*>(actor);
   nsRefreshDriver::PVsyncActorCreated(child);
 }
 
 static void CreateVsyncRefreshTimer() {
   MOZ_ASSERT(NS_IsMainThread());
 
   PodArrayZero(sJankLevels);
-  // Sometimes, gfxPrefs is not initialized here. Make sure the gfxPrefs is
-  // ready.
-  gfxPrefs::GetSingleton();
 
   if (gfxPlatform::IsInLayoutAsapMode()) {
     return;
   }
 
   if (XRE_IsParentProcess()) {
     // Make sure all vsync systems are ready.
     gfxPlatform::GetPlatform();
--- a/layout/forms/nsButtonFrameRenderer.cpp
+++ b/layout/forms/nsButtonFrameRenderer.cpp
@@ -13,17 +13,17 @@
 #include "mozilla/ServoStyleSet.h"
 #include "mozilla/Unused.h"
 #include "nsDisplayList.h"
 #include "nsITheme.h"
 #include "nsFrame.h"
 #include "mozilla/EventStates.h"
 #include "mozilla/dom/Element.h"
 #include "Layers.h"
-#include "gfxPrefs.h"
+
 #include "gfxUtils.h"
 #include "mozilla/layers/RenderRootStateManager.h"
 
 #define ACTIVE "active"
 #define HOVER "hover"
 #define FOCUS "focus"
 
 using namespace mozilla;
--- a/layout/generic/ScrollAnimationBezierPhysics.cpp
+++ b/layout/generic/ScrollAnimationBezierPhysics.cpp
@@ -1,16 +1,15 @@
 /* -*- 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 "ScrollAnimationBezierPhysics.h"
-#include "gfxPrefs.h"
 
 using namespace mozilla;
 
 ScrollAnimationBezierPhysics::ScrollAnimationBezierPhysics(
     const nsPoint& aStartPos,
     const ScrollAnimationBezierPhysicsSettings& aSettings)
     : mSettings(aSettings), mStartPos(aStartPos), mIsFirstIteration(true) {}
 
--- a/layout/generic/ScrollAnimationMSDPhysics.cpp
+++ b/layout/generic/ScrollAnimationMSDPhysics.cpp
@@ -1,16 +1,15 @@
 /* -*- 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 "ScrollAnimationMSDPhysics.h"
-#include "gfxPrefs.h"
 
 using namespace mozilla;
 
 ScrollAnimationMSDPhysics::ScrollAnimationMSDPhysics(const nsPoint& aStartPos)
     : mStartPos(aStartPos),
       mModelX(0, 0, 0,
               StaticPrefs::SmoothScrollMSDPhysicsRegularSpringConstant(), 1),
       mModelY(0, 0, 0,
--- a/layout/generic/ScrollSnap.cpp
+++ b/layout/generic/ScrollSnap.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 "ScrollSnap.h"
 
 #include "FrameMetrics.h"
-#include "gfxPrefs.h"
+
 #include "mozilla/Maybe.h"
 #include "mozilla/Preferences.h"
 #include "nsLineLayout.h"
 
 namespace mozilla {
 
 using layers::ScrollSnapInfo;
 
--- a/layout/generic/nsBulletFrame.cpp
+++ b/layout/generic/nsBulletFrame.cpp
@@ -5,17 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* rendering object for list-item bullets */
 
 #include "nsBulletFrame.h"
 
 #include "gfx2DGlue.h"
 #include "gfxContext.h"
-#include "gfxPrefs.h"
+
 #include "gfxUtils.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/gfx/PathHelpers.h"
 #include "mozilla/layers/LayersMessages.h"
 #include "mozilla/layers/StackingContextHelper.h"
 #include "mozilla/layers/RenderRootStateManager.h"
 #include "mozilla/layers/WebRenderMessages.h"
 #include "mozilla/MathAlgorithms.h"
--- a/layout/generic/nsCanvasFrame.h
+++ b/layout/generic/nsCanvasFrame.h
@@ -11,17 +11,16 @@
 
 #include "mozilla/Attributes.h"
 #include "mozilla/EventForwards.h"
 #include "nsContainerFrame.h"
 #include "nsIScrollPositionListener.h"
 #include "nsIPopupContainer.h"
 #include "nsDisplayList.h"
 #include "nsIAnonymousContentCreator.h"
-#include "gfxPrefs.h"
 
 class nsPresContext;
 class gfxContext;
 class nsPopupSetFrame;
 
 /**
  * Root frame class.
  *
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -56,17 +56,16 @@
 #include "nsRefreshDriver.h"
 #include "nsStyleConsts.h"
 #include "nsSVGIntegrationUtils.h"
 #include "nsIScrollPositionListener.h"
 #include "StickyScrollContainer.h"
 #include "nsIFrameInlines.h"
 #include "nsILayoutHistoryState.h"
 #include "gfxPlatform.h"
-#include "gfxPrefs.h"
 #include "mozilla/StaticPrefs.h"
 #include "ScrollAnimationPhysics.h"
 #include "ScrollAnimationBezierPhysics.h"
 #include "ScrollAnimationMSDPhysics.h"
 #include "ScrollSnap.h"
 #include "UnitTransforms.h"
 #include "nsPluginFrame.h"
 #include "nsSliderFrame.h"
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.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/. */
 
 /* rendering object for textual content of elements */
 
 #include "nsTextFrame.h"
 
 #include "gfx2DGlue.h"
-#include "gfxPrefs.h"
+
 #include "gfxUtils.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/ComputedStyle.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/Likely.h"
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/PresShell.h"
--- a/layout/painting/DisplayListChecker.cpp
+++ b/layout/painting/DisplayListChecker.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 "DisplayListChecker.h"
 
-#include "gfxPrefs.h"
 #include "nsDisplayList.h"
 
 namespace mozilla {
 
 class DisplayItemBlueprint;
 
 // Stack node used during tree visits, to store the path to a display item.
 struct DisplayItemBlueprintStack {
--- a/layout/svg/nsFilterInstance.cpp
+++ b/layout/svg/nsFilterInstance.cpp
@@ -12,17 +12,17 @@
 
 // Keep others in (case-insensitive) order:
 #include "FilterSupport.h"
 #include "ImgDrawResult.h"
 #include "SVGContentUtils.h"
 #include "gfx2DGlue.h"
 #include "gfxContext.h"
 #include "gfxPlatform.h"
-#include "gfxPrefs.h"
+
 #include "gfxUtils.h"
 #include "mozilla/Unused.h"
 #include "mozilla/gfx/Filters.h"
 #include "mozilla/gfx/Helpers.h"
 #include "mozilla/gfx/PatternHelpers.h"
 #include "nsCSSFilterInstance.h"
 #include "nsSVGDisplayableFrame.h"
 #include "nsSVGFilterInstance.h"
--- a/layout/svg/nsSVGIntegrationUtils.cpp
+++ b/layout/svg/nsSVGIntegrationUtils.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/. */
 
 // Main header first:
 #include "nsSVGIntegrationUtils.h"
 
 // Keep others in (case-insensitive) order:
 #include "gfxDrawable.h"
-#include "gfxPrefs.h"
+
 #include "nsCSSAnonBoxes.h"
 #include "nsCSSClipPathInstance.h"
 #include "nsDisplayList.h"
 #include "nsFilterInstance.h"
 #include "nsLayoutUtils.h"
 #include "gfxContext.h"
 #include "nsSVGClipPathFrame.h"
 #include "SVGObserverUtils.h"
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -45,17 +45,16 @@
 #include "mozilla/RestyleManager.h"
 #include "mozilla/ServoStyleSet.h"
 #include "nsDisplayList.h"
 #include "nsIScrollableFrame.h"
 #include "nsCSSProps.h"
 #include "nsStyleChangeList.h"
 #include <algorithm>
 
-#include "gfxPrefs.h"
 #include "mozilla/layers/StackingContextHelper.h"
 #include "mozilla/layers/RenderRootStateManager.h"
 
 using namespace mozilla;
 using namespace mozilla::image;
 using namespace mozilla::layout;
 
 using mozilla::gfx::AutoRestoreTransform;
--- a/layout/xul/nsBoxFrame.cpp
+++ b/layout/xul/nsBoxFrame.cpp
@@ -37,17 +37,16 @@
 // preferred sizes. Only problem is if a incremental reflow occurs. The
 // preferred size of a child deep in the hierarchy could change. And this could
 // change any number of syblings around the box. Basically any children in the
 // reflow chain must have their caches cleared so when asked for there current
 // size they can relayout themselves.
 
 #include "nsBoxFrame.h"
 
-#include "gfxPrefs.h"
 #include "gfxUtils.h"
 #include "mozilla/gfx/2D.h"
 #include "nsBoxLayoutState.h"
 #include "mozilla/dom/Touch.h"
 #include "mozilla/Move.h"
 #include "mozilla/ComputedStyle.h"
 #include "mozilla/PresShell.h"
 #include "nsPlaceholderFrame.h"
--- a/layout/xul/nsSliderFrame.cpp
+++ b/layout/xul/nsSliderFrame.cpp
@@ -8,17 +8,16 @@
 // Eric Vaughan
 // Netscape Communications
 //
 // See documentation in associated header file
 //
 
 #include "nsSliderFrame.h"
 
-#include "gfxPrefs.h"
 #include "mozilla/ComputedStyle.h"
 #include "nsPresContext.h"
 #include "nsIContent.h"
 #include "nsCOMPtr.h"
 #include "nsNameSpaceManager.h"
 #include "nsGkAtoms.h"
 #include "nsHTMLParts.h"
 #include "nsCSSRendering.h"
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -552,17 +552,17 @@ var snapshotFormatters = {
     delete data.isGPU2Active;
 
     let featureLog = data.featureLog;
     delete data.featureLog;
 
     let features = [];
     for (let feature of featureLog.features) {
       // Only add interesting decisions - ones that were not automatic based on
-      // all.js/gfxPrefs defaults.
+      // all.js/StaticPrefs defaults.
       if (feature.log.length > 1 || feature.log[0].status != "available") {
         features.push(feature);
       }
     }
 
     if (features.length) {
       for (let feature of features) {
         let trs = [];
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -93,17 +93,16 @@
 #include "nsIXULRuntime.h"
 #include "nsPIDOMWindow.h"
 #include "nsIBaseWindow.h"
 #include "nsIWidget.h"
 #include "nsIDocShell.h"
 #include "nsAppShellCID.h"
 #include "mozilla/scache/StartupCache.h"
 #include "gfxPlatform.h"
-#include "gfxPrefs.h"
 
 #include "mozilla/Unused.h"
 
 #ifdef XP_WIN
 #  include "nsIWinAppHelper.h"
 #  include <windows.h>
 #  include <intrin.h>
 #  include <math.h>
@@ -1828,20 +1827,16 @@ static ReturnAbortOnError ShowProfileMan
   bool offline = false;
   int32_t dialogReturn;
 
   {
     ScopedXPCOMStartup xpcom;
     rv = xpcom.Initialize();
     NS_ENSURE_SUCCESS(rv, rv);
 
-    // Initialize the graphics prefs, some of the paths need them before
-    // any other graphics is initialized (e.g., showing the profile chooser.)
-    gfxPrefs::GetSingleton();
-
     rv = xpcom.SetWindowCreator(aNative);
     NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
 
 #ifdef XP_MACOSX
     CommandLineServiceMac::SetupMacCommandLine(gRestartArgc, gRestartArgv,
                                                true);
 #endif
 
--- a/view/nsViewManager.cpp
+++ b/view/nsViewManager.cpp
@@ -21,17 +21,16 @@
 #include "nsXULPopupManager.h"
 #include "nsPresContext.h"
 #include "GeckoProfiler.h"
 #include "nsRefreshDriver.h"
 #include "nsContentUtils.h"  // for nsAutoScriptBlocker
 #include "nsLayoutUtils.h"
 #include "Layers.h"
 #include "gfxPlatform.h"
-#include "gfxPrefs.h"
 
 /**
    XXX TODO XXX
 
    DeCOMify newly private methods
    Optimize view storage
 */
 
--- a/widget/GfxInfoBase.cpp
+++ b/widget/GfxInfoBase.cpp
@@ -24,17 +24,17 @@
 #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"
 #include "DriverCrashGuard.h"
 
 using namespace mozilla::widget;
 using namespace mozilla;
 using mozilla::MutexAutoLock;
 
@@ -584,17 +584,16 @@ GfxInfoBase::Observe(nsISupports* aSubje
 }
 
 GfxInfoBase::GfxInfoBase() : mMutex("GfxInfoBase") {}
 
 GfxInfoBase::~GfxInfoBase() {}
 
 nsresult GfxInfoBase::Init() {
   InitGfxDriverInfoShutdownObserver();
-  gfxPrefs::GetSingleton();
 
   nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
   if (os) {
     os->AddObserver(this, "blocklist-data-gfxItems", true);
   }
 
   return NS_OK;
 }
--- a/widget/nsXPLookAndFeel.cpp
+++ b/widget/nsXPLookAndFeel.cpp
@@ -14,17 +14,17 @@
 #include "nsFont.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/ServoStyleSet.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/widget/WidgetMessageUtils.h"
 
 #include "gfxPlatform.h"
-#include "gfxPrefs.h"
+
 #include "qcms.h"
 
 #ifdef DEBUG
 #  include "nsSize.h"
 #endif
 
 using namespace mozilla;
 
@@ -874,20 +874,16 @@ nsresult nsXPLookAndFeel::GetColorImpl(C
   if (sUseNativeColors && aUseStandinsForNativeColors) {
     aResult = GetStandinForNativeColor(aID);
     return NS_OK;
   }
 
   if (sUseNativeColors && NS_SUCCEEDED(NativeGetColor(aID, aResult))) {
     if (!mozilla::ServoStyleSet::IsInServoTraversal()) {
       MOZ_ASSERT(NS_IsMainThread());
-      // Make sure the preferences are initialized. In the normal run,
-      // they would already be, because gfxPlatform would have been created,
-      // but with some addon, that is not the case. See Bug 1357307.
-      gfxPrefs::GetSingleton();
       if ((gfxPlatform::GetCMSMode() == eCMSMode_All) &&
           !IsSpecialColor(aID, aResult)) {
         qcms_transform* transform = gfxPlatform::GetCMSInverseRGBTransform();
         if (transform) {
           uint8_t color[3];
           color[0] = NS_GET_R(aResult);
           color[1] = NS_GET_G(aResult);
           color[2] = NS_GET_B(aResult);
--- a/widget/windows/WinCompositorWidget.cpp
+++ b/widget/windows/WinCompositorWidget.cpp
@@ -1,15 +1,15 @@
 /* -*- 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 "WinCompositorWidget.h"
-#include "gfxPrefs.h"
+
 #include "mozilla/gfx/DeviceManagerDx.h"
 #include "mozilla/gfx/Point.h"
 #include "mozilla/layers/Compositor.h"
 #include "mozilla/widget/PlatformWidgetTypes.h"
 #include "nsWindow.h"
 #include "VsyncDispatcher.h"
 #include "WinCompositorWindowThread.h"
 
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -52,17 +52,17 @@
  ** Include headers.
  **
  **************************************************************
  **************************************************************/
 
 #include "gfx2DGlue.h"
 #include "gfxEnv.h"
 #include "gfxPlatform.h"
-#include "gfxPrefs.h"
+
 #include "mozilla/AutoRestore.h"
 #include "mozilla/Logging.h"
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/MiscEvents.h"
 #include "mozilla/MouseEvents.h"
 #include "mozilla/TouchEvents.h"
 
 #include "mozilla/ipc/MessageChannel.h"
--- a/widget/windows/nsWindowBase.cpp
+++ b/widget/windows/nsWindowBase.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 4; 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 "nsWindowBase.h"
 
-#include "gfxPrefs.h"
 #include "mozilla/MiscEvents.h"
 #include "mozilla/PresShell.h"
 #include "KeyboardLayout.h"
 #include "WinUtils.h"
 #include "npapi.h"
 #include "nsAutoPtr.h"
 
 using namespace mozilla;