Bug 1351384 - Stop using the CompositorOptions to check if WebRender is enabled. r=dvander

I suspect that the PuppetWidget is trying to create the layer manager after
it has been connected to a TabChild but before the TabChild has populated the
CompositorOptions. This results in the PuppetWidget effectively getting an
uninitialized value for the CompositorOptions, and so it sometimes randomly
creates a WebRenderLayerManager, later resulting in a crash.

It seems like exposing the potentially-uninitialized CompositorOptions from
TabChild like this is a bad idea, so I'm removing that API and using the more
reliable gfxVars in PuppetWidget. This is fine for WebRender purposes because
we no longer care to allow having WR compositors co-exist with non-WR
compositors.

We may eventually want to remove the CompositorOptions entirely, but for now
the rest of the usage of it seems fine.

MozReview-Commit-ID: 6ekG8j1PskK

--HG--
extra : rebase_source : 0099e847ac356ca235969bcd81f47d65f49de2eb
This commit is contained in:
Kartikaya Gupta 2017-03-28 16:40:24 -04:00
Родитель be8e5b4a16
Коммит 042789f2a8
3 изменённых файлов: 2 добавлений и 14 удалений

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

@ -431,14 +431,6 @@ TabChild::TabChild(nsIContentChild* aManager,
}
}
const CompositorOptions&
TabChild::GetCompositorOptions() const
{
// If you're calling this before mCompositorOptions is set, well.. don't.
MOZ_ASSERT(mCompositorOptions);
return mCompositorOptions.ref();
}
bool
TabChild::AsyncPanZoomEnabled() const
{

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

@ -620,7 +620,6 @@ public:
return mParentIsActive;
}
const mozilla::layers::CompositorOptions& GetCompositorOptions() const;
bool AsyncPanZoomEnabled() const;
virtual ScreenIntSize GetInnerSize() override;

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

@ -607,10 +607,7 @@ PuppetWidget::GetLayerManager(PLayerTransactionChild* aShadowManager,
return mLayerManager;
}
bool useWebRender = mTabChild
? mTabChild->GetCompositorOptions().UseWebRender()
: gfxVars::UseWebRender();
if (useWebRender) {
if (gfxVars::UseWebRender()) {
mLayerManager = new WebRenderLayerManager(this);
} else {
mLayerManager = new ClientLayerManager(this);
@ -634,7 +631,7 @@ PuppetWidget::RecreateLayerManager(PLayerTransactionChild* aShadowManager)
DestroyLayerManager();
MOZ_ASSERT(mTabChild);
if (mTabChild->GetCompositorOptions().UseWebRender()) {
if (gfxVars::UseWebRender()) {
mLayerManager = new WebRenderLayerManager(this);
} else {
mLayerManager = new ClientLayerManager(this);