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)
This commit is contained in:
wolfbeast 2020-01-25 21:26:24 +01:00 committed by Roy Tam
commit a085fa5430
9 changed files with 17 additions and 74 deletions

View file

@ -4505,7 +4505,16 @@ pref("network.tcp.keepalive.probe_count", 4);
#endif
// Whether to disable acceleration for all widgets.
pref("layers.acceleration.disabled", false);
#if defined(XP_UNIX) && !defined(XP_MACOSX)
// On Linux this is disabled by default for known issues with "free" drivers
pref("layers.acceleration.enabled", false);
#else
pref("layers.acceleration.enabled", true);
#endif
// Whether to force acceleration on, ignoring blacklists.
// This requires layers.acceleration.enabled to be set to true
pref("layers.acceleration.force", false);
// Preference that when switched at runtime will run a series of benchmarks
// and output the result to stderr.
pref("layers.bench.enabled", false);
@ -4514,18 +4523,6 @@ pref("layers.bench.enabled", false);
pref("layers.gpu-process.dev.enabled", true);
#endif
// Whether to force acceleration on, ignoring blacklists.
#ifdef ANDROID
// bug 838603 -- on Android, accidentally blacklisting OpenGL layers
// means a startup crash for everyone.
// Temporarily force-enable GL compositing. This is default-disabled
// deep within the bowels of the widgetry system. Remove me when GL
// compositing isn't default disabled in widget/android.
pref("layers.acceleration.force-enabled", true);
#else
pref("layers.acceleration.force-enabled", false);
#endif
pref("layers.acceleration.draw-fps", false);
// Enable DEAA antialiasing for transformed layers in the compositor