Bug 1604380 - Disable partial present when picture caching is disabled r=gw

Partial present does not work when WR picture caching is disabled.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
sotaro 2019-12-17 05:05:30 +00:00
parent c0e95a6f66
commit a5ce70d85a
3 changed files with 16 additions and 8 deletions

View file

@ -45,6 +45,7 @@ class gfxVarReceiver;
_(UseWebRenderTripleBufferingWin, bool, false) \ _(UseWebRenderTripleBufferingWin, bool, false) \
_(UseWebRenderCompositor, bool, false) \ _(UseWebRenderCompositor, bool, false) \
_(UseWebRenderProgramBinaryDisk, bool, false) \ _(UseWebRenderProgramBinaryDisk, bool, false) \
_(WebRenderMaxPartialPresentRects, int32_t, 0) \
_(WebRenderDebugFlags, int32_t, 0) \ _(WebRenderDebugFlags, int32_t, 0) \
_(ScreenDepth, int32_t, 0) \ _(ScreenDepth, int32_t, 0) \
_(GREDirectory, nsString, nsString()) \ _(GREDirectory, nsString, nsString()) \

View file

@ -3342,16 +3342,23 @@ void gfxPlatform::InitWebRenderConfig() {
} }
// Initialize WebRender partial present config. // Initialize WebRender partial present config.
// It is used only for reporting to Decision Log.
if (StaticPrefs::gfx_webrender_max_partial_present_rects_AtStartup() > 0) {
// Partial present is used only when WebRender compositor is not used. // Partial present is used only when WebRender compositor is not used.
if (UseWebRender() && !gfxVars::UseWebRenderCompositor()) { if (StaticPrefs::gfx_webrender_max_partial_present_rects_AtStartup() > 0) {
if (UseWebRender()) {
FeatureState& featurePartial = FeatureState& featurePartial =
gfxConfig::GetFeature(Feature::WEBRENDER_PARTIAL); gfxConfig::GetFeature(Feature::WEBRENDER_PARTIAL);
featurePartial.EnableByDefault(); featurePartial.EnableByDefault();
if (StaticPrefs::gfx_webrender_picture_caching()) {
gfxVars::SetWebRenderMaxPartialPresentRects(
StaticPrefs::gfx_webrender_max_partial_present_rects_AtStartup());
// Call UserEnable() only for reporting to Decision Log. // Call UserEnable() only for reporting to Decision Log.
// If feature is enabled by default. It is not reported to Decision Log. // If feature is enabled by default. It is not reported to Decision Log.
featurePartial.UserEnable("Enabled"); featurePartial.UserEnable("Enabled");
} else {
featurePartial.ForceDisable(
FeatureStatus::Unavailable, "Picture caching is disabled",
NS_LITERAL_CSTRING("FEATURE_FAILURE_PICTURE_CACHING_DISABLED"));
}
} }
} }

View file

@ -777,7 +777,7 @@ void RenderCompositorANGLE::AddSurface(wr::NativeSurfaceId aId,
void RenderCompositorANGLE::InitializeUsePartialPresent() { void RenderCompositorANGLE::InitializeUsePartialPresent() {
if (UseCompositor() || !mSwapChain1 || if (UseCompositor() || !mSwapChain1 ||
mWidget->AsWindows()->HasFxrOutputHandler() || mWidget->AsWindows()->HasFxrOutputHandler() ||
StaticPrefs::gfx_webrender_max_partial_present_rects_AtStartup() <= 0) { gfx::gfxVars::WebRenderMaxPartialPresentRects() <= 0) {
mUsePartialPresent = false; mUsePartialPresent = false;
} else { } else {
mUsePartialPresent = true; mUsePartialPresent = true;
@ -792,7 +792,7 @@ uint32_t RenderCompositorANGLE::GetMaxPartialPresentRects() {
if (!mUsePartialPresent) { if (!mUsePartialPresent) {
return 0; return 0;
} }
return StaticPrefs::gfx_webrender_max_partial_present_rects_AtStartup(); return gfx::gfxVars::WebRenderMaxPartialPresentRects();
} }
bool RenderCompositorANGLE::MaybeReadback( bool RenderCompositorANGLE::MaybeReadback(