Bug 1337085 - Update RenderThread startup/shutdown to use a runtime flag rather than a compile-time one. r=sotaro

MozReview-Commit-ID: AVIEzb8MiGV
This commit is contained in:
Kartikaya Gupta 2017-02-06 22:22:44 -05:00
parent 3c3b72b692
commit 17c87e25f6
2 changed files with 14 additions and 12 deletions

View File

@ -110,9 +110,6 @@ GPUParent::Init(base::ProcessId aParentPid,
return false;
}
#ifdef MOZ_ENABLE_WEBRENDER
wr::RenderThread::Start();
#endif
CompositorThreadHolder::Start();
APZThreadUtils::SetControllerThread(CompositorThreadHolder::Loop());
APZCTreeManager::InitializeGlobalState();
@ -195,6 +192,11 @@ GPUParent::RecvInit(nsTArray<GfxPrefSetting>&& prefs,
}
#endif
// Make sure to do this *after* we update gfxVars above.
if (gfxVars::UseWebRender()) {
wr::RenderThread::Start();
}
VRManager::ManagerInit();
// Send a message to the UI process that we're done.
GPUDeviceData data;
@ -415,9 +417,9 @@ GPUParent::ActorDestroy(ActorDestroyReason aWhy)
}
dom::VideoDecoderManagerParent::ShutdownVideoBridge();
CompositorThreadHolder::Shutdown();
#ifdef MOZ_ENABLE_WEBRENDER
wr::RenderThread::ShutDown();
#endif
if (gfxVars::UseWebRender()) {
wr::RenderThread::ShutDown();
}
Factory::ShutDown();
#if defined(XP_WIN)
DeviceManagerDx::Shutdown();

View File

@ -952,9 +952,9 @@ gfxPlatform::InitLayersIPC()
if (XRE_IsParentProcess())
{
#ifdef MOZ_ENABLE_WEBRENDER
wr::RenderThread::Start();
#endif
if (gfxVars::UseWebRender()) {
wr::RenderThread::Start();
}
layers::CompositorThreadHolder::Start();
}
}
@ -983,9 +983,9 @@ gfxPlatform::ShutdownLayersIPC()
#endif // defined(MOZ_WIDGET_ANDROID)
// This has to happen after shutting down the child protocols.
layers::CompositorThreadHolder::Shutdown();
#ifdef MOZ_ENABLE_WEBRENDER
wr::RenderThread::ShutDown();
#endif
if (gfxVars::UseWebRender()) {
wr::RenderThread::ShutDown();
}
} else {
// TODO: There are other kind of processes and we should make sure gfx
// stuff is either not created there or shut down properly.