Bug 1729894 - Now that WR is everyhwere, enable backdrop-filter on early-beta / nightly. r=jrmuizel

Differential Revision: https://phabricator.services.mozilla.com/D125054
This commit is contained in:
Emilio Cobos Álvarez 2021-09-13 18:22:42 +00:00
parent f163bbb0d8
commit 92dab3e4de
4 changed files with 26 additions and 49 deletions

View File

@ -3401,6 +3401,31 @@ exports.CSS_PROPERTIES = {
"unset"
]
},
"backdrop-filter": {
"isInherited": false,
"subproperties": [
"backdrop-filter"
],
"supports": [],
"values": [
"blur",
"brightness",
"contrast",
"drop-shadow",
"grayscale",
"hue-rotate",
"inherit",
"initial",
"invert",
"none",
"opacity",
"revert",
"saturate",
"sepia",
"unset",
"url"
]
},
"backface-visibility": {
"isInherited": false,
"subproperties": [

View File

@ -2518,11 +2518,6 @@ void gfxPlatform::InitWebRenderConfig() {
bool prefEnabled = WebRenderPrefEnabled();
bool envvarEnabled = WebRenderEnvvarEnabled();
// This would ideally be in the nsCSSProps code
// but nsCSSProps is initialized before gfxPlatform
// so it has to be done here.
gfxVars::AddReceiver(&nsCSSProps::GfxVarReceiver());
// WR? WR+ => means WR was enabled via gfx.webrender.all.qualified on
// qualified hardware
// WR! WR+ => means WR was enabled via gfx.webrender.{all,enabled} or
@ -2537,9 +2532,6 @@ void gfxPlatform::InitWebRenderConfig() {
// later in this function. For other processes we still want to report
// the state of the feature for crash reports.
if (gfxVars::UseWebRender()) {
// gfxVars doesn't notify receivers when initialized on content processes
// we need to explicitly recompute backdrop-filter's enabled state here.
nsCSSProps::RecomputeEnabledState("layout.css.backdrop-filter.enabled");
reporter.SetSuccessful();
}
return;

View File

@ -76,10 +76,6 @@ void nsCSSProps::RecomputeEnabledState(const char* aPref, void*) {
#else
gPropertyEnabled[pref->mPropID] = Preferences::GetBool(pref->mPref);
#endif
if (pref->mPropID == eCSSProperty_backdrop_filter) {
gPropertyEnabled[pref->mPropID] &=
gfx::gfxVars::GetUseWebRenderOrDefault();
}
}
}
MOZ_ASSERT(foundPref);
@ -216,40 +212,4 @@ bool nsCSSProps::gPropertyEnabled[eCSSProperty_COUNT_with_aliases] = {
#undef IS_ENABLED_BY_DEFAULT
};
/**
* A singleton class to register as a receiver for gfxVars.
* Updates the state of backdrop-filter's pref if the gfx
* WebRender var changes state.
*/
class nsCSSPropsGfxVarReceiver final : public gfx::gfxVarReceiver {
constexpr nsCSSPropsGfxVarReceiver() = default;
// WebRender's last known enabled state.
static bool sLastKnownUseWebRender;
static nsCSSPropsGfxVarReceiver sInstance;
public:
static gfx::gfxVarReceiver& GetInstance() { return sInstance; }
void OnVarChanged(const gfx::GfxVarUpdate&) override {
bool enabled = gfxVars::UseWebRender();
if (sLastKnownUseWebRender != enabled) {
sLastKnownUseWebRender = enabled;
nsCSSProps::RecomputeEnabledState("layout.css.backdrop-filter.enabled");
}
}
};
/* static */
nsCSSPropsGfxVarReceiver nsCSSPropsGfxVarReceiver::sInstance =
nsCSSPropsGfxVarReceiver();
/* static */
bool nsCSSPropsGfxVarReceiver::sLastKnownUseWebRender = false;
/* static */
gfx::gfxVarReceiver& nsCSSProps::GfxVarReceiver() {
return nsCSSPropsGfxVarReceiver::GetInstance();
}
#include "nsCSSPropsGenerated.inc"

View File

@ -6856,7 +6856,7 @@
# Is support for CSS backdrop-filter enabled?
- name: layout.css.backdrop-filter.enabled
type: bool
value: false
value: @IS_EARLY_BETA_OR_EARLIER@
mirror: always
# Should stray control characters be rendered visibly?