Bug 1864652 - Expose settings for Global Privacy Control. r=geckoview-reviewers,ohall...
[gecko.git] / gfx / config / gfxConfigManager.h
blob9d8d0cdc9894c95d1a8cc2be069cb4a3096a6782
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_gfx_config_gfxConfigManager_h
7 #define mozilla_gfx_config_gfxConfigManager_h
9 #include "gfxFeature.h"
10 #include "gfxTypes.h"
11 #include "nsCOMPtr.h"
13 class nsIGfxInfo;
15 namespace mozilla {
16 namespace gfx {
18 class gfxConfigManager {
19 public:
20 gfxConfigManager()
21 : mFeatureWr(nullptr),
22 mFeatureWrCompositor(nullptr),
23 mFeatureWrAngle(nullptr),
24 mFeatureWrDComp(nullptr),
25 mFeatureWrPartial(nullptr),
26 mFeatureWrShaderCache(nullptr),
27 mFeatureWrOptimizedShaders(nullptr),
28 mFeatureWrScissoredCacheClears(nullptr),
29 mFeatureHwCompositing(nullptr),
30 mFeatureD3D11HwAngle(nullptr),
31 mFeatureD3D11Compositing(nullptr),
32 mFeatureGPUProcess(nullptr),
33 mWrForceEnabled(false),
34 mWrSoftwareForceEnabled(false),
35 mWrCompositorForceEnabled(false),
36 mWrForceAngle(false),
37 mWrForceAngleNoGPUProcess(false),
38 mWrDCompWinEnabled(false),
39 mWrCompositorDCompRequired(false),
40 mWrForcePartialPresent(false),
41 mWrPartialPresent(false),
42 mWrOptimizedShaders(false),
43 mWrScissoredCacheClearsEnabled(false),
44 mWrScissoredCacheClearsForceEnabled(false),
45 mGPUProcessAllowSoftware(false),
46 mWrEnvForceEnabled(false),
47 mScaledResolution(false),
48 mDisableHwCompositingNoWr(false),
49 mIsNightly(false),
50 mIsEarlyBetaOrEarlier(false),
51 mSafeMode(false),
52 mIsWin11OrLater(false) {}
54 void Init();
56 void ConfigureWebRender();
57 void ConfigureFromBlocklist(long aFeature, FeatureState* aFeatureState);
59 protected:
60 void EmplaceUserPref(const char* aPrefName, Maybe<bool>& aValue);
61 void ConfigureWebRenderQualified();
63 nsCOMPtr<nsIGfxInfo> mGfxInfo;
65 FeatureState* mFeatureWr;
66 FeatureState* mFeatureWrCompositor;
67 FeatureState* mFeatureWrAngle;
68 FeatureState* mFeatureWrDComp;
69 FeatureState* mFeatureWrPartial;
70 FeatureState* mFeatureWrShaderCache;
71 FeatureState* mFeatureWrOptimizedShaders;
72 FeatureState* mFeatureWrScissoredCacheClears;
74 FeatureState* mFeatureHwCompositing;
75 FeatureState* mFeatureD3D11HwAngle;
76 FeatureState* mFeatureD3D11Compositing;
77 FeatureState* mFeatureGPUProcess;
79 /**
80 * Prefs
82 Maybe<bool> mWrCompositorEnabled;
83 bool mWrForceEnabled;
84 bool mWrSoftwareForceEnabled;
85 bool mWrCompositorForceEnabled;
86 bool mWrForceAngle;
87 bool mWrForceAngleNoGPUProcess;
88 bool mWrDCompWinEnabled;
89 bool mWrCompositorDCompRequired;
90 bool mWrForcePartialPresent;
91 bool mWrPartialPresent;
92 Maybe<bool> mWrShaderCache;
93 bool mWrOptimizedShaders;
94 bool mWrScissoredCacheClearsEnabled;
95 bool mWrScissoredCacheClearsForceEnabled;
96 bool mGPUProcessAllowSoftware;
98 /**
99 * Environment variables
101 bool mWrEnvForceEnabled;
104 * System support
106 HwStretchingSupport mHwStretchingSupport;
107 bool mScaledResolution;
108 bool mDisableHwCompositingNoWr;
109 bool mIsNightly;
110 bool mIsEarlyBetaOrEarlier;
111 bool mSafeMode;
112 bool mIsWin11OrLater;
115 } // namespace gfx
116 } // namespace mozilla
118 #endif // mozilla_gfx_config_gfxConfigParams_h