Bug 1404181 - Part 26: Skip DLBI for reused items (since they must not be invalid). r?mstange
MozReview-Commit-ID: 3IooTF2064G
--- 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