diff --git a/devtools/server/actors/highlighters/utils/canvas.js b/devtools/server/actors/highlighters/utils/canvas.js index 5c96139def524..196fb7b14c088 100644 --- a/devtools/server/actors/highlighters/utils/canvas.js +++ b/devtools/server/actors/highlighters/utils/canvas.js @@ -27,8 +27,8 @@ const { getComputedStyle } = require("./markup"); // // 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 diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp index f5abbf56853e9..630fa38515496 100644 --- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp @@ -268,7 +268,6 @@ #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" diff --git a/dom/base/TextInputProcessor.cpp b/dom/base/TextInputProcessor.cpp index 679869efea629..669b1d3bc4ef9 100644 --- a/dom/base/TextInputProcessor.cpp +++ b/dom/base/TextInputProcessor.cpp @@ -4,7 +4,6 @@ * 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" diff --git a/dom/base/nsImageLoadingContent.cpp b/dom/base/nsImageLoadingContent.cpp index bfe39bc493f65..d249d667e7d28 100644 --- a/dom/base/nsImageLoadingContent.cpp +++ b/dom/base/nsImageLoadingContent.cpp @@ -39,8 +39,6 @@ #include "nsIContentPolicy.h" #include "SVGObserverUtils.h" -#include "gfxPrefs.h" - #include "mozAutoDocUpdate.h" #include "mozilla/AsyncEventDispatcher.h" #include "mozilla/AutoRestore.h" diff --git a/dom/canvas/WebGL2ContextQueries.cpp b/dom/canvas/WebGL2ContextQueries.cpp index f82cb94d86d83..d1555a53c3f95 100644 --- a/dom/canvas/WebGL2ContextQueries.cpp +++ b/dom/canvas/WebGL2ContextQueries.cpp @@ -6,7 +6,6 @@ #include "WebGL2Context.h" #include "GLContext.h" #include "WebGLQuery.h" -#include "gfxPrefs.h" #include "nsThreadUtils.h" namespace mozilla { diff --git a/dom/canvas/WebGLContextExtensions.cpp b/dom/canvas/WebGLContextExtensions.cpp index e5be59eb678a1..6177c4e650762 100644 --- a/dom/canvas/WebGLContextExtensions.cpp +++ b/dom/canvas/WebGLContextExtensions.cpp @@ -6,7 +6,6 @@ #include "WebGLContext.h" #include "WebGLContextUtils.h" #include "WebGLExtensions.h" -#include "gfxPrefs.h" #include "GLContext.h" #include "nsString.h" diff --git a/dom/canvas/WebGLExtensionDisjointTimerQuery.cpp b/dom/canvas/WebGLExtensionDisjointTimerQuery.cpp index d5d70c0683f66..b069b8de9b30a 100644 --- a/dom/canvas/WebGLExtensionDisjointTimerQuery.cpp +++ b/dom/canvas/WebGLExtensionDisjointTimerQuery.cpp @@ -6,7 +6,6 @@ #include "WebGLExtensions.h" -#include "gfxPrefs.h" #include "GLContext.h" #include "mozilla/dom/ToJSValue.h" #include "mozilla/dom/WebGLRenderingContextBinding.h" diff --git a/dom/canvas/WebGLFormats.cpp b/dom/canvas/WebGLFormats.cpp index 2fb500e7cf0ad..f2dd2228cd9e3 100644 --- a/dom/canvas/WebGLFormats.cpp +++ b/dom/canvas/WebGLFormats.cpp @@ -5,7 +5,6 @@ #include "WebGLFormats.h" -#include "gfxPrefs.h" #include "GLContext.h" #include "GLDefs.h" #include "mozilla/gfx/Logging.h" diff --git a/dom/canvas/WebGLQuery.cpp b/dom/canvas/WebGLQuery.cpp index fb49b86bbc002..17e5e6d8da0c5 100644 --- a/dom/canvas/WebGLQuery.cpp +++ b/dom/canvas/WebGLQuery.cpp @@ -5,7 +5,6 @@ #include "WebGLQuery.h" -#include "gfxPrefs.h" #include "GLContext.h" #include "mozilla/dom/WebGL2RenderingContextBinding.h" #include "nsContentUtils.h" diff --git a/dom/html/HTMLCanvasElement.cpp b/dom/html/HTMLCanvasElement.cpp index 104c2e3141842..46b1a8e28a200 100644 --- a/dom/html/HTMLCanvasElement.cpp +++ b/dom/html/HTMLCanvasElement.cpp @@ -6,7 +6,6 @@ #include "mozilla/dom/HTMLCanvasElement.h" -#include "gfxPrefs.h" #include "ImageEncoder.h" #include "jsapi.h" #include "jsfriendapi.h" diff --git a/dom/ipc/BrowserChild.cpp b/dom/ipc/BrowserChild.cpp index a7242ba713fd7..4257646833026 100644 --- a/dom/ipc/BrowserChild.cpp +++ b/dom/ipc/BrowserChild.cpp @@ -8,7 +8,6 @@ #include "BrowserChild.h" -#include "gfxPrefs.h" #ifdef ACCESSIBILITY # include "mozilla/a11y/DocAccessibleChild.h" #endif diff --git a/dom/ipc/BrowserParent.cpp b/dom/ipc/BrowserParent.cpp index 5a28e7e7d3592..f9e640b0cf48e 100644 --- a/dom/ipc/BrowserParent.cpp +++ b/dom/ipc/BrowserParent.cpp @@ -96,7 +96,6 @@ #include "nsIAuthPromptCallback.h" #include "nsAuthInformationHolder.h" #include "nsICancelable.h" -#include "gfxPrefs.h" #include "gfxUtils.h" #include "nsILoginManagerPrompter.h" #include "nsPIWindowRoot.h" diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 71ff7e9712fa9..55d0f98647762 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -206,7 +206,6 @@ #include "mozilla/net/NeckoMessageUtils.h" #include "gfxPlatform.h" #include "gfxPlatformFontList.h" -#include "gfxPrefs.h" #include "prio.h" #include "private/pprio.h" #include "ContentProcessManager.h" diff --git a/dom/media/AudioStream.cpp b/dom/media/AudioStream.cpp index 2427897384138..786d151800c30 100644 --- a/dom/media/AudioStream.cpp +++ b/dom/media/AudioStream.cpp @@ -18,7 +18,6 @@ #include "mozilla/Telemetry.h" #include "CubebUtils.h" #include "nsPrintfCString.h" -#include "gfxPrefs.h" #include "AudioConverter.h" #if defined(XP_WIN) # include "nsXULAppAPI.h" diff --git a/dom/media/Benchmark.cpp b/dom/media/Benchmark.cpp index 19f70b7585eca..b319b2d3ba10e 100644 --- a/dom/media/Benchmark.cpp +++ b/dom/media/Benchmark.cpp @@ -11,7 +11,6 @@ #include "PDMFactory.h" #include "VideoUtils.h" #include "WebMDemuxer.h" -#include "gfxPrefs.h" #include "mozilla/AbstractThread.h" #include "mozilla/Preferences.h" #include "mozilla/SharedThreadPool.h" @@ -168,7 +167,6 @@ void Benchmark::Dispose() { void Benchmark::Init() { MOZ_ASSERT(NS_IsMainThread()); gfxVars::Initialize(); - gfxPrefs::GetSingleton(); } BenchmarkPlayback::BenchmarkPlayback(Benchmark* aGlobalState, diff --git a/dom/media/systemservices/MediaSystemResourceManager.cpp b/dom/media/systemservices/MediaSystemResourceManager.cpp index b203e80af6a5c..8d0a797c4be29 100644 --- a/dom/media/systemservices/MediaSystemResourceManager.cpp +++ b/dom/media/systemservices/MediaSystemResourceManager.cpp @@ -6,7 +6,6 @@ #include "mozilla/TaskQueue.h" -#include "gfxPrefs.h" #include "MediaSystemResourceManagerChild.h" #include "mozilla/layers/ImageBridgeChild.h" diff --git a/dom/plugins/ipc/PluginInstanceParent.cpp b/dom/plugins/ipc/PluginInstanceParent.cpp index 65c4dfe47dbed..f912f2b8ae476 100644 --- a/dom/plugins/ipc/PluginInstanceParent.cpp +++ b/dom/plugins/ipc/PluginInstanceParent.cpp @@ -35,7 +35,6 @@ #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" diff --git a/gfx/config/gfxConfig.h b/gfx/config/gfxConfig.h index 6e6eecb921c4a..a62f98513bd2a 100644 --- a/gfx/config/gfxConfig.h +++ b/gfx/config/gfxConfig.h @@ -20,7 +20,7 @@ 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. diff --git a/gfx/config/gfxVars.h b/gfx/config/gfxVars.h index c60350bd0a49b..cc3508bbbef23 100644 --- a/gfx/config/gfxVars.h +++ b/gfx/config/gfxVars.h @@ -56,7 +56,7 @@ class gfxVarReceiver; // 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: diff --git a/gfx/gl/GLContextProviderEAGL.mm b/gfx/gl/GLContextProviderEAGL.mm index 2af1ffa61fd87..593632531efed 100644 --- a/gfx/gl/GLContextProviderEAGL.mm +++ b/gfx/gl/GLContextProviderEAGL.mm @@ -7,7 +7,6 @@ #include "GLContextEAGL.h" #include "nsDebug.h" #include "nsIWidget.h" -#include "gfxPrefs.h" #include "gfxFailure.h" #include "prenv.h" #include "mozilla/Preferences.h" diff --git a/gfx/gl/GLContextProviderWGL.cpp b/gfx/gl/GLContextProviderWGL.cpp index 596e864315d9f..09af4c9f191e8 100644 --- a/gfx/gl/GLContextProviderWGL.cpp +++ b/gfx/gl/GLContextProviderWGL.cpp @@ -9,7 +9,6 @@ #include "nsDebug.h" #include "nsIWidget.h" #include "gfxPlatform.h" -#include "gfxPrefs.h" #include "gfxWindowsSurface.h" #include "gfxCrashReporterUtils.h" diff --git a/gfx/gl/GLLibraryEGL.cpp b/gfx/gl/GLLibraryEGL.cpp index 38cf63dbc9d1c..6203f06b77811 100644 --- a/gfx/gl/GLLibraryEGL.cpp +++ b/gfx/gl/GLLibraryEGL.cpp @@ -30,7 +30,6 @@ #include "prsystem.h" #include "GLContext.h" #include "GLContextProvider.h" -#include "gfxPrefs.h" #include "ScopedGLHelpers.h" #ifdef MOZ_WIDGET_GTK # include @@ -86,7 +85,6 @@ PRLibrary* LoadApitraceLibrary() { if (!path) return nullptr; // Initialization of gfx prefs here is only needed during the unit tests... - gfxPrefs::GetSingleton(); if (!StaticPrefs::UseApitrace()) { return nullptr; } diff --git a/gfx/gl/SharedSurfaceD3D11Interop.cpp b/gfx/gl/SharedSurfaceD3D11Interop.cpp index 8ff4797840474..28fc37be6ebe2 100644 --- a/gfx/gl/SharedSurfaceD3D11Interop.cpp +++ b/gfx/gl/SharedSurfaceD3D11Interop.cpp @@ -7,7 +7,6 @@ #include #include -#include "gfxPrefs.h" #include "GLContext.h" #include "WGLLibrary.h" #include "nsPrintfCString.h" diff --git a/gfx/ipc/GPUParent.cpp b/gfx/ipc/GPUParent.cpp index 906c4739e40d7..5e22272e1cb17 100644 --- a/gfx/ipc/GPUParent.cpp +++ b/gfx/ipc/GPUParent.cpp @@ -10,7 +10,6 @@ #include "gfxConfig.h" #include "gfxCrashReporterUtils.h" #include "gfxPlatform.h" -#include "gfxPrefs.h" #include "GLContextProvider.h" #include "GPUProcessHost.h" #include "GPUProcessManager.h" @@ -110,8 +109,6 @@ bool GPUParent::Init(base::ProcessId aParentPid, const char* aParentBuildID, // Init crash reporter support. CrashReporterClient::InitSingleton(this); - // Ensure gfxPrefs are initialized. - gfxPrefs::GetSingleton(); gfxConfig::Init(); gfxVars::Initialize(); gfxPlatform::InitNullMetadata(); @@ -552,7 +549,6 @@ void GPUParent::ActorDestroy(ActorDestroyReason aWhy) { LayerTreeOwnerTracker::Shutdown(); gfxVars::Shutdown(); gfxConfig::Shutdown(); - gfxPrefs::DestroySingleton(); CrashReporterClient::DestroySingleton(); XRE_ShutdownChildProcess(); } diff --git a/gfx/ipc/GraphicsMessages.ipdlh b/gfx/ipc/GraphicsMessages.ipdlh index 0c20f9bf5fc33..411c72468754f 100644 --- a/gfx/ipc/GraphicsMessages.ipdlh +++ b/gfx/ipc/GraphicsMessages.ipdlh @@ -17,19 +17,6 @@ using mozilla::gfx::D3D11Checks::VideoFormatOptionSet from "mozilla/gfx/D3D11Che namespace mozilla { namespace gfx { -union GfxPrefValue { - bool; - int32_t; - uint32_t; - float; - nsCString; -}; - -struct GfxPrefSetting { - int32_t index; - GfxPrefValue value; -}; - struct D3D11DeviceStatus { bool isWARP; diff --git a/gfx/layers/FrameMetrics.cpp b/gfx/layers/FrameMetrics.cpp index 14bb9df0953e6..f5fc646b2d96d 100644 --- a/gfx/layers/FrameMetrics.cpp +++ b/gfx/layers/FrameMetrics.cpp @@ -5,7 +5,7 @@ * 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" diff --git a/gfx/layers/FrameMetrics.h b/gfx/layers/FrameMetrics.h index 803c335ca9abb..1f41fead19cfd 100644 --- a/gfx/layers/FrameMetrics.h +++ b/gfx/layers/FrameMetrics.h @@ -987,7 +987,7 @@ struct ScrollMetadata { 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; } diff --git a/gfx/layers/LayerScope.cpp b/gfx/layers/LayerScope.cpp index 43dfab7f51ac7..c78b237801b54 100644 --- a/gfx/layers/LayerScope.cpp +++ b/gfx/layers/LayerScope.cpp @@ -21,7 +21,7 @@ #include "gfxContext.h" #include "gfxUtils.h" -#include "gfxPrefs.h" + #include "nsIWidget.h" #include "GLContext.h" diff --git a/gfx/layers/apz/src/APZInputBridge.cpp b/gfx/layers/apz/src/APZInputBridge.cpp index da2b23cd6d04a..dc2f2202c3ce5 100644 --- a/gfx/layers/apz/src/APZInputBridge.cpp +++ b/gfx/layers/apz/src/APZInputBridge.cpp @@ -6,7 +6,6 @@ #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 diff --git a/gfx/layers/apz/src/AndroidAPZ.cpp b/gfx/layers/apz/src/AndroidAPZ.cpp index a2cc6f466ecec..f47e8ea9d2176 100644 --- a/gfx/layers/apz/src/AndroidAPZ.cpp +++ b/gfx/layers/apz/src/AndroidAPZ.cpp @@ -11,7 +11,6 @@ #include "AsyncPanZoomController.h" #include "GeneratedJNIWrappers.h" #include "GenericFlingAnimation.h" -#include "gfxPrefs.h" #include "OverscrollHandoffState.h" #include "SimpleVelocityTracker.h" #include "ViewConfiguration.h" diff --git a/gfx/layers/apz/src/AndroidFlingPhysics.h b/gfx/layers/apz/src/AndroidFlingPhysics.h index 0f6157b1c4c86..68fb53e8047fe 100644 --- a/gfx/layers/apz/src/AndroidFlingPhysics.h +++ b/gfx/layers/apz/src/AndroidFlingPhysics.h @@ -9,7 +9,6 @@ #include "AsyncPanZoomController.h" #include "Units.h" -#include "gfxPrefs.h" #include "mozilla/Assertions.h" namespace mozilla { diff --git a/gfx/layers/apz/src/Axis.cpp b/gfx/layers/apz/src/Axis.cpp index 75bd6a283dc5c..8a5be662be7d5 100644 --- a/gfx/layers/apz/src/Axis.cpp +++ b/gfx/layers/apz/src/Axis.cpp @@ -23,7 +23,6 @@ #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__) diff --git a/gfx/layers/apz/src/DesktopFlingPhysics.h b/gfx/layers/apz/src/DesktopFlingPhysics.h index a9bf2234f0926..d4567a5bab72f 100644 --- a/gfx/layers/apz/src/DesktopFlingPhysics.h +++ b/gfx/layers/apz/src/DesktopFlingPhysics.h @@ -9,7 +9,6 @@ #include "AsyncPanZoomController.h" #include "Units.h" -#include "gfxPrefs.h" #include "mozilla/Assertions.h" #define FLING_PHYS_LOG(...) diff --git a/gfx/layers/apz/src/GenericFlingAnimation.h b/gfx/layers/apz/src/GenericFlingAnimation.h index 01c567c60e51b..5e5fb4209b615 100644 --- a/gfx/layers/apz/src/GenericFlingAnimation.h +++ b/gfx/layers/apz/src/GenericFlingAnimation.h @@ -15,7 +15,6 @@ #include "LayersLogging.h" #include "Units.h" #include "OverscrollHandoffState.h" -#include "gfxPrefs.h" #include "mozilla/Assertions.h" #include "mozilla/Monitor.h" #include "mozilla/RefPtr.h" diff --git a/gfx/layers/apz/src/GenericScrollAnimation.cpp b/gfx/layers/apz/src/GenericScrollAnimation.cpp index fe62f5f086f17..7a4081087f9db 100644 --- a/gfx/layers/apz/src/GenericScrollAnimation.cpp +++ b/gfx/layers/apz/src/GenericScrollAnimation.cpp @@ -8,7 +8,6 @@ #include "AsyncPanZoomController.h" #include "FrameMetrics.h" -#include "gfxPrefs.h" #include "nsPoint.h" #include "ScrollAnimationPhysics.h" #include "ScrollAnimationBezierPhysics.h" diff --git a/gfx/layers/apz/src/GestureEventListener.cpp b/gfx/layers/apz/src/GestureEventListener.cpp index 0f67682c2ec34..ad86a7d49cbab 100644 --- a/gfx/layers/apz/src/GestureEventListener.cpp +++ b/gfx/layers/apz/src/GestureEventListener.cpp @@ -10,7 +10,6 @@ #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 diff --git a/gfx/layers/apz/src/HitTestingTreeNode.cpp b/gfx/layers/apz/src/HitTestingTreeNode.cpp index c114611c55bf9..572b6920fcca6 100644 --- a/gfx/layers/apz/src/HitTestingTreeNode.cpp +++ b/gfx/layers/apz/src/HitTestingTreeNode.cpp @@ -5,7 +5,6 @@ #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 diff --git a/gfx/layers/apz/src/InputBlockState.cpp b/gfx/layers/apz/src/InputBlockState.cpp index 45c0ac69f1b3a..3ce5184dade3c 100644 --- a/gfx/layers/apz/src/InputBlockState.cpp +++ b/gfx/layers/apz/src/InputBlockState.cpp @@ -9,7 +9,7 @@ #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 diff --git a/gfx/layers/apz/src/InputQueue.cpp b/gfx/layers/apz/src/InputQueue.cpp index 9cc00f81e428b..dfbf62f7631b9 100644 --- a/gfx/layers/apz/src/InputQueue.cpp +++ b/gfx/layers/apz/src/InputQueue.cpp @@ -7,7 +7,7 @@ #include "InputQueue.h" #include "AsyncPanZoomController.h" -#include "gfxPrefs.h" + #include "InputBlockState.h" #include "LayersLogging.h" #include "mozilla/layers/APZThreadUtils.h" diff --git a/gfx/layers/apz/src/KeyboardScrollAnimation.cpp b/gfx/layers/apz/src/KeyboardScrollAnimation.cpp index 3679c497632c4..18fc5af20f039 100644 --- a/gfx/layers/apz/src/KeyboardScrollAnimation.cpp +++ b/gfx/layers/apz/src/KeyboardScrollAnimation.cpp @@ -7,8 +7,6 @@ #include "KeyboardScrollAnimation.h" #include "ScrollAnimationBezierPhysics.h" -#include "gfxPrefs.h" - namespace mozilla { namespace layers { diff --git a/gfx/layers/apz/test/gtest/APZCBasicTester.h b/gfx/layers/apz/test/gtest/APZCBasicTester.h index 215e54cd76fd3..add054a958ea7 100644 --- a/gfx/layers/apz/test/gtest/APZCBasicTester.h +++ b/gfx/layers/apz/test/gtest/APZCBasicTester.h @@ -12,7 +12,7 @@ */ #include "APZTestCommon.h" -#include "gfxPrefs.h" + #include "mozilla/layers/APZSampler.h" #include "mozilla/layers/APZUpdater.h" @@ -25,7 +25,6 @@ class APZCBasicTester : public APZCTesterBase { protected: virtual void SetUp() { - gfxPrefs::GetSingleton(); APZThreadUtils::SetThreadAssertionsEnabled(false); APZThreadUtils::SetControllerThread(MessageLoop::current()); diff --git a/gfx/layers/apz/test/gtest/APZCTreeManagerTester.h b/gfx/layers/apz/test/gtest/APZCTreeManagerTester.h index 86f709633de31..2a1d5215ef94b 100644 --- a/gfx/layers/apz/test/gtest/APZCTreeManagerTester.h +++ b/gfx/layers/apz/test/gtest/APZCTreeManagerTester.h @@ -14,14 +14,13 @@ #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()); diff --git a/gfx/layers/apz/test/gtest/InputUtils.h b/gfx/layers/apz/test/gtest/InputUtils.h index 6298ae809333e..0f360569ba2e4 100644 --- a/gfx/layers/apz/test/gtest/InputUtils.h +++ b/gfx/layers/apz/test/gtest/InputUtils.h @@ -13,7 +13,6 @@ */ #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: diff --git a/gfx/layers/apz/test/gtest/TestBasic.cpp b/gfx/layers/apz/test/gtest/TestBasic.cpp index 4670b542da614..6d76045de7721 100644 --- a/gfx/layers/apz/test/gtest/TestBasic.cpp +++ b/gfx/layers/apz/test/gtest/TestBasic.cpp @@ -6,7 +6,7 @@ #include "APZCBasicTester.h" #include "APZTestCommon.h" -#include "gfxPrefs.h" + #include "InputUtils.h" TEST_F(APZCBasicTester, Overzoom) { diff --git a/gfx/layers/apz/test/gtest/TestHitTesting.cpp b/gfx/layers/apz/test/gtest/TestHitTesting.cpp index dcca45f7ea2c2..002d044857e3c 100644 --- a/gfx/layers/apz/test/gtest/TestHitTesting.cpp +++ b/gfx/layers/apz/test/gtest/TestHitTesting.cpp @@ -6,7 +6,7 @@ #include "APZCTreeManagerTester.h" #include "APZTestCommon.h" -#include "gfxPrefs.h" + #include "InputUtils.h" class APZHitTestingTester : public APZCTreeManagerTester { diff --git a/gfx/layers/apz/test/gtest/TestSnapping.cpp b/gfx/layers/apz/test/gtest/TestSnapping.cpp index 495317cf69ce6..4e2cbd582f858 100644 --- a/gfx/layers/apz/test/gtest/TestSnapping.cpp +++ b/gfx/layers/apz/test/gtest/TestSnapping.cpp @@ -6,7 +6,7 @@ #include "APZCTreeManagerTester.h" #include "APZTestCommon.h" -#include "gfxPrefs.h" + #include "InputUtils.h" #include "mozilla/StaticPrefs.h" diff --git a/gfx/layers/apz/util/APZCCallbackHelper.cpp b/gfx/layers/apz/util/APZCCallbackHelper.cpp index 96920c0051404..b38f7e6372b53 100644 --- a/gfx/layers/apz/util/APZCCallbackHelper.cpp +++ b/gfx/layers/apz/util/APZCCallbackHelper.cpp @@ -8,7 +8,7 @@ #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" diff --git a/gfx/layers/apz/util/APZEventState.cpp b/gfx/layers/apz/util/APZEventState.cpp index 50812cd5af4a6..add47a278b3ad 100644 --- a/gfx/layers/apz/util/APZEventState.cpp +++ b/gfx/layers/apz/util/APZEventState.cpp @@ -8,7 +8,7 @@ #include "ActiveElementManager.h" #include "APZCCallbackHelper.h" -#include "gfxPrefs.h" + #include "LayersLogging.h" #include "mozilla/BasicEvents.h" #include "mozilla/dom/MouseEventBinding.h" diff --git a/gfx/layers/apz/util/CheckerboardReportService.cpp b/gfx/layers/apz/util/CheckerboardReportService.cpp index 2f0e01dc36089..1991104717100 100644 --- a/gfx/layers/apz/util/CheckerboardReportService.cpp +++ b/gfx/layers/apz/util/CheckerboardReportService.cpp @@ -6,7 +6,6 @@ #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 diff --git a/gfx/layers/basic/BasicCompositor.cpp b/gfx/layers/basic/BasicCompositor.cpp index c072689a2ce68..f97ea381b8531 100644 --- a/gfx/layers/basic/BasicCompositor.cpp +++ b/gfx/layers/basic/BasicCompositor.cpp @@ -24,7 +24,6 @@ #include "YCbCrUtils.h" #include #include "ImageContainer.h" -#include "gfxPrefs.h" namespace mozilla { using namespace mozilla::gfx; diff --git a/gfx/layers/basic/BasicLayerManager.cpp b/gfx/layers/basic/BasicLayerManager.cpp index c00826136ed2f..84c020b3a9ab2 100644 --- a/gfx/layers/basic/BasicLayerManager.cpp +++ b/gfx/layers/basic/BasicLayerManager.cpp @@ -23,7 +23,7 @@ #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 diff --git a/gfx/layers/client/ClientPaintedLayer.cpp b/gfx/layers/client/ClientPaintedLayer.cpp index 615f122daf8bb..3f29084ebc5cb 100644 --- a/gfx/layers/client/ClientPaintedLayer.cpp +++ b/gfx/layers/client/ClientPaintedLayer.cpp @@ -13,7 +13,7 @@ #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" diff --git a/gfx/layers/client/ContentClient.cpp b/gfx/layers/client/ContentClient.cpp index 63c5d31400db8..084a87ab6e6fe 100644 --- a/gfx/layers/client/ContentClient.cpp +++ b/gfx/layers/client/ContentClient.cpp @@ -9,7 +9,7 @@ #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 diff --git a/gfx/layers/composite/LayerManagerComposite.cpp b/gfx/layers/composite/LayerManagerComposite.cpp index c958f9fda49e9..aed6f2e49aec9 100644 --- a/gfx/layers/composite/LayerManagerComposite.cpp +++ b/gfx/layers/composite/LayerManagerComposite.cpp @@ -25,7 +25,7 @@ #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 diff --git a/gfx/layers/composite/TextureHost.cpp b/gfx/layers/composite/TextureHost.cpp index 47c4a758056d5..ec50de2ec4ae5 100644 --- a/gfx/layers/composite/TextureHost.cpp +++ b/gfx/layers/composite/TextureHost.cpp @@ -36,7 +36,7 @@ #include "mozilla/Unused.h" #include #include "../opengl/CompositorOGL.h" -#include "gfxPrefs.h" + #include "gfxUtils.h" #include "IPDLActor.h" diff --git a/gfx/layers/ipc/CompositorBridgeParent.cpp b/gfx/layers/ipc/CompositorBridgeParent.cpp index 914ebd5fc471f..c8964f4be451e 100644 --- a/gfx/layers/ipc/CompositorBridgeParent.cpp +++ b/gfx/layers/ipc/CompositorBridgeParent.cpp @@ -30,7 +30,6 @@ #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 diff --git a/gfx/layers/ipc/ISurfaceAllocator.cpp b/gfx/layers/ipc/ISurfaceAllocator.cpp index 719c2812915f7..a96503844cb2a 100644 --- a/gfx/layers/ipc/ISurfaceAllocator.cpp +++ b/gfx/layers/ipc/ISurfaceAllocator.cpp @@ -6,7 +6,6 @@ #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" diff --git a/gfx/layers/ipc/ShadowLayers.cpp b/gfx/layers/ipc/ShadowLayers.cpp index b6361a9838786..636411078ffa2 100644 --- a/gfx/layers/ipc/ShadowLayers.cpp +++ b/gfx/layers/ipc/ShadowLayers.cpp @@ -14,7 +14,7 @@ #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" diff --git a/gfx/layers/wr/WebRenderLayerManager.cpp b/gfx/layers/wr/WebRenderLayerManager.cpp index 1d4f766ca31ae..2b2cc937c1eb9 100644 --- a/gfx/layers/wr/WebRenderLayerManager.cpp +++ b/gfx/layers/wr/WebRenderLayerManager.cpp @@ -7,7 +7,7 @@ #include "WebRenderLayerManager.h" #include "BasicLayers.h" -#include "gfxPrefs.h" + #include "GeckoProfiler.h" #include "LayersLogging.h" #include "mozilla/dom/BrowserChild.h" diff --git a/gfx/tests/gtest/TestCompositor.cpp b/gfx/tests/gtest/TestCompositor.cpp index 167630ec555a6..e4ce3b6d50c11 100644 --- a/gfx/tests/gtest/TestCompositor.cpp +++ b/gfx/tests/gtest/TestCompositor.cpp @@ -3,7 +3,6 @@ * http://creativecommons.org/publicdomain/zero/1.0/ */ -#include "gfxPrefs.h" #include "gfxUtils.h" #include "gtest/gtest.h" #include "TestLayers.h" diff --git a/gfx/tests/gtest/TestGfxPrefs.cpp b/gfx/tests/gtest/TestGfxPrefs.cpp deleted file mode 100644 index 4e96f3de797b4..0000000000000 --- 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)); -} diff --git a/gfx/tests/gtest/TestTextureCompatibility.cpp b/gfx/tests/gtest/TestTextureCompatibility.cpp index ba152dfe8488f..2e5236614dd3f 100644 --- a/gfx/tests/gtest/TestTextureCompatibility.cpp +++ b/gfx/tests/gtest/TestTextureCompatibility.cpp @@ -22,6 +22,7 @@ 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; diff --git a/gfx/tests/gtest/TestVsync.cpp b/gfx/tests/gtest/TestVsync.cpp index fd19cc55a6c1d..776d7f21e8b19 100644 --- a/gfx/tests/gtest/TestVsync.cpp +++ b/gfx/tests/gtest/TestVsync.cpp @@ -6,7 +6,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" #include "gfxPlatform.h" -#include "gfxPrefs.h" + #include "MainThreadUtils.h" #include "nsIThread.h" #include "mozilla/RefPtr.h" @@ -70,7 +70,6 @@ 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."); } diff --git a/gfx/tests/gtest/moz.build b/gfx/tests/gtest/moz.build index 17a02fcd26c1e..9a2120a96dbd6 100644 --- a/gfx/tests/gtest/moz.build +++ b/gfx/tests/gtest/moz.build @@ -35,7 +35,6 @@ if not(CONFIG['OS_TARGET'] == 'WINNT' and CONFIG['CPU_ARCH'] == 'aarch64'): if CONFIG['OS_TARGET'] != 'Android': UNIFIED_SOURCES += [ 'TestCompositor.cpp', - 'TestGfxPrefs.cpp', 'TestRect.cpp', 'TestTextureCompatibility.cpp', ] diff --git a/gfx/tests/marionette/test_pref_rollout_workaround.py b/gfx/tests/marionette/test_pref_rollout_workaround.py index 7207d41df1585..65baeb1bf3547 100644 --- a/gfx/tests/marionette/test_pref_rollout_workaround.py +++ b/gfx/tests/marionette/test_pref_rollout_workaround.py @@ -24,7 +24,7 @@ class WrPrefRolloutWorkAroundTestCase(MarionetteTestCase): ''' 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) diff --git a/gfx/thebes/gfxContext.cpp b/gfx/thebes/gfxContext.cpp index 84ee2df3d2ddb..083a8764df549 100644 --- a/gfx/thebes/gfxContext.cpp +++ b/gfx/thebes/gfxContext.cpp @@ -17,7 +17,7 @@ #include "gfxASurface.h" #include "gfxPattern.h" #include "gfxPlatform.h" -#include "gfxPrefs.h" + #include "GeckoProfiler.h" #include "gfx2DGlue.h" #include "mozilla/gfx/PathHelpers.h" diff --git a/gfx/thebes/gfxMacPlatformFontList.mm b/gfx/thebes/gfxMacPlatformFontList.mm index 9b12248306dc7..57a714f1b513e 100644 --- a/gfx/thebes/gfxMacPlatformFontList.mm +++ b/gfx/thebes/gfxMacPlatformFontList.mm @@ -755,7 +755,7 @@ explicit gfxMacFontFamily(const nsACString& aName, double aSizeHint) // 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; diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index 127f0d90b06ae..87b27cdaf70d7 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -32,7 +32,7 @@ #include "gfxCrashReporterUtils.h" #include "gfxPlatform.h" -#include "gfxPrefs.h" + #include "gfxEnv.h" #include "gfxTextRun.h" #include "gfxUserFontSet.h" @@ -845,8 +845,6 @@ void gfxPlatform::Init() { } gEverInitialized = true; - // Initialize the preferences by creating the singleton. - gfxPrefs::GetSingleton(); gfxVars::Initialize(); gfxConfig::Init(); @@ -1243,7 +1241,6 @@ void gfxPlatform::Shutdown() { delete gGfxPlatformPrefsLock; gfxVars::Shutdown(); - gfxPrefs::DestroySingleton(); gfxFont::DestroySingletons(); gfxConfig::Shutdown(); @@ -2358,8 +2355,6 @@ void gfxPlatform::InitAcceleration() { // explicit. MOZ_ASSERT(NS_IsMainThread(), "can only initialize prefs on the main thread"); - gfxPrefs::GetSingleton(); - nsCOMPtr gfxInfo = services::GetGfxInfo(); nsCString discardFailureId; int32_t status; @@ -3249,11 +3244,6 @@ bool gfxPlatform::AsyncPanZoomEnabled() { #ifdef MOZ_WIDGET_ANDROID return true; #else - if (!gfxPrefs::SingletonExists()) { - // Make sure the gfxPrefs has been initialized before reading from it. - MOZ_ASSERT(NS_IsMainThread()); - gfxPrefs::GetSingleton(); - } return StaticPrefs::AsyncPanZoomEnabledDoNotUseDirectly(); #endif } diff --git a/gfx/thebes/gfxPrefs.cpp b/gfx/thebes/gfxPrefs.cpp deleted file mode 100644 index d0c9fe26a01fb..0000000000000 --- 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::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(); - 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(); } diff --git a/gfx/thebes/gfxPrefs.h b/gfx/thebes/gfxPrefs.h deleted file mode 100644 index 7d15618cdf629..0000000000000 --- 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 // for M_PI -#include -#include -#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 \ - 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 \ - 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 AtomicBool; - typedef mozilla::Atomic AtomicInt32; - typedef mozilla::Atomic 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& 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 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 - class PrefTemplate final : public TypedPref { - typedef TypedPref 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* 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 */ diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build index ea589f041553a..19cfb2fde0e4e 100644 --- a/gfx/thebes/moz.build +++ b/gfx/thebes/moz.build @@ -42,7 +42,6 @@ EXPORTS += [ 'gfxPlatform.h', 'gfxPlatformFontList.h', 'gfxPoint.h', - 'gfxPrefs.h', 'gfxQuad.h', 'gfxQuaternion.h', 'gfxRect.h', @@ -180,7 +179,6 @@ SOURCES += [ # gfxFontUtils.cpp and gfxPlatform.cpp include mac system header conflicting with point/size 'gfxFontUtils.cpp', 'gfxPlatform.cpp', - 'gfxPrefs.cpp', 'PrintTarget.cpp', 'PrintTargetThebes.cpp', ] diff --git a/gfx/vr/VRDisplayClient.cpp b/gfx/vr/VRDisplayClient.cpp index f58d222dc7c95..7cdbf42b228ef 100644 --- a/gfx/vr/VRDisplayClient.cpp +++ b/gfx/vr/VRDisplayClient.cpp @@ -8,7 +8,7 @@ #include "prlink.h" #include "prenv.h" -#include "gfxPrefs.h" + #include "nsIGlobalObject.h" #include "nsRefPtrHashtable.h" #include "nsString.h" diff --git a/gfx/vr/VRDisplayLocal.cpp b/gfx/vr/VRDisplayLocal.cpp index 351bd2cbad7a3..2f73c2616ff09 100644 --- a/gfx/vr/VRDisplayLocal.cpp +++ b/gfx/vr/VRDisplayLocal.cpp @@ -6,7 +6,7 @@ #include "VRDisplayLocal.h" #include "VRThread.h" -#include "gfxPrefs.h" + #include "gfxVR.h" #include "ipc/VRLayerParent.h" #include "mozilla/dom/GamepadBinding.h" // For GamepadMappingType diff --git a/gfx/vr/ipc/VRParent.cpp b/gfx/vr/ipc/VRParent.cpp index 360b1e72eac74..ef4b73ce64c5e 100644 --- a/gfx/vr/ipc/VRParent.cpp +++ b/gfx/vr/ipc/VRParent.cpp @@ -128,7 +128,6 @@ void VRParent::ActorDestroy(ActorDestroyReason aWhy) { #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 @@ -164,8 +163,6 @@ bool VRParent::Init(base::ProcessId aParentPid, const char* aParentBuildID, // Init crash reporter support. CrashReporterClient::InitSingleton(this); - // Ensure gfxPrefs are initialized. - gfxPrefs::GetSingleton(); gfxConfig::Init(); gfxVars::Initialize(); #if defined(XP_WIN) diff --git a/image/DecoderFactory.cpp b/image/DecoderFactory.cpp index bf2c5b4c5a7ab..83bb69e2eacbc 100644 --- a/image/DecoderFactory.cpp +++ b/image/DecoderFactory.cpp @@ -5,7 +5,6 @@ #include "DecoderFactory.h" -#include "gfxPrefs.h" #include "nsMimeTypes.h" #include "mozilla/RefPtr.h" diff --git a/image/Downscaler.cpp b/image/Downscaler.cpp index 448e23075281c..17a7351fc0460 100644 --- a/image/Downscaler.cpp +++ b/image/Downscaler.cpp @@ -8,7 +8,7 @@ #include #include -#include "gfxPrefs.h" + #include "mozilla/gfx/2D.h" using std::max; diff --git a/image/DownscalingFilter.h b/image/DownscalingFilter.h index 428798302d124..6a2b93c69d5b5 100644 --- a/image/DownscalingFilter.h +++ b/image/DownscalingFilter.h @@ -23,7 +23,6 @@ #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" diff --git a/image/IDecodingTask.cpp b/image/IDecodingTask.cpp index 2b8f641bcdf4d..aba407d59263e 100644 --- a/image/IDecodingTask.cpp +++ b/image/IDecodingTask.cpp @@ -5,7 +5,6 @@ #include "IDecodingTask.h" -#include "gfxPrefs.h" #include "nsThreadUtils.h" #include "Decoder.h" diff --git a/image/Image.cpp b/image/Image.cpp index 06ebeb874ebde..9136fc2884073 100644 --- a/image/Image.cpp +++ b/image/Image.cpp @@ -4,7 +4,7 @@ * 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" diff --git a/image/ImageFactory.cpp b/image/ImageFactory.cpp index 31a239805a27c..27f0db4a273a9 100644 --- a/image/ImageFactory.cpp +++ b/image/ImageFactory.cpp @@ -110,9 +110,6 @@ already_AddRefed 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); diff --git a/image/build/nsImageModule.cpp b/image/build/nsImageModule.cpp index a7e0fefabd7ad..6e5c8103aebf7 100644 --- a/image/build/nsImageModule.cpp +++ b/image/build/nsImageModule.cpp @@ -13,7 +13,6 @@ #include "ShutdownTracker.h" #include "SurfaceCache.h" -#include "gfxPrefs.h" #include "imgLoader.h" using namespace mozilla::image; @@ -26,9 +25,6 @@ nsresult mozilla::image::EnsureModuleInitialized() { return NS_OK; } - // Make sure the preferences are initialized - gfxPrefs::GetSingleton(); - mozilla::image::ShutdownTracker::Initialize(); mozilla::image::ImageFactory::Initialize(); mozilla::image::DecodePool::Initialize(); diff --git a/image/imgFrame.cpp b/image/imgFrame.cpp index 80e93aea30ecc..06e6f7856357e 100644 --- a/image/imgFrame.cpp +++ b/image/imgFrame.cpp @@ -13,7 +13,7 @@ #include "gfx2DGlue.h" #include "gfxPlatform.h" -#include "gfxPrefs.h" + #include "gfxUtils.h" #include "GeckoProfiler.h" diff --git a/image/test/gtest/Common.cpp b/image/test/gtest/Common.cpp index b0ef2bdd3fc2f..e79f87dee8c81 100644 --- a/image/test/gtest/Common.cpp +++ b/image/test/gtest/Common.cpp @@ -8,7 +8,7 @@ #include #include "gfxPlatform.h" -#include "gfxPrefs.h" + #include "nsDirectoryServiceDefs.h" #include "nsIDirectoryService.h" #include "nsIFile.h" @@ -281,7 +281,6 @@ bool RowHasPixels(SourceSurface* aSurface, int32_t aRow, /////////////////////////////////////////////////////////////////////////////// already_AddRefed CreateTrivialDecoder() { - gfxPrefs::GetSingleton(); DecoderType decoderType = DecoderFactory::GetDecoderType("image/gif"); auto sourceBuffer = MakeNotNull>(); RefPtr decoder = DecoderFactory::CreateAnonymousDecoder( diff --git a/image/test/gtest/TestBlendAnimationFilter.cpp b/image/test/gtest/TestBlendAnimationFilter.cpp index 3106a38664a7c..f47fb32001046 100644 --- a/image/test/gtest/TestBlendAnimationFilter.cpp +++ b/image/test/gtest/TestBlendAnimationFilter.cpp @@ -20,7 +20,6 @@ using namespace mozilla::gfx; using namespace mozilla::image; static already_AddRefed CreateTrivialBlendingDecoder() { - gfxPrefs::GetSingleton(); DecoderType decoderType = DecoderFactory::GetDecoderType("image/gif"); DecoderFlags decoderFlags = DefaultDecoderFlags(); SurfaceFlags surfaceFlags = DefaultSurfaceFlags(); diff --git a/js/xpconnect/src/XPCShellImpl.cpp b/js/xpconnect/src/XPCShellImpl.cpp index b758d508768d7..79d6d90869391 100644 --- a/js/xpconnect/src/XPCShellImpl.cpp +++ b/js/xpconnect/src/XPCShellImpl.cpp @@ -39,7 +39,7 @@ #include "nsIScriptSecurityManager.h" #include "nsIPrincipal.h" #include "nsJSUtils.h" -#include "gfxPrefs.h" + #include "nsIXULRuntime.h" #include "GeckoProfiler.h" @@ -1327,8 +1327,6 @@ int XRE_XPCShellMain(int argc, char** argv, char** envp, 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 diff --git a/layout/base/AccessibleCaretEventHub.cpp b/layout/base/AccessibleCaretEventHub.cpp index b7dbbf5353dbc..a785b8327c115 100644 --- a/layout/base/AccessibleCaretEventHub.cpp +++ b/layout/base/AccessibleCaretEventHub.cpp @@ -9,7 +9,7 @@ #include "AccessibleCaretLogger.h" #include "AccessibleCaretManager.h" #include "Layers.h" -#include "gfxPrefs.h" + #include "mozilla/AutoRestore.h" #include "mozilla/MouseEvents.h" #include "mozilla/PresShell.h" diff --git a/layout/base/MobileViewportManager.cpp b/layout/base/MobileViewportManager.cpp index 8fc3cab153f62..f85c72f8b2da1 100644 --- a/layout/base/MobileViewportManager.cpp +++ b/layout/base/MobileViewportManager.cpp @@ -6,7 +6,6 @@ #include "MobileViewportManager.h" -#include "gfxPrefs.h" #include "LayersLogging.h" #include "mozilla/PresShell.h" #include "mozilla/dom/Document.h" diff --git a/layout/base/TouchManager.cpp b/layout/base/TouchManager.cpp index 209489a64b686..2b79b9537848e 100644 --- a/layout/base/TouchManager.cpp +++ b/layout/base/TouchManager.cpp @@ -7,7 +7,6 @@ #include "TouchManager.h" -#include "gfxPrefs.h" #include "mozilla/dom/EventTarget.h" #include "mozilla/PresShell.h" #include "nsIFrame.h" diff --git a/layout/base/gtest/TestAccessibleCaretEventHub.cpp b/layout/base/gtest/TestAccessibleCaretEventHub.cpp index 750bf988ef4f5..b4859b3235a73 100644 --- a/layout/base/gtest/TestAccessibleCaretEventHub.cpp +++ b/layout/base/gtest/TestAccessibleCaretEventHub.cpp @@ -11,7 +11,7 @@ #include #include "AccessibleCaretManager.h" -#include "gfxPrefs.h" + #include "mozilla/AccessibleCaretEventHub.h" #include "mozilla/BasicEvents.h" #include "mozilla/MouseEvents.h" diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp index cb9cc4700677b..d57e137aa0a70 100644 --- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -66,7 +66,7 @@ #include "LayerUserData.h" #include "ClientLayerManager.h" #include "mozilla/dom/NotifyPaintEvent.h" -#include "gfxPrefs.h" + #include "nsIDOMChromeWindow.h" #include "nsFrameLoader.h" #include "nsContentUtils.h" @@ -339,10 +339,6 @@ bool nsPresContext::IsChromeOriginImage() const { } 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(); } diff --git a/layout/base/nsRefreshDriver.cpp b/layout/base/nsRefreshDriver.cpp index 51015614be030..7eed0b35aebc4 100644 --- a/layout/base/nsRefreshDriver.cpp +++ b/layout/base/nsRefreshDriver.cpp @@ -64,7 +64,7 @@ #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" @@ -990,9 +990,6 @@ 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; diff --git a/layout/forms/nsButtonFrameRenderer.cpp b/layout/forms/nsButtonFrameRenderer.cpp index 027012c68c251..763cf2468d2e8 100644 --- a/layout/forms/nsButtonFrameRenderer.cpp +++ b/layout/forms/nsButtonFrameRenderer.cpp @@ -18,7 +18,7 @@ #include "mozilla/EventStates.h" #include "mozilla/dom/Element.h" #include "Layers.h" -#include "gfxPrefs.h" + #include "gfxUtils.h" #include "mozilla/layers/RenderRootStateManager.h" diff --git a/layout/generic/ScrollAnimationBezierPhysics.cpp b/layout/generic/ScrollAnimationBezierPhysics.cpp index 716305ca1ff57..cfc0fa41de4bf 100644 --- a/layout/generic/ScrollAnimationBezierPhysics.cpp +++ b/layout/generic/ScrollAnimationBezierPhysics.cpp @@ -5,7 +5,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "ScrollAnimationBezierPhysics.h" -#include "gfxPrefs.h" using namespace mozilla; diff --git a/layout/generic/ScrollAnimationMSDPhysics.cpp b/layout/generic/ScrollAnimationMSDPhysics.cpp index fa9a16e541830..9da4af1984f1e 100644 --- a/layout/generic/ScrollAnimationMSDPhysics.cpp +++ b/layout/generic/ScrollAnimationMSDPhysics.cpp @@ -5,7 +5,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "ScrollAnimationMSDPhysics.h" -#include "gfxPrefs.h" using namespace mozilla; diff --git a/layout/generic/ScrollSnap.cpp b/layout/generic/ScrollSnap.cpp index 0fe65b526568e..df70bc8785f1c 100644 --- a/layout/generic/ScrollSnap.cpp +++ b/layout/generic/ScrollSnap.cpp @@ -7,7 +7,7 @@ #include "ScrollSnap.h" #include "FrameMetrics.h" -#include "gfxPrefs.h" + #include "mozilla/Maybe.h" #include "mozilla/Preferences.h" #include "nsLineLayout.h" diff --git a/layout/generic/nsBulletFrame.cpp b/layout/generic/nsBulletFrame.cpp index 6f9b88caf0dfa..f95490197cff5 100644 --- a/layout/generic/nsBulletFrame.cpp +++ b/layout/generic/nsBulletFrame.cpp @@ -10,7 +10,7 @@ #include "gfx2DGlue.h" #include "gfxContext.h" -#include "gfxPrefs.h" + #include "gfxUtils.h" #include "mozilla/gfx/2D.h" #include "mozilla/gfx/PathHelpers.h" diff --git a/layout/generic/nsCanvasFrame.h b/layout/generic/nsCanvasFrame.h index d84994fcbb758..6f023d269584e 100644 --- a/layout/generic/nsCanvasFrame.h +++ b/layout/generic/nsCanvasFrame.h @@ -16,7 +16,6 @@ #include "nsIPopupContainer.h" #include "nsDisplayList.h" #include "nsIAnonymousContentCreator.h" -#include "gfxPrefs.h" class nsPresContext; class gfxContext; diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 17beb0c4ed7c9..ecb19ead16625 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -61,7 +61,6 @@ #include "nsIFrameInlines.h" #include "nsILayoutHistoryState.h" #include "gfxPlatform.h" -#include "gfxPrefs.h" #include "mozilla/StaticPrefs.h" #include "ScrollAnimationPhysics.h" #include "ScrollAnimationBezierPhysics.h" diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index 6b7b6b68cca8b..9fcc7daa8ca16 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -9,7 +9,7 @@ #include "nsTextFrame.h" #include "gfx2DGlue.h" -#include "gfxPrefs.h" + #include "gfxUtils.h" #include "mozilla/Attributes.h" #include "mozilla/ComputedStyle.h" diff --git a/layout/painting/DisplayListChecker.cpp b/layout/painting/DisplayListChecker.cpp index 76913cf00c6b1..b7c52ef40e02e 100644 --- a/layout/painting/DisplayListChecker.cpp +++ b/layout/painting/DisplayListChecker.cpp @@ -6,7 +6,6 @@ #include "DisplayListChecker.h" -#include "gfxPrefs.h" #include "nsDisplayList.h" namespace mozilla { diff --git a/layout/svg/nsFilterInstance.cpp b/layout/svg/nsFilterInstance.cpp index dcbfcd9a1a48e..57401319a4dbb 100644 --- a/layout/svg/nsFilterInstance.cpp +++ b/layout/svg/nsFilterInstance.cpp @@ -17,7 +17,7 @@ #include "gfx2DGlue.h" #include "gfxContext.h" #include "gfxPlatform.h" -#include "gfxPrefs.h" + #include "gfxUtils.h" #include "mozilla/Unused.h" #include "mozilla/gfx/Filters.h" diff --git a/layout/svg/nsSVGIntegrationUtils.cpp b/layout/svg/nsSVGIntegrationUtils.cpp index 53ce9eedca549..de285089fa263 100644 --- a/layout/svg/nsSVGIntegrationUtils.cpp +++ b/layout/svg/nsSVGIntegrationUtils.cpp @@ -9,7 +9,7 @@ // Keep others in (case-insensitive) order: #include "gfxDrawable.h" -#include "gfxPrefs.h" + #include "nsCSSAnonBoxes.h" #include "nsCSSClipPathInstance.h" #include "nsDisplayList.h" diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index 550b01973b9ab..01cc11e512908 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -50,7 +50,6 @@ #include "nsStyleChangeList.h" #include -#include "gfxPrefs.h" #include "mozilla/layers/StackingContextHelper.h" #include "mozilla/layers/RenderRootStateManager.h" diff --git a/layout/xul/nsBoxFrame.cpp b/layout/xul/nsBoxFrame.cpp index 41a3506449413..96dd27bbef0bd 100644 --- a/layout/xul/nsBoxFrame.cpp +++ b/layout/xul/nsBoxFrame.cpp @@ -42,7 +42,6 @@ #include "nsBoxFrame.h" -#include "gfxPrefs.h" #include "gfxUtils.h" #include "mozilla/gfx/2D.h" #include "nsBoxLayoutState.h" diff --git a/layout/xul/nsSliderFrame.cpp b/layout/xul/nsSliderFrame.cpp index 97d473696a32d..d1ca8c6cb89dc 100644 --- a/layout/xul/nsSliderFrame.cpp +++ b/layout/xul/nsSliderFrame.cpp @@ -13,7 +13,6 @@ #include "nsSliderFrame.h" -#include "gfxPrefs.h" #include "mozilla/ComputedStyle.h" #include "nsPresContext.h" #include "nsIContent.h" diff --git a/toolkit/content/aboutSupport.js b/toolkit/content/aboutSupport.js index f10100c10729e..79762f87a0b67 100644 --- a/toolkit/content/aboutSupport.js +++ b/toolkit/content/aboutSupport.js @@ -557,7 +557,7 @@ var snapshotFormatters = { 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); } diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index e07b7b89afe10..9eca6d1941114 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -98,7 +98,6 @@ #include "nsAppShellCID.h" #include "mozilla/scache/StartupCache.h" #include "gfxPlatform.h" -#include "gfxPrefs.h" #include "mozilla/Unused.h" @@ -1833,10 +1832,6 @@ static ReturnAbortOnError ShowProfileManager( 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); diff --git a/view/nsViewManager.cpp b/view/nsViewManager.cpp index 8524ebadee76f..75afd92b3e6e0 100644 --- a/view/nsViewManager.cpp +++ b/view/nsViewManager.cpp @@ -26,7 +26,6 @@ #include "nsLayoutUtils.h" #include "Layers.h" #include "gfxPlatform.h" -#include "gfxPrefs.h" /** XXX TODO XXX diff --git a/widget/GfxInfoBase.cpp b/widget/GfxInfoBase.cpp index dbe651c960597..37908349d649e 100644 --- a/widget/GfxInfoBase.cpp +++ b/widget/GfxInfoBase.cpp @@ -29,7 +29,7 @@ #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" @@ -589,7 +589,6 @@ GfxInfoBase::~GfxInfoBase() {} nsresult GfxInfoBase::Init() { InitGfxDriverInfoShutdownObserver(); - gfxPrefs::GetSingleton(); nsCOMPtr os = mozilla::services::GetObserverService(); if (os) { diff --git a/widget/nsXPLookAndFeel.cpp b/widget/nsXPLookAndFeel.cpp index e99aac5bdec93..ba1ff5326ee24 100644 --- a/widget/nsXPLookAndFeel.cpp +++ b/widget/nsXPLookAndFeel.cpp @@ -19,7 +19,7 @@ #include "mozilla/widget/WidgetMessageUtils.h" #include "gfxPlatform.h" -#include "gfxPrefs.h" + #include "qcms.h" #ifdef DEBUG @@ -879,10 +879,6 @@ nsresult nsXPLookAndFeel::GetColorImpl(ColorID aID, 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(); diff --git a/widget/windows/WinCompositorWidget.cpp b/widget/windows/WinCompositorWidget.cpp index dc5dfe3b829ce..72d9e26b17a94 100644 --- a/widget/windows/WinCompositorWidget.cpp +++ b/widget/windows/WinCompositorWidget.cpp @@ -4,7 +4,7 @@ * 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" diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index fa8c39d29a7ab..f2521cc0e26ca 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -57,7 +57,7 @@ #include "gfx2DGlue.h" #include "gfxEnv.h" #include "gfxPlatform.h" -#include "gfxPrefs.h" + #include "mozilla/AutoRestore.h" #include "mozilla/Logging.h" #include "mozilla/MathAlgorithms.h" diff --git a/widget/windows/nsWindowBase.cpp b/widget/windows/nsWindowBase.cpp index 5aa0fdd0dfbda..ed8774caebdd3 100644 --- a/widget/windows/nsWindowBase.cpp +++ b/widget/windows/nsWindowBase.cpp @@ -5,7 +5,6 @@ #include "nsWindowBase.h" -#include "gfxPrefs.h" #include "mozilla/MiscEvents.h" #include "mozilla/PresShell.h" #include "KeyboardLayout.h"