summaryrefslogtreecommitdiffstats
path: root/gfx/thebes/gfxPlatform.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-01-25 21:26:24 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-01-26 09:48:52 +0100
commit282b791acb826de9b537fce88bf49472d8e19977 (patch)
tree66305728b11d922ef5a8bd5e2f158ea651f99e5f /gfx/thebes/gfxPlatform.cpp
parenta64ac6d7022e4c88149d897864f857dce1063249 (diff)
downloadUXP-282b791acb826de9b537fce88bf49472d8e19977.tar
UXP-282b791acb826de9b537fce88bf49472d8e19977.tar.gz
UXP-282b791acb826de9b537fce88bf49472d8e19977.tar.lz
UXP-282b791acb826de9b537fce88bf49472d8e19977.tar.xz
UXP-282b791acb826de9b537fce88bf49472d8e19977.zip
Issue #1360 - Part 1: Simplify layers acceleration prefs.
This gets rid of platform-dependent hard-coded defaults, but keeps build-time blocking if there is no GL provider (in which case layers acceleration almost certainly won't work because it needs a GL compositor and would likely crash without) New prefs are - layers.acceleration.enabled to enable HWA - layers.acceleration.force to force it enabled (requires .enabled to be set as well) This is the platform part of this issue. The rest will be front-end work (Preference UI integration and pref migration)
Diffstat (limited to 'gfx/thebes/gfxPlatform.cpp')
-rw-r--r--gfx/thebes/gfxPlatform.cpp41
1 files changed, 4 insertions, 37 deletions
diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp
index 50d1fcb46..4cd044f90 100644
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -571,40 +571,6 @@ gfxPlatform::Init()
}
}
- // Drop a note in the crash report if we end up forcing an option that could
- // destabilize things. New items should be appended at the end (of an existing
- // or in a new section), so that we don't have to know the version to interpret
- // these cryptic strings.
- {
- nsAutoCString forcedPrefs;
- // D2D prefs
- forcedPrefs.AppendPrintf("FP(D%d%d",
- gfxPrefs::Direct2DDisabled(),
- gfxPrefs::Direct2DForceEnabled());
- // Layers prefs
- forcedPrefs.AppendPrintf("-L%d%d%d%d",
- gfxPrefs::LayersAMDSwitchableGfxEnabled(),
- gfxPrefs::LayersAccelerationDisabledDoNotUseDirectly(),
- gfxPrefs::LayersAccelerationForceEnabledDoNotUseDirectly(),
- gfxPrefs::LayersD3D11ForceWARP());
- // WebGL prefs
- forcedPrefs.AppendPrintf("-W%d%d%d%d%d%d%d%d",
- gfxPrefs::WebGLANGLEForceD3D11(),
- gfxPrefs::WebGLANGLEForceWARP(),
- gfxPrefs::WebGLDisabled(),
- gfxPrefs::WebGLDisableANGLE(),
- gfxPrefs::WebGLDXGLEnabled(),
- gfxPrefs::WebGLForceEnabled(),
- gfxPrefs::WebGLForceLayersReadback(),
- gfxPrefs::WebGLForceMSAA());
- // Prefs that don't fit into any of the other sections
- forcedPrefs.AppendPrintf("-T%d%d%d%d) ",
- gfxPrefs::AndroidRGB16Force(),
- gfxPrefs::CanvasAzureAccelerated(),
- gfxPrefs::DisableGralloc(),
- gfxPrefs::ForceShmemTiles());
- }
-
InitMoz2DLogging();
gGfxPlatformPrefsLock = new Mutex("gfxPlatform::gGfxPlatformPrefsLock");
@@ -2171,7 +2137,7 @@ gfxPlatform::InitCompositorAccelerationPrefs()
FeatureStatus::Blocked,
"Acceleration blocked by platform"))
{
- if (gfxPrefs::LayersAccelerationDisabledDoNotUseDirectly()) {
+ if (!gfxPrefs::LayersAccelerationEnabledDoNotUseDirectly()) {
feature.UserDisable("Disabled by pref",
NS_LITERAL_CSTRING("FEATURE_FAILURE_COMP_PREF"));
} else if (acceleratedEnv && *acceleratedEnv == '0') {
@@ -2185,8 +2151,9 @@ gfxPlatform::InitCompositorAccelerationPrefs()
}
// This has specific meaning elsewhere, so we always record it.
- if (gfxPrefs::LayersAccelerationForceEnabledDoNotUseDirectly()) {
- feature.UserForceEnable("Force-enabled by pref");
+ if (gfxPrefs::LayersAccelerationEnabledDoNotUseDirectly() &&
+ gfxPrefs::LayersAccelerationForceEnabledDoNotUseDirectly()) {
+ feature.UserForceEnable("Force-enabled by prefs");
}
// Safe mode trumps everything.