Bug 1350962 - Log WebRender status into the app notes of crash reports. r?milan
This will add "WR?" if the pref is not set to true, or "WR!" if the pref is set
to true (which indicates the user flipped it), followed by "WR+" or "WR-" which
indicates whether or not WebRender is enabled.
MozReview-Commit-ID: F3h5UowCxij
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -2291,20 +2291,23 @@ gfxPlatform::InitWebRenderConfig()
{
FeatureState& featureWebRender = gfxConfig::GetFeature(Feature::WEBRENDER);
featureWebRender.DisableByDefault(
FeatureStatus::OptIn,
"WebRender is an opt-in feature",
NS_LITERAL_CSTRING("FEATURE_FAILURE_DEFAULT_OFF"));
- if (Preferences::GetBool("gfx.webrender.enabled", false)) {
+ bool prefEnabled = Preferences::GetBool("gfx.webrender.enabled", false);
+ if (prefEnabled) {
featureWebRender.UserEnable("Enabled by pref");
}
+ ScopedGfxFeatureReporter reporter("WR", prefEnabled);
+
// WebRender relies on the GPU process when on Windows
#ifdef XP_WIN
if (!gfxConfig::IsEnabled(Feature::GPU_PROCESS)) {
featureWebRender.ForceDisable(
FeatureStatus::Unavailable,
"GPU Process is disabled",
NS_LITERAL_CSTRING("FEATURE_FAILURE_GPU_PROCESS_DISABLED"));
}
@@ -2320,17 +2323,20 @@ gfxPlatform::InitWebRenderConfig()
#ifndef MOZ_BUILD_WEBRENDER
featureWebRender.ForceDisable(
FeatureStatus::Unavailable,
"Build doesn't include WebRender",
NS_LITERAL_CSTRING("FEATURE_FAILURE_NO_WEBRENDER"));
#endif
// gfxFeature is not usable in the GPU process, so we use gfxVars to transmit this feature
- gfxVars::SetUseWebRender(gfxConfig::IsEnabled(Feature::WEBRENDER));
+ if (gfxConfig::IsEnabled(Feature::WEBRENDER)) {
+ gfxVars::SetUseWebRender(true);
+ reporter.SetSuccessful();
+ }
}
bool
gfxPlatform::CanUseHardwareVideoDecoding()
{
// this function is called from the compositor thread, so it is not
// safe to init the prefs etc. from here.
MOZ_ASSERT(sLayersAccelerationPrefsInitialized);