From 31350135f526630c671eaabb6c8dbb46d02f17c9 Mon Sep 17 00:00:00 2001 From: Jamie Nicol Date: Fri, 27 May 2016 16:29:19 +0100 Subject: [PATCH] Bug 1274528 - Don't enforce layers.max-active when layerizing items with different AGRs. r=mstange This reverts bug 1231818, as it caused problems with async scrolling on pages with too many active layers. MozReview-Commit-ID: 8eGjn4fzWFb --- layout/base/FrameLayerBuilder.cpp | 34 +------------------------------ 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp index 696b167d3d22..2ebd861ca404 100644 --- a/layout/base/FrameLayerBuilder.cpp +++ b/layout/base/FrameLayerBuilder.cpp @@ -954,7 +954,6 @@ public: const nsIntRect& aVisibleRect, bool aForceOwnLayer, bool aBackfaceidden, - bool aAvoidCreatingNewLayer, NewPaintedLayerCallbackType aNewPaintedLayerCallback); /** @@ -1007,12 +1006,6 @@ protected: */ PaintedLayerDataNode* EnsureNodeFor(AnimatedGeometryRoot* aAnimatedGeometryRoot); - /** - * Find the node for the nearest ancestor geometry root of - * aAnimatedGeometryRoot which already exists in the tree. - */ - PaintedLayerDataNode* FindNodeForNearestAncestor(AnimatedGeometryRoot* aAnimatedGeometryRoot); - /** * Find an existing node in the tree for an ancestor of aAnimatedGeometryRoot. * *aOutAncestorChild will be set to the last ancestor that was encountered @@ -2824,18 +2817,11 @@ PaintedLayerDataTree::FindPaintedLayerFor(AnimatedGeometryRoot* aAnimatedGeometr const nsIntRect& aVisibleRect, bool aForceOwnLayer, bool aBackfaceHidden, - bool aAvoidCreatingNewLayer, NewPaintedLayerCallbackType aNewPaintedLayerCallback) { const nsIntRect* bounds = aForceOwnLayer ? nullptr : &aVisibleRect; FinishPotentiallyIntersectingNodes(aAnimatedGeometryRoot, bounds); - PaintedLayerDataNode* node = nullptr; - if (aAvoidCreatingNewLayer) { - node = FindNodeForNearestAncestor(aAnimatedGeometryRoot); - } - if (!node) { - node = EnsureNodeFor(aAnimatedGeometryRoot); - } + PaintedLayerDataNode* node = EnsureNodeFor(aAnimatedGeometryRoot); if (aForceOwnLayer) { node->SetAllDrawingAbove(); @@ -2920,21 +2906,6 @@ PaintedLayerDataTree::EnsureNodeFor(AnimatedGeometryRoot* aAnimatedGeometryRoot) return node; } -PaintedLayerDataNode* -PaintedLayerDataTree::FindNodeForNearestAncestor(AnimatedGeometryRoot* aAnimatedGeometryRoot) -{ - if (aAnimatedGeometryRoot) { - PaintedLayerDataNode* node = mNodes.Get(aAnimatedGeometryRoot); - if (node) { - return node; - } - - return FindNodeForNearestAncestor(aAnimatedGeometryRoot->mParentAGR); - } - - return nullptr; -} - bool PaintedLayerDataTree::IsClippedWithRespectToParentAnimatedGeometryRoot(AnimatedGeometryRoot* aAnimatedGeometryRoot, nsIntRect* aOutClip) @@ -4216,14 +4187,11 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList) */ mLayerBuilder->AddLayerDisplayItem(ownLayer, item, layerState, nullptr); } else { - bool avoidCreatingLayer = (maxLayers != -1 && layerCount >= maxLayers); PaintedLayerData* paintedLayerData = mPaintedLayerDataTree.FindPaintedLayerFor(animatedGeometryRoot, agrScrollClip, itemVisibleRect, false, item->Frame()->In3DContextAndBackfaceIsHidden(), - avoidCreatingLayer, [&]() { - layerCount++; return NewPaintedLayerData(item, animatedGeometryRoot, agrScrollClip, topLeft, clipMovesWithLayer); });