Bug 1546018 - parent the legend clip chains. r=kats

Differential Revision: https://phabricator.services.mozilla.com/D29528

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alexis Beingessner 2019-05-01 17:35:44 +00:00
Родитель 27fc6a03c9
Коммит ac602e64ff
3 изменённых файлов: 7 добавлений и 7 удалений

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

@ -807,10 +807,11 @@ void DisplayListBuilder::PopStackingContext(bool aIsReferenceFrame) {
}
wr::WrClipChainId DisplayListBuilder::DefineClipChain(
const nsTArray<wr::WrClipId>& aClips, const wr::WrClipChainId* aParent) {
const nsTArray<wr::WrClipId>& aClips, bool aParentWithCurrentChain) {
const uint64_t* parent = nullptr;
if (aParent && aParent->id != wr::ROOT_CLIP_CHAIN) {
parent = &aParent->id;
if (aParentWithCurrentChain &&
mCurrentSpaceAndClipChain.clip_chain != wr::ROOT_CLIP_CHAIN) {
parent = &mCurrentSpaceAndClipChain.clip_chain;
}
uint64_t clipchainId = wr_dp_define_clipchain(
mWrState, parent, aClips.Elements(), aClips.Length());
@ -1170,9 +1171,8 @@ void DisplayListBuilder::SuspendClipLeafMerging() {
mSuspendedClipChainLeaf = mClipChainLeaf;
mSuspendedSpaceAndClipChain = Some(mCurrentSpaceAndClipChain);
wr::WrClipChainId currentClipChainId{mCurrentSpaceAndClipChain.clip_chain};
auto clipId = DefineClip(Nothing(), *mClipChainLeaf);
auto clipChainId = DefineClipChain({clipId}, &currentClipChainId);
auto clipChainId = DefineClipChain({clipId}, true);
mCurrentSpaceAndClipChain.clip_chain = clipChainId.id;
mClipChainLeaf = Nothing();

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

@ -394,7 +394,7 @@ class DisplayListBuilder final {
void PopStackingContext(bool aIsReferenceFrame);
wr::WrClipChainId DefineClipChain(const nsTArray<wr::WrClipId>& aClips,
const wr::WrClipChainId* aParent = nullptr);
bool aParentWithCurrentChain = false);
wr::WrClipId DefineClip(
const Maybe<wr::WrSpaceAndClip>& aParent, const wr::LayoutRect& aClipRect,

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

@ -196,7 +196,7 @@ bool nsDisplayFieldSetBorder::CreateWebRenderCommands(
nsTArray<mozilla::wr::ComplexClipRegion> array{region};
auto clip = aBuilder.DefineClip(Nothing(), layoutRect, &array, nullptr);
auto clipChain = aBuilder.DefineClipChain({clip});
auto clipChain = aBuilder.DefineClipChain({clip}, true);
clipOut.emplace(aBuilder, clipChain);
}
} else {