mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-02 22:37:50 +00:00
Bug 1554985 - Invert condition to reduce indentation. r=jrmuizel
No functional changes here. Differential Revision: https://phabricator.services.mozilla.com/D36385 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
a9bd762a6a
commit
e1bbcf0b32
@ -7023,49 +7023,50 @@ bool nsDisplayRenderRoot::CreateWebRenderCommands(
|
||||
mozilla::wr::IpcResourceUpdateQueue& aResources,
|
||||
const StackingContextHelper& aSc, RenderRootStateManager* aManager,
|
||||
nsDisplayListBuilder* aDisplayListBuilder) {
|
||||
if (aDisplayListBuilder->GetNeedsDisplayListBuild(mRenderRoot) ||
|
||||
!mBuiltWRCommands) {
|
||||
if (aBuilder.GetRenderRoot() == mRenderRoot) {
|
||||
nsDisplayWrapList::CreateWebRenderCommands(aBuilder, aResources, aSc,
|
||||
aManager, aDisplayListBuilder);
|
||||
} else {
|
||||
RefPtr<WebRenderRenderRootData> userData =
|
||||
aManager->CommandBuilder()
|
||||
.CreateOrRecycleWebRenderUserData<WebRenderRenderRootData>(
|
||||
this, aBuilder.GetRenderRoot());
|
||||
mBoundary = Some(userData->EnsureHasBoundary(mRenderRoot));
|
||||
|
||||
WebRenderCommandBuilder::ScrollDataBoundaryWrapper wrapper(
|
||||
aManager->CommandBuilder(), *mBoundary);
|
||||
|
||||
aBuilder.SetSendSubBuilderDisplayList(mRenderRoot);
|
||||
wr::DisplayListBuilder& builder = aBuilder.SubBuilder(mRenderRoot);
|
||||
wr::IpcResourceUpdateQueue& resources = aResources.SubQueue(mRenderRoot);
|
||||
|
||||
wr::StackingContextParams params;
|
||||
params.clip =
|
||||
wr::WrStackingContextClip::ClipChain(builder.CurrentClipChainId());
|
||||
LayoutDeviceRect rrRect =
|
||||
aDisplayListBuilder->GetRenderRootRect(mRenderRoot);
|
||||
LayoutDevicePoint scOrigin = aSc.GetOrigin();
|
||||
// Subtract the render root rect from this, as it already acts as the
|
||||
// origin for our whole display list in WebRender (via SetDocumentView).
|
||||
// However, we can't simply ignore the value of aSc.GetOrigin(), even
|
||||
// though they will often be the same. This is because there might be
|
||||
// multiple cousin nsDisplayRenderRoots in a tree of nsDisplayItems, and
|
||||
// the RenderRootRect will be the union of their areas.
|
||||
scOrigin.x -= rrRect.x;
|
||||
scOrigin.y -= rrRect.y;
|
||||
StackingContextHelper sc(
|
||||
aManager->CommandBuilder().GetRootStackingContextHelper(mRenderRoot),
|
||||
nullptr, nullptr, nullptr, builder, params,
|
||||
LayoutDeviceRect(scOrigin, LayoutDeviceSize()));
|
||||
|
||||
nsDisplayWrapList::CreateWebRenderCommands(builder, resources, sc,
|
||||
aManager, aDisplayListBuilder);
|
||||
}
|
||||
mBuiltWRCommands = true;
|
||||
if (!aDisplayListBuilder->GetNeedsDisplayListBuild(mRenderRoot) &&
|
||||
mBuiltWRCommands) {
|
||||
return true;
|
||||
}
|
||||
if (aBuilder.GetRenderRoot() == mRenderRoot) {
|
||||
nsDisplayWrapList::CreateWebRenderCommands(aBuilder, aResources, aSc,
|
||||
aManager, aDisplayListBuilder);
|
||||
} else {
|
||||
RefPtr<WebRenderRenderRootData> userData =
|
||||
aManager->CommandBuilder()
|
||||
.CreateOrRecycleWebRenderUserData<WebRenderRenderRootData>(
|
||||
this, aBuilder.GetRenderRoot());
|
||||
mBoundary = Some(userData->EnsureHasBoundary(mRenderRoot));
|
||||
|
||||
WebRenderCommandBuilder::ScrollDataBoundaryWrapper wrapper(
|
||||
aManager->CommandBuilder(), *mBoundary);
|
||||
|
||||
aBuilder.SetSendSubBuilderDisplayList(mRenderRoot);
|
||||
wr::DisplayListBuilder& builder = aBuilder.SubBuilder(mRenderRoot);
|
||||
wr::IpcResourceUpdateQueue& resources = aResources.SubQueue(mRenderRoot);
|
||||
|
||||
wr::StackingContextParams params;
|
||||
params.clip =
|
||||
wr::WrStackingContextClip::ClipChain(builder.CurrentClipChainId());
|
||||
LayoutDeviceRect rrRect =
|
||||
aDisplayListBuilder->GetRenderRootRect(mRenderRoot);
|
||||
LayoutDevicePoint scOrigin = aSc.GetOrigin();
|
||||
// Subtract the render root rect from this, as it already acts as the
|
||||
// origin for our whole display list in WebRender (via SetDocumentView).
|
||||
// However, we can't simply ignore the value of aSc.GetOrigin(), even
|
||||
// though they will often be the same. This is because there might be
|
||||
// multiple cousin nsDisplayRenderRoots in a tree of nsDisplayItems, and
|
||||
// the RenderRootRect will be the union of their areas.
|
||||
scOrigin.x -= rrRect.x;
|
||||
scOrigin.y -= rrRect.y;
|
||||
StackingContextHelper sc(
|
||||
aManager->CommandBuilder().GetRootStackingContextHelper(mRenderRoot),
|
||||
nullptr, nullptr, nullptr, builder, params,
|
||||
LayoutDeviceRect(scOrigin, LayoutDeviceSize()));
|
||||
|
||||
nsDisplayWrapList::CreateWebRenderCommands(builder, resources, sc,
|
||||
aManager, aDisplayListBuilder);
|
||||
}
|
||||
mBuiltWRCommands = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user