Bug 1404181 - Part 26: Skip DLBI for reused items (since they must not be invalid). r?mstange draft
authorMatt Woodrow <mwoodrow@mozilla.com>, Miko Mynttinen <mikokm@gmail.com>, Timothy Nikkel <tnikkel@gmail.com>
Fri, 29 Sep 2017 10:58:54 +1300
changeset 684537 87cd435d018da188e960d88c39fc444c10e46a0d
parent 684536 3c842ed851023ba09fbf1b2241710baca22dea52
child 684538 53b44cb60ca4af13f775bf4e0b34cc3b4aa3f9bd
push id85633
push usermwoodrow@mozilla.com
push dateSun, 22 Oct 2017 23:03:02 +0000
reviewersmstange
bugs1404181
milestone58.0a1
Bug 1404181 - Part 26: Skip DLBI for reused items (since they must not be invalid). r?mstange MozReview-Commit-ID: 3IooTF2064G
layout/painting/FrameLayerBuilder.cpp
--- a/layout/painting/FrameLayerBuilder.cpp
+++ b/layout/painting/FrameLayerBuilder.cpp
@@ -4530,17 +4530,25 @@ FrameLayerBuilder::ComputeGeometryChange
   PaintedLayer* paintedLayer = aData->mLayer->AsPaintedLayer();
   // If aData->mOptLayer is presence, means this item has been optimized to the separate
   // layer. Thus, skip geometry change calculation.
   if (aData->mOptLayer || !item || !paintedLayer) {
     aData->EndUpdate();
     return;
   }
 
+  // If we're a reused display item, then we can't be invalid, so no need to
+  // do an in-depth comparison. If we haven't previously stored geometry
+  // for this item (if it was an active layer), then we can't skip this
+  // yet.
   nsAutoPtr<nsDisplayItemGeometry> geometry;
+  if (item->IsReused() && aData->mGeometry) {
+    aData->EndUpdate(geometry);
+    return;
+  }
 
   PaintedDisplayItemLayerUserData* layerData =
     static_cast<PaintedDisplayItemLayerUserData*>(aData->mLayer->GetUserData(&gPaintedDisplayItemLayerUserData));
   nsPoint shift = layerData->mAnimatedGeometryRootOrigin - layerData->mLastAnimatedGeometryRootOrigin;
 
   const DisplayItemClip& clip = item->GetClip();
 
   // If the frame is marked as invalidated, and didn't specify a rect to invalidate then we want to