Bug 1382682 - Collect scroll metadata for scrollinfo layers as well. r=mstange
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 21 Jul 2017 08:34:11 -0400
changeset 370166 8949e22b8033cc1e59622a742b282725586d1556
parent 370165 975390c67975ae8515964877fc4f2e1b035c73a8
child 370167 8baab0d7ec0313915cb5225404755c92a7f0fcb4
push id46967
push userkgupta@mozilla.com
push dateFri, 21 Jul 2017 14:00:18 +0000
treeherderautoland@8949e22b8033 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1382682
milestone56.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 1382682 - Collect scroll metadata for scrollinfo layers as well. r=mstange MozReview-Commit-ID: JdHExWIpet9
gfx/layers/wr/WebRenderLayerManager.cpp
--- a/gfx/layers/wr/WebRenderLayerManager.cpp
+++ b/gfx/layers/wr/WebRenderLayerManager.cpp
@@ -251,16 +251,31 @@ WebRenderLayerManager::CreateWebRenderCo
           // information into the WR display list directly.
           Maybe<ScrollMetadata> metadata = asr->mScrollableFrame->ComputeScrollMetadata(
               nullptr, item->ReferenceFrame(),
               ContainerLayerParameters(), nullptr);
           MOZ_ASSERT(metadata);
           mScrollMetadata[id] = *metadata;
         }
       }
+      if (itemType == nsDisplayItem::TYPE_SCROLL_INFO_LAYER) {
+        // we should only really get one scroll info layer per scroll id, so
+        // it's not worth trying to get the ViewID and checking to see if we
+        // already have it in mScrollMetadata before doing the work of computing
+        // the metadata.
+        nsDisplayScrollInfoLayer* info = static_cast<nsDisplayScrollInfoLayer*>(item);
+        UniquePtr<ScrollMetadata> metadata = info->ComputeScrollMetadata(
+            nullptr, ContainerLayerParameters());
+        MOZ_ASSERT(metadata);
+        MOZ_ASSERT(metadata->GetMetrics().IsScrollInfoLayer());
+        FrameMetrics::ViewID id = metadata->GetMetrics().GetScrollId();
+        if (mScrollMetadata.find(id) == mScrollMetadata.end()) {
+          mScrollMetadata[id] = *metadata;
+        }
+      }
     }
 
     if (!item->CreateWebRenderCommands(aBuilder, aSc, mParentCommands, this,
                                        aDisplayListBuilder)) {
       PushItemAsImage(item, aBuilder, aSc, aDisplayListBuilder);
     }
   }
   aDisplayList->AppendToTop(&savedItems);