Bug 1627045 - Include some more information about feature status when blacklisting webrender. r=aosmond

This adds a helper for applying gfxinfo state to a gfxFeature. The
helper includes the blacking list reason which should give us some more
information for about:support and telemetry.

Differential Revision: https://phabricator.services.mozilla.com/D69427

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jeff Muizelaar 2020-04-02 19:38:19 +00:00
Родитель 54d761893e
Коммит ee2859de3e
1 изменённых файлов: 18 добавлений и 4 удалений

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

@ -1216,6 +1216,23 @@ static bool IsFeatureSupported(long aFeature, bool aDefault) {
}
return status == nsIGfxInfo::FEATURE_STATUS_OK;
}
static void ApplyGfxInfoFeature(long aFeature, FeatureState &aFeatureState) {
nsCOMPtr<nsIGfxInfo> gfxInfo = services::GetGfxInfo();
nsCString blockId;
int32_t status;
if (!NS_SUCCEEDED(gfxInfo->GetFeatureStatus(aFeature, blockId, &status))) {
aFeatureState.Disable(FeatureStatus::BlockedNoGfxInfo, "gfxInfo is broken",
NS_LITERAL_CSTRING("FEATURE_FAILURE_NO_GFX_INFO"));
} else {
if (status != nsIGfxInfo::FEATURE_STATUS_OK) {
aFeatureState.Disable(FeatureStatus::Blacklisted, "Blacklisted by gfxInfo",
blockId);
}
}
}
/* static*/
bool gfxPlatform::IsDXInterop2Blocked() {
return !IsFeatureSupported(nsIGfxInfo::FEATURE_DX_INTEROP2, false);
@ -3031,10 +3048,7 @@ void gfxPlatform::InitWebRenderConfig() {
featureComp.UserForceEnable("Force enabled by pref");
}
if (!IsFeatureSupported(nsIGfxInfo::FEATURE_WEBRENDER_COMPOSITOR, false)) {
featureComp.Disable(FeatureStatus::Blacklisted, "Blacklisted",
NS_LITERAL_CSTRING("FEATURE_FAILURE_BLACKLIST"));
}
ApplyGfxInfoFeature(nsIGfxInfo::FEATURE_WEBRENDER_COMPOSITOR, featureComp);
#ifdef XP_WIN
if (!gfxVars::UseWebRenderDCompWin()) {