Bug 1432515 - Restrict gfx.webrender.{all,enabled} to nightly, and only allow enabling via .all.qualified on beta and release. r=milan

This ensures that only people with qualified hardware can flip prefs to
enable WebRender on beta and release. Nightly users will still be able
enable WebRender on unqualified hardware.

MozReview-Commit-ID: E5sgzZhuX4p

--HG--
extra : rebase_source : a4e85e71e4d85b5d9f1e17c1413ca9690349f75a
This commit is contained in:
Kartikaya Gupta 2018-05-09 15:24:38 -04:00
Родитель 65635d2855
Коммит 6eea99c630
2 изменённых файлов: 34 добавлений и 4 удалений

Просмотреть файл

@ -2506,8 +2506,16 @@ void
gfxPlatform::InitWebRenderConfig()
{
bool prefEnabled = WebRenderPrefEnabled();
bool envvarEnabled = WebRenderEnvvarEnabled();
ScopedGfxFeatureReporter reporter("WR", prefEnabled);
// On Nightly:
// WR? WR+ => means WR was enabled via gfx.webrender.all.qualified
// WR! WR+ => means WR was enabled via gfx.webrender.{all,enabled} or envvar
// On Beta/Release:
// WR? WR+ => means WR was enabled via gfx.webrender.all.qualified on qualified hardware
// WR! WR+ => means WR was enabled via envvar, possibly on unqualified hardware.
// In all cases WR- means WR was not enabled, for one of many possible reasons.
ScopedGfxFeatureReporter reporter("WR", prefEnabled || envvarEnabled);
if (!XRE_IsParentProcess()) {
// The parent process runs through all the real decision-making code
// later in this function. For other processes we still want to report
@ -2525,10 +2533,19 @@ gfxPlatform::InitWebRenderConfig()
"WebRender is an opt-in feature",
NS_LITERAL_CSTRING("FEATURE_FAILURE_DEFAULT_OFF"));
if (prefEnabled) {
featureWebRender.UserEnable("Force enabled by pref");
} else if (WebRenderEnvvarEnabled()) {
// envvar works everywhere; we need this for testing in CI. Sadly this allows
// beta/release to enable it on unqualified hardware, but at least this is
// harder for the average person than flipping a pref.
if (envvarEnabled) {
featureWebRender.UserEnable("Force enabled by envvar");
// gfx.webrender.enabled and gfx.webrender.all only work on nightly
#ifdef NIGHTLY_BUILD
} else if (prefEnabled) {
featureWebRender.UserEnable("Force enabled by pref");
#endif
// gfx.webrender.all.qualified works on all channels
} else if (gfxPrefs::WebRenderAllQualified()) {
nsCOMPtr<nsIGfxInfo> gfxInfo = services::GetGfxInfo();
nsCString discardFailureId;

Просмотреть файл

@ -848,12 +848,25 @@ pref("gfx.logging.peak-texture-usage.enabled", false);
pref("gfx.ycbcr.accurate-conversion", false);
// On Nightly, we expose two prefs: gfx.webrender.all and gfx.webrender.enabled.
// The first enables WR+additional features, and the second just enables WR.
// For developer convenience, building with --enable-webrender=true or just
// --enable-webrender will set gfx.webrender.enabled to true by default.
// On non-Nightly, we ignore these prefs.
//
// On both Nightly and non-Nightly, we have a pref gfx.webrender.all.qualified
// which is not exposed via about:config. That pref enables WR but only on
// qualified hardware. This is the pref we'll eventually flip to deploy WebRender
// to the target population.
#ifdef NIGHTLY_BUILD
pref("gfx.webrender.all", false);
#ifdef MOZ_ENABLE_WEBRENDER
pref("gfx.webrender.enabled", true);
#else
pref("gfx.webrender.enabled", false);
#endif
#endif
#ifdef XP_WIN
pref("gfx.webrender.force-angle", true);
pref("gfx.webrender.dcomp-win.enabled", true);