Bug 1354411 - Rebuild CompositorSessions if WebRender is disabled r=kats

When WebRender creation is failed, WebRender is disabled in gecko. There is a case that WebRenderBridgeParents exist when WebRender is disabled. To handle this, gecko needs to rebuild all CompositorSessions.

There is also a problem related to gfxVars::UseWebRender on compositor thread. If e10s is enabled, but no-gpu process(default on linux and mac), gfxVars::UseWebRender change is soon notified by compositor thread tasks. If WebRender creation failure happens at 2nd WebRender creation, several WebRenderBridgeParents for 1st WebRender could exist. IPC messages from WebRenderLayerManager are normally async, then there is a chance that the WebRenderBridgeParents receive the messages after the gfxVars::UseWebRender change. Further the gfxVars::UseWebRender change in content process could be delayed than WebRenderBridgeParents, then content process does not have a way to stop sending PWebRenderBridge IPC until the change of gfxVars::UseWebRender is received. WebRenderBridgeParent related tasks handle the message, but some tasks are done based on gfxVars::UseWebRender. At this time, gfxVars::UseWebRender returned false on compositor thread, then it cause unexpected result for WebRenderBridgeParent and WebRender. To addres this inconsistent situation, WebRenderBridgeParent related tasks on compositor thread stop to use gfxVars::UseWebRender.
This commit is contained in:
sotaro
2017-08-04 14:36:41 +09:00
parent ca760644fb
commit eb2d5e90e3
16 changed files with 50 additions and 29 deletions

View File

@@ -1294,12 +1294,7 @@ nsBaseWidget::CreateCompositorSession(int aWidth,
if (textureFactoryIdentifier.mParentBackend != LayersBackend::LAYERS_WR) {
retry = true;
DestroyCompositor();
// Disable WebRender
gfx::gfxConfig::GetFeature(gfx::Feature::WEBRENDER).ForceDisable(
gfx::FeatureStatus::Unavailable,
"WebRender initialization failed",
NS_LITERAL_CSTRING("FEATURE_FAILURE_WEBRENDER_INITIALIZE"));
gfx::gfxVars::SetUseWebRender(false);
gfx::GPUProcessManager::Get()->DisableWebRender();
}
}