Bug 1353958 - Add Gpu process reset handling for QuantumRender. r=kats

MozReview-Commit-ID: 6ZkB1ezyWlK
This commit is contained in:
Sotaro Ikeda 2017-04-06 12:56:10 -04:00
Родитель 7783684b2f
Коммит 1b3f1e93ba
2 изменённых файлов: 25 добавлений и 15 удалений

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

@ -3076,23 +3076,31 @@ TabChild::ReinitRendering()
Unused << cb->SendGetCompositorOptions(mLayersId, &options);
mCompositorOptions = Some(options);
bool success;
nsTArray<LayersBackend> ignored;
PLayerTransactionChild* shadowManager =
cb->SendPLayerTransactionConstructor(ignored, LayersId(), &mTextureFactoryIdentifier, &success);
if (!success) {
NS_WARNING("failed to re-allocate layer transaction");
return;
}
if (gfxVars::UseWebRender()) {
RefPtr<LayerManager> lm = mPuppetWidget->RecreateLayerManager(nullptr);
MOZ_ASSERT(lm->AsWebRenderLayerManager());
lm->AsWebRenderLayerManager()->Initialize(cb,
wr::AsPipelineId(mLayersId),
&mTextureFactoryIdentifier);
} else {
bool success;
nsTArray<LayersBackend> ignored;
PLayerTransactionChild* shadowManager =
cb->SendPLayerTransactionConstructor(ignored, LayersId(), &mTextureFactoryIdentifier, &success);
if (!success) {
NS_WARNING("failed to re-allocate layer transaction");
return;
}
if (!shadowManager) {
NS_WARNING("failed to re-construct LayersChild");
return;
}
if (!shadowManager) {
NS_WARNING("failed to re-construct LayersChild");
return;
}
RefPtr<LayerManager> lm = mPuppetWidget->RecreateLayerManager(shadowManager);
ShadowLayerForwarder* lf = lm->AsShadowForwarder();
lf->IdentifyTextureHost(mTextureFactoryIdentifier);
RefPtr<LayerManager> lm = mPuppetWidget->RecreateLayerManager(shadowManager);
ShadowLayerForwarder* lf = lm->AsShadowForwarder();
lf->IdentifyTextureHost(mTextureFactoryIdentifier);
}
InitAPZState();

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

@ -614,6 +614,7 @@ PuppetWidget::GetLayerManager(PLayerTransactionChild* aShadowManager,
// can do drawing in this process.
mLayerManager = new BasicLayerManager(this);
} else if (gfxVars::UseWebRender()) {
MOZ_ASSERT(!aShadowManager);
mLayerManager = new WebRenderLayerManager(this);
} else {
mLayerManager = new ClientLayerManager(this);
@ -638,6 +639,7 @@ PuppetWidget::RecreateLayerManager(PLayerTransactionChild* aShadowManager)
MOZ_ASSERT(mTabChild);
if (gfxVars::UseWebRender()) {
MOZ_ASSERT(!aShadowManager);
mLayerManager = new WebRenderLayerManager(this);
} else {
mLayerManager = new ClientLayerManager(this);