Bug 1359061 - Report WR state via ScopedGfxFeatureReporter in all processes. r?dvander
We were only reporting the WR feature state in crash reports from the parent
process. However, it would be useful to have in GPU and content process crash
reports as well, so use the ScopedGfxFeatureReporter in those processes as well.
MozReview-Commit-ID: Em37uLVPboK
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -705,19 +705,17 @@ gfxPlatform::Init()
#elif defined(MOZ_WIDGET_GTK)
gPlatform = new gfxPlatformGtk;
#elif defined(ANDROID)
gPlatform = new gfxAndroidPlatform;
#else
#error "No gfxPlatform implementation available"
#endif
gPlatform->InitAcceleration();
- if (XRE_IsParentProcess()) {
- gPlatform->InitWebRenderConfig();
- }
+ gPlatform->InitWebRenderConfig();
if (gfxConfig::IsEnabled(Feature::GPU_PROCESS)) {
GPUProcessManager* gpu = GPUProcessManager::Get();
gpu->LaunchGPUProcess();
}
#ifdef USE_SKIA
SkGraphics::Init();
@@ -2332,30 +2330,40 @@ gfxPlatform::InitCompositorAccelerationP
feature.ForceDisable(FeatureStatus::Blocked, "Acceleration blocked by safe-mode",
NS_LITERAL_CSTRING("FEATURE_FAILURE_COMP_SAFEMODE"));
}
}
void
gfxPlatform::InitWebRenderConfig()
{
+ bool prefEnabled = Preferences::GetBool("gfx.webrender.enabled", false);
+
+ ScopedGfxFeatureReporter reporter("WR", prefEnabled);
+ 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
+ // the state of the feature for crash reports.
+ if (gfxVars::UseWebRender()) {
+ reporter.SetSuccessful();
+ }
+ return;
+ }
+
FeatureState& featureWebRender = gfxConfig::GetFeature(Feature::WEBRENDER);
featureWebRender.DisableByDefault(
FeatureStatus::OptIn,
"WebRender is an opt-in feature",
NS_LITERAL_CSTRING("FEATURE_FAILURE_DEFAULT_OFF"));
- 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"));
}