Back out two changesets from bug 1523776 for causing multiple regressions. r=backout

This commit is contained in:
Kartikaya Gupta 2019-01-31 14:44:33 -05:00
parent 96d60971db
commit 2030952357
8 changed files with 25 additions and 46 deletions

View File

@ -221,13 +221,6 @@ wr::WrSpaceAndClipChain ClipManager::SwitchItem(
// for it.
clips.mClipChainId = DefineClipChain(clip, auPerDevPixel, aStackingContext);
// If we didn't define a clip chain, inherit one from the stack. Eventually
// we should ensure stacking contexts always have a valid clip chain, and
// that should eliminate the need for this.
if (clips.mClipChainId.isNothing() && !mItemClipStack.empty()) {
clips.mClipChainId = mItemClipStack.top().mClipChainId;
}
Maybe<wr::WrSpaceAndClip> spaceAndClip = GetScrollLayer(asr);
MOZ_ASSERT(spaceAndClip.isSome());
clips.mScrollId = SpatialIdAfterOverride(spaceAndClip->space);
@ -363,11 +356,22 @@ Maybe<wr::WrClipChainId> ClipManager::DefineClipChain(
CLIP_LOG("cache[%p] <= %zu\n", chain, clipId.id);
}
if (clipIds.Length() == 0) {
return Nothing();
// Now find the parent display item's clipchain id
Maybe<wr::WrClipChainId> parentChainId;
if (!mItemClipStack.empty()) {
parentChainId = mItemClipStack.top().mClipChainId;
}
return Some(mBuilder->DefineClipChain(clipIds));
// And define the current display item's clipchain using the clips and the
// parent. If the current item has no clips of its own, just use the parent
// item's clipchain.
Maybe<wr::WrClipChainId> chainId;
if (clipIds.Length() > 0) {
chainId = Some(mBuilder->DefineClipChain(parentChainId, clipIds));
} else {
chainId = parentChainId;
}
return chainId;
}
ClipManager::~ClipManager() {

View File

@ -1,13 +0,0 @@
<style>
html, body {
margin: 0;
}
</style>
<div style="filter: drop-shadow(50px 50px 20px red)">
<div style="width:256px; height:256px; border-radius:16px; overflow:hidden">
<div style="width:256px; height:256px; background-color:green;"></div>
</div>
</div>
<!-- add white divs on top to simulate the clip from the test file -->
<div style="background-color: white; position:absolute; left: 0; top: 0; width: 100px; height: 700px"></div>
<div style="background-color: white; position:absolute; left: 0; top: 0; width: 700px; height: 100px"></div>

View File

@ -1,12 +0,0 @@
<style>
html, body {
margin: 0;
}
</style>
<div style="clip: rect(100px,1000px,1000px,100px); position:absolute">
<div style="filter: drop-shadow(50px 50px 20px red)">
<div style="width:256px; height:256px; border-radius:16px; overflow:hidden">
<div style="width:256px; height:256px; background-color:green;"></div>
</div>
</div>
</div>

View File

@ -18,4 +18,3 @@ fuzzy(5-32,21908-26621) fuzzy-if(webrender,0-1,0-3) == 1463802.html 1463802-ref.
fuzzy(0-11,0-4) == 1474722.html 1474722-ref.html
== 1501195.html 1501195-ref.html
== 1519754.html 1519754-ref.html
fuzzy-if(webrender,6-7,34741-36908) == 1523776.html 1523776-ref.html

View File

@ -701,10 +701,13 @@ void DisplayListBuilder::PopStackingContext(bool aIsReferenceFrame) {
}
wr::WrClipChainId DisplayListBuilder::DefineClipChain(
const Maybe<wr::WrClipChainId>& aParent,
const nsTArray<wr::WrClipId>& aClips) {
uint64_t clipchainId = wr_dp_define_clipchain(
mWrState, nullptr, aClips.Elements(), aClips.Length());
WRDL_LOG("DefineClipChain id=%" PRIu64 " clips=%zu\n", mWrState, clipchainId,
uint64_t clipchainId =
wr_dp_define_clipchain(mWrState, aParent ? &(aParent->id) : nullptr,
aClips.Elements(), aClips.Length());
WRDL_LOG("DefineClipChain id=%" PRIu64 " p=%s clips=%zu\n", mWrState,
clipchainId, aParent ? Stringify(aParent->id).c_str() : "(nil)",
aClips.Length());
return wr::WrClipChainId{clipchainId};
}

View File

@ -362,7 +362,8 @@ class DisplayListBuilder {
const wr::RasterSpace& aRasterSpace);
void PopStackingContext(bool aIsReferenceFrame);
wr::WrClipChainId DefineClipChain(const nsTArray<wr::WrClipId>& aClips);
wr::WrClipChainId DefineClipChain(const Maybe<wr::WrClipChainId>& aParent,
const nsTArray<wr::WrClipId>& aClips);
wr::WrClipId DefineClip(
const Maybe<wr::WrSpaceAndClip>& aParent, const wr::LayoutRect& aClipRect,

View File

@ -7006,11 +7006,8 @@ bool nsDisplayStickyPosition::CreateWebRenderCommands(
}
{
wr::StackingContextParams params;
params.clip =
wr::WrStackingContextClip::ClipChain(aBuilder.CurrentClipChainId());
StackingContextHelper sc(aSc, GetActiveScrolledRoot(), mFrame, this,
aBuilder, params);
aBuilder);
nsDisplayWrapList::CreateWebRenderCommands(aBuilder, aResources, sc,
aManager, aDisplayListBuilder);
}

View File

@ -45,8 +45,8 @@ fails == column-contain-1a.html column-contain-1-ref.html
== column-contain-1b.html column-contain-1-ref.html
== column-contain-2.html column-contain-2-ref.html
== block-in-inline-1.html block-in-inline-1-ref.html
fuzzy-if(skiaContent,0-1,0-22) fuzzy-if((winWidget&&(webrender||!layersGPUAccelerated))||(OSX&&webrender),0-92,0-1369) fuzzy-if(Android,0-8,0-1533) == block-in-inline-2.html block-in-inline-2-ref.html
fuzzy-if(Android,0-8,0-630) fuzzy-if(OSX,0-1,0-11) fuzzy-if(skiaContent,0-1,0-220) fuzzy-if((winWidget&&(webrender||!layersGPUAccelerated))||(OSX&&webrender),0-92,0-1343) == block-in-inline-3.html block-in-inline-3-ref.html
fuzzy-if(skiaContent,0-1,0-22) fuzzy-if(winWidget&&!layersGPUAccelerated,0-116,0-1320) fuzzy-if(Android,0-8,0-1533) == block-in-inline-2.html block-in-inline-2-ref.html
fuzzy-if(Android,0-8,0-630) fuzzy-if(OSX,0-1,0-11) fuzzy-if(skiaContent,0-1,0-220) fuzzy-if(winWidget&&!layersGPUAccelerated,0-116,0-1320) == block-in-inline-3.html block-in-inline-3-ref.html
== block-in-inline-continuations.html block-in-inline-continuations-ref.html
== iframe-1.html iframe-1-ref.html
== transformed-1.html transformed-1-ref.html