Bug 1551061 - Don't reuse a single DisplayItemData for all items that were previously part of a merged item. r=miko
authorMatt Woodrow <mwoodrow@mozilla.com>
Mon, 13 May 2019 23:40:47 +0000
changeset 532543 7f94111df77a31b17dfe6dbfc0793150f93f898f
parent 532542 9224b5e39c2e1e8132929a7be64a71c9531ddd2f
child 532544 b4e7d290701a7db413bc912d12c6597ede43b728
push id11270
push userrgurzau@mozilla.com
push dateWed, 15 May 2019 15:07:19 +0000
treeherdermozilla-beta@571bc76da583 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmiko
bugs1551061
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1551061 - Don't reuse a single DisplayItemData for all items that were previously part of a merged item. r=miko Differential Revision: https://phabricator.services.mozilla.com/D31004
layout/painting/FrameLayerBuilder.cpp
layout/painting/FrameLayerBuilder.h
--- a/layout/painting/FrameLayerBuilder.cpp
+++ b/layout/painting/FrameLayerBuilder.cpp
@@ -2063,16 +2063,17 @@ void FrameLayerBuilder::FlashPaint(gfxCo
 
 DisplayItemData* FrameLayerBuilder::GetDisplayItemData(nsIFrame* aFrame,
                                                        uint32_t aKey) {
   const SmallPointerArray<DisplayItemData>& array = aFrame->DisplayItemData();
   for (uint32_t i = 0; i < array.Length(); i++) {
     DisplayItemData* item =
         DisplayItemData::AssertDisplayItemData(array.ElementAt(i));
     if (item->mDisplayItemKey == aKey &&
+        item->FirstFrame() == aFrame &&
         item->mLayer->Manager() == mRetainingManager) {
       return item;
     }
   }
   return nullptr;
 }
 
 #ifdef MOZ_DUMP_PAINTING
--- a/layout/painting/FrameLayerBuilder.h
+++ b/layout/painting/FrameLayerBuilder.h
@@ -82,16 +82,17 @@ class DisplayItemData final {
   uint32_t GetDisplayItemKey() { return mDisplayItemKey; }
   layers::Layer* GetLayer() const { return mLayer; }
   nsDisplayItemGeometry* GetGeometry() const { return mGeometry.get(); }
   const DisplayItemClip& GetClip() const { return mClip; }
   void Invalidate() { mIsInvalid = true; }
   void ClearAnimationCompositorState();
   void SetItem(nsDisplayItem* aItem) { mItem = aItem; }
   nsDisplayItem* GetItem() const { return mItem; }
+  nsIFrame* FirstFrame() const { return mFrameList[0]; }
 
   bool HasMergedFrames() const { return mFrameList.Length() > 1; }
 
   static DisplayItemData* AssertDisplayItemData(DisplayItemData* aData);
 
   void* operator new(size_t sz, nsPresContext* aPresContext) {
     // Check the recycle list first.
     return aPresContext->PresShell()->AllocateByObjectID(