Bug 1447335 - random guess at a fix r=kats
MozReview-Commit-ID: 38Yy4266CTO
--- a/gfx/layers/ipc/CompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/CompositorBridgeParent.cpp
@@ -1680,27 +1680,34 @@ CompositorBridgeParent::RecvMapAndNotify
mozilla::ipc::IPCResult
CompositorBridgeParent::RecvAdoptChild(const uint64_t& child)
{
RefPtr<APZSampler> oldApzSampler;
APZCTreeManagerParent* parent;
{
MonitorAutoLock lock(*sIndirectLayerTreesLock);
- // We currently don't support adopting children from one compositor to
- // another if the two compositors don't have the same options.
- MOZ_ASSERT(sIndirectLayerTrees[child].mParent->mOptions == mOptions);
- oldApzSampler = sIndirectLayerTrees[child].mParent->mApzSampler;
+
NotifyChildCreated(child);
if (sIndirectLayerTrees[child].mLayerTree) {
sIndirectLayerTrees[child].mLayerTree->SetLayerManager(mLayerManager, GetAnimationStorage());
// Trigger composition to handle a case that mLayerTree was not composited yet
// by previous CompositorBridgeParent, since nsRefreshDriver might wait composition complete.
ScheduleComposition();
}
+
+ if (!sIndirectLayerTrees[child].mParent) {
+ return IPC_OK();
+ }
+
+ // We currently don't support adopting children from one compositor to
+ // another if the two compositors don't have the same options.
+ MOZ_ASSERT(sIndirectLayerTrees[child].mParent->mOptions == mOptions);
+ oldApzSampler = sIndirectLayerTrees[child].mParent->mApzSampler;
+
if (mWrBridge && sIndirectLayerTrees[child].mWrBridge) {
RefPtr<wr::WebRenderAPI> api = mWrBridge->GetWebRenderAPI();
api = api->Clone();
sIndirectLayerTrees[child].mWrBridge->UpdateWebRender(mWrBridge->CompositorScheduler(),
api,
mWrBridge->AsyncImageManager(),
GetAnimationStorage());
// Pretend we composited, since parent CompositorBridgeParent was replaced.