Commit 96c40ae3 authored by abarth@chromium.org's avatar abarth@chromium.org

Squashed fixed position layers shouldn't flicker while scrolling

We were correctly squashing fixed position layers together, but we weren't
setting the correct position constraint on the squashing layer. Instead, we
were setting the constraint on the main graphics layer directly, which meant
the compositor incorrectly scrolled the squashed fixed position layer instead
of keeping it stuck to the viewport.

R=vollick@chromium.org
BUG=402819

Review URL: https://codereview.chromium.org/475553002

git-svn-id: svn://svn.chromium.org/blink/trunk@180225 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 53dbfe59
......@@ -212,9 +212,10 @@ void ScrollingCoordinator::updateLayerPositionConstraint(RenderLayer* layer)
{
ASSERT(layer->hasCompositedLayerMapping());
CompositedLayerMapping* compositedLayerMapping = layer->compositedLayerMapping();
GraphicsLayer* mainLayer = compositedLayerMapping->localRootForOwningLayer();
GraphicsLayer* mainLayer = compositedLayerMapping->childForSuperlayers();
// Avoid unnecessary commits
clearPositionConstraintExceptForLayer(compositedLayerMapping->squashingContainmentLayer(), mainLayer);
clearPositionConstraintExceptForLayer(compositedLayerMapping->ancestorClippingLayer(), mainLayer);
clearPositionConstraintExceptForLayer(compositedLayerMapping->mainGraphicsLayer(), mainLayer);
......
......@@ -974,7 +974,7 @@ void CompositedLayerMapping::registerScrollingLayers()
// layer as a container.
bool isContainer = m_owningLayer.hasTransform() && !m_owningLayer.isRootLayer();
// FIXME: we should make certain that childForSuperLayers will never be the m_squashingContainmentLayer here
scrollingCoordinator->setLayerIsContainerForFixedPositionLayers(localRootForOwningLayer(), isContainer);
scrollingCoordinator->setLayerIsContainerForFixedPositionLayers(childForSuperlayers(), isContainer);
}
void CompositedLayerMapping::updateInternalHierarchy()
......@@ -1857,20 +1857,15 @@ GraphicsLayer* CompositedLayerMapping::parentForSublayers() const
return m_graphicsLayer.get();
}
GraphicsLayer* CompositedLayerMapping::localRootForOwningLayer() const
{
if (m_ancestorClippingLayer)
return m_ancestorClippingLayer.get();
return m_graphicsLayer.get();
}
GraphicsLayer* CompositedLayerMapping::childForSuperlayers() const
{
if (m_squashingContainmentLayer)
return m_squashingContainmentLayer.get();
return localRootForOwningLayer();
if (m_ancestorClippingLayer)
return m_ancestorClippingLayer.get();
return m_graphicsLayer.get();
}
GraphicsLayer* CompositedLayerMapping::layerForChildrenTransform() const
......@@ -1915,7 +1910,6 @@ bool CompositedLayerMapping::updateRequiresOwnBackingStoreForIntrinsicReasons()
if (paintsIntoCompositedAncestor() != previousPaintsIntoCompositedAncestor)
compositor()->paintInvalidationOnCompositingChange(&m_owningLayer);
return m_requiresOwnBackingStoreForIntrinsicReasons != previousRequiresOwnBackingStoreForIntrinsicReasons;
}
......
......@@ -109,8 +109,6 @@ public:
GraphicsLayer* parentForSublayers() const;
GraphicsLayer* childForSuperlayers() const;
// localRootForOwningLayer does not include the m_squashingContainmentLayer, which is technically not associated with this CLM's owning layer.
GraphicsLayer* localRootForOwningLayer() const;
GraphicsLayer* childTransformLayer() const { return m_childTransformLayer.get(); }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment