Bug 1469472 - Ensure we don't merge multiple display items with the same frame. r=mattwoodrow

This commit is contained in:
Jamie Nicol 2018-06-20 09:48:06 +01:00
parent 8b47047d0c
commit f2b10c6146
2 changed files with 2 additions and 13 deletions

View File

@ -244,6 +244,7 @@ void
DisplayItemData::AddFrame(nsIFrame* aFrame)
{
MOZ_RELEASE_ASSERT(mLayer);
MOZ_RELEASE_ASSERT(!mFrameList.Contains(aFrame));
mFrameList.AppendElement(aFrame);
SmallPointerArray<DisplayItemData>& array = aFrame->DisplayItemData();

View File

@ -2781,7 +2781,7 @@ public:
bool HasSameTypeAndClip(const nsDisplayItem* aOther) const
{
return GetType() == aOther->GetType() &&
return GetPerFrameKey() == aOther->GetPerFrameKey() &&
GetClipChain() == aOther->GetClipChain();
}
@ -5700,12 +5700,6 @@ public:
return mozilla::LAYER_ACTIVE;
}
virtual bool CanMerge(const nsDisplayItem* aItem) const override
{
// Items with the same fixed position frame can be merged.
return HasSameTypeAndClip(aItem) && mFrame == aItem->Frame();
}
virtual bool CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder,
mozilla::wr::IpcResourceUpdateQueue& aResources,
const StackingContextHelper& aSc,
@ -5767,12 +5761,6 @@ public:
return mozilla::LAYER_ACTIVE_FORCE;
}
virtual bool CanMerge(const nsDisplayItem* aItem) const override
{
// Items with the same fixed position frame can be merged.
return HasSameTypeAndClip(aItem) && mFrame == aItem->Frame();
}
virtual bool ShouldFixToViewport(nsDisplayListBuilder* aBuilder) const override
{
return mIsFixedBackground;