gfxConfigManager.h (3388B)
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 8 9 #include "gfxFeature.h" 10 #include "gfxTypes.h" 11 #include "nsCOMPtr.h" 12 13 class nsIGfxInfo; 14 15 namespace mozilla { 16 namespace gfx { 17 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 mFeatureGLNorm16Textures(nullptr), 34 mWrForceEnabled(false), 35 mWrSoftwareForceEnabled(false), 36 mWrCompositorForceEnabled(false), 37 mWrForceAngle(false), 38 mWrForceAngleNoGPUProcess(false), 39 mWrDCompWinEnabled(false), 40 mWrCompositorDCompRequired(false), 41 mWrForcePartialPresent(false), 42 mWrPartialPresent(false), 43 mWrOptimizedShaders(false), 44 mWrScissoredCacheClearsEnabled(false), 45 mWrScissoredCacheClearsForceEnabled(false), 46 mWrEnvForceEnabled(false), 47 mScaledResolution(false), 48 mDisableHwCompositingNoWr(false), 49 mIsNightly(false), 50 mIsEarlyBetaOrEarlier(false), 51 mSafeMode(false) {} 52 53 void Init(); 54 55 void ConfigureWebRender(); 56 void ConfigureFromBlocklist(long aFeature, FeatureState* aFeatureState); 57 58 protected: 59 void EmplaceUserPref(const char* aPrefName, Maybe<bool>& aValue); 60 void ConfigureWebRenderQualified(); 61 62 nsCOMPtr<nsIGfxInfo> mGfxInfo; 63 64 FeatureState* mFeatureWr; 65 FeatureState* mFeatureWrCompositor; 66 FeatureState* mFeatureWrAngle; 67 FeatureState* mFeatureWrDComp; 68 FeatureState* mFeatureWrPartial; 69 FeatureState* mFeatureWrShaderCache; 70 FeatureState* mFeatureWrOptimizedShaders; 71 FeatureState* mFeatureWrScissoredCacheClears; 72 73 FeatureState* mFeatureHwCompositing; 74 FeatureState* mFeatureD3D11HwAngle; 75 FeatureState* mFeatureD3D11Compositing; 76 FeatureState* mFeatureGPUProcess; 77 FeatureState* mFeatureGLNorm16Textures; 78 79 /** 80 * Prefs 81 */ 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 97 /** 98 * Environment variables 99 */ 100 bool mWrEnvForceEnabled; 101 102 /** 103 * System support 104 */ 105 HwStretchingSupport mHwStretchingSupport; 106 bool mScaledResolution; 107 bool mDisableHwCompositingNoWr; 108 bool mIsNightly; 109 bool mIsEarlyBetaOrEarlier; 110 bool mSafeMode; 111 }; 112 113 } // namespace gfx 114 } // namespace mozilla 115 116 #endif // mozilla_gfx_config_gfxConfigParams_h