Bug 1357541 - Use the full 64 bit value of the PipelineId when converting to a layers ID. r=nical

MozReview-Commit-ID: 98OOkEML6RF
This commit is contained in:
Kartikaya Gupta
2017-04-19 06:58:10 -04:00
parent 2f88c289f9
commit 5da2b0a835
3 changed files with 14 additions and 15 deletions

View File

@@ -1601,7 +1601,7 @@ CompositorBridgeParent::AllocPWebRenderBridgeParent(const wr::PipelineId& aPipel
// child process invoking this codepath before it's ready
MOZ_RELEASE_ASSERT(false);
#endif
MOZ_ASSERT(aPipelineId.mHandle == mRootLayerTreeID);
MOZ_ASSERT(wr::AsUint64(aPipelineId) == mRootLayerTreeID);
MOZ_ASSERT(!mWrBridge);
MOZ_ASSERT(!mCompositor);
MOZ_ASSERT(!mCompositorScheduler);
@@ -1621,9 +1621,8 @@ CompositorBridgeParent::AllocPWebRenderBridgeParent(const wr::PipelineId& aPipel
MOZ_ASSERT(mCompositorScheduler);
mWrBridge.get()->AddRef(); // IPDL reference
MonitorAutoLock lock(*sIndirectLayerTreesLock);
auto pipelineHandle = aPipelineId.mHandle;
MOZ_ASSERT(sIndirectLayerTrees[pipelineHandle].mWrBridge == nullptr);
sIndirectLayerTrees[pipelineHandle].mWrBridge = mWrBridge;
MOZ_ASSERT(sIndirectLayerTrees[mRootLayerTreeID].mWrBridge == nullptr);
sIndirectLayerTrees[mRootLayerTreeID].mWrBridge = mWrBridge;
*aTextureFactoryIdentifier = mWrBridge->GetTextureFactoryIdentifier();
return mWrBridge;
}

View File

@@ -189,17 +189,17 @@ CrossProcessCompositorBridgeParent::AllocPWebRenderBridgeParent(const wr::Pipeli
// child process invoking this codepath before it's ready
MOZ_RELEASE_ASSERT(false);
#endif
uint64_t layersId = wr::AsUint64(aPipelineId);
// Check to see if this child process has access to this layer tree.
if (!LayerTreeOwnerTracker::Get()->IsMapped(aPipelineId.mHandle, OtherPid())) {
if (!LayerTreeOwnerTracker::Get()->IsMapped(layersId, OtherPid())) {
NS_ERROR("Unexpected layers id in AllocPAPZCTreeManagerParent; dropping message...");
return nullptr;
}
auto pipelineHandle = aPipelineId.mHandle;
MonitorAutoLock lock(*sIndirectLayerTreesLock);
MOZ_ASSERT(sIndirectLayerTrees.find(pipelineHandle) != sIndirectLayerTrees.end());
MOZ_ASSERT(sIndirectLayerTrees[pipelineHandle].mWrBridge == nullptr);
CompositorBridgeParent* cbp = sIndirectLayerTrees[pipelineHandle].mParent;
MOZ_ASSERT(sIndirectLayerTrees.find(layersId) != sIndirectLayerTrees.end());
MOZ_ASSERT(sIndirectLayerTrees[layersId].mWrBridge == nullptr);
CompositorBridgeParent* cbp = sIndirectLayerTrees[layersId].mParent;
WebRenderBridgeParent* root = sIndirectLayerTrees[cbp->RootLayerTreeId()].mWrBridge.get();
WebRenderBridgeParent* parent = nullptr;
@@ -208,8 +208,8 @@ CrossProcessCompositorBridgeParent::AllocPWebRenderBridgeParent(const wr::Pipeli
parent = new WebRenderBridgeParent(this, aPipelineId, nullptr, root->CompositorScheduler(), Move(api), Move(holder));
parent->AddRef(); // IPDL reference
sIndirectLayerTrees[pipelineHandle].mCrossProcessParent = this;
sIndirectLayerTrees[pipelineHandle].mWrBridge = parent;
sIndirectLayerTrees[layersId].mCrossProcessParent = this;
sIndirectLayerTrees[layersId].mWrBridge = parent;
*aTextureFactoryIdentifier = parent->GetTextureFactoryIdentifier();
*aIdNamespace = parent->GetIdNameSpace();
@@ -225,7 +225,7 @@ CrossProcessCompositorBridgeParent::DeallocPWebRenderBridgeParent(PWebRenderBrid
MOZ_RELEASE_ASSERT(false);
#endif
WebRenderBridgeParent* parent = static_cast<WebRenderBridgeParent*>(aActor);
EraseLayerState(parent->PipelineId().mHandle);
EraseLayerState(wr::AsUint64(parent->PipelineId()));
parent->Release(); // IPDL reference
return true;
}

View File

@@ -420,7 +420,7 @@ WebRenderBridgeParent::ProcessWebRenderCommands(const gfx::IntSize &aSize,
const OpAddCompositorAnimations& op = cmd.get_OpAddCompositorAnimations();
CompositorAnimations data(Move(op.data()));
if (data.animations().Length()) {
uint64_t id = mWidget ? 0 : mPipelineId.mHandle;
uint64_t id = mWidget ? 0 : wr::AsUint64(mPipelineId);
CompositorAnimationStorage* storage =
mCompositorBridge->GetAnimationStorage(id);
if (storage) {
@@ -432,7 +432,7 @@ WebRenderBridgeParent::ProcessWebRenderCommands(const gfx::IntSize &aSize,
case WebRenderParentCommand::TOpRemoveCompositorAnimations: {
const OpRemoveCompositorAnimations& op = cmd.get_OpRemoveCompositorAnimations();
if (op.id()) {
uint64_t id = mWidget ? 0 : mPipelineId.mHandle;
uint64_t id = mWidget ? 0 : wr::AsUint64(mPipelineId);
CompositorAnimationStorage* storage =
mCompositorBridge->GetAnimationStorage(id);
if (storage) {
@@ -610,7 +610,7 @@ void
WebRenderBridgeParent::SampleAnimations(nsTArray<WrOpacityProperty>& aOpacityArray,
nsTArray<WrTransformProperty>& aTransformArray)
{
uint64_t id = mWidget ? 0 : mPipelineId.mHandle;
uint64_t id = mWidget ? 0 : wr::AsUint64(mPipelineId);
CompositorAnimationStorage* storage =
mCompositorBridge->GetAnimationStorage(id);