Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1405)

Unified Diff: Source/core/paint/DeprecatedPaintLayer.cpp

Issue 1284203004: Generate scroll/clip display item hierarchy for SPv2 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: stripped localPaintingInfo cleanup and fixed-pos workarounds Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/paint/DeprecatedPaintLayer.cpp
diff --git a/Source/core/paint/DeprecatedPaintLayer.cpp b/Source/core/paint/DeprecatedPaintLayer.cpp
index a67baee4c4ad558a506e9b5888e7664980a51127..67c6735717339f910182f06766eafae4f4d29803 100644
--- a/Source/core/paint/DeprecatedPaintLayer.cpp
+++ b/Source/core/paint/DeprecatedPaintLayer.cpp
@@ -711,6 +711,18 @@ bool DeprecatedPaintLayer::update3DTransformedDescendantStatus()
return has3DTransform();
}
+LayoutPoint DeprecatedPaintLayer::locationExcludingOverflowScroll() const
+{
+ ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
+
+ // Our m_location already has scroll offset baked-in. We have to revert it here.
+ IntSize scrollOffset;
+ DeprecatedPaintLayer* scrollParent = layoutObject()->isOutOfFlowPositioned() ? enclosingPositionedAncestor() : parent();
+ if (scrollParent && scrollParent->layoutObject()->hasOverflowClip())
+ scrollOffset = scrollParent->layoutBox()->scrolledContentOffset();
+ return m_location + LayoutSize(scrollOffset);
+}
+
bool DeprecatedPaintLayer::updateLayerPosition()
{
LayoutPoint localPoint;
@@ -1244,7 +1256,7 @@ void DeprecatedPaintLayer::insertOnlyThisLayer()
}
// Returns the layer reached on the walk up towards the ancestor.
-static inline const DeprecatedPaintLayer* accumulateOffsetTowardsAncestor(const DeprecatedPaintLayer* layer, const DeprecatedPaintLayer* ancestorLayer, LayoutPoint& location)
+static inline const DeprecatedPaintLayer* accumulateOffsetTowardsAncestor(const DeprecatedPaintLayer* layer, const DeprecatedPaintLayer* ancestorLayer, LayoutPoint& location, DeprecatedPaintLayer::LocationQueryBehavior behavior)
{
ASSERT(ancestorLayer != layer);
@@ -1269,10 +1281,10 @@ static inline const DeprecatedPaintLayer* accumulateOffsetTowardsAncestor(const
// of both relative to the container and subtract.
LayoutPoint thisCoords;
- layer->convertToLayerCoords(parentLayer, thisCoords);
+ layer->convertToLayerCoords(parentLayer, thisCoords, behavior);
LayoutPoint ancestorCoords;
- ancestorLayer->convertToLayerCoords(parentLayer, ancestorCoords);
+ ancestorLayer->convertToLayerCoords(parentLayer, ancestorCoords, behavior);
location += (thisCoords - ancestorCoords);
return ancestorLayer;
@@ -1289,18 +1301,18 @@ static inline const DeprecatedPaintLayer* accumulateOffsetTowardsAncestor(const
if (!parentLayer)
return nullptr;
- location += layer->location();
+ location += layer->location(behavior);
chrishtr 2015/09/17 18:07:53 I think this introduces n^2 performance, because o
return parentLayer;
}
-void DeprecatedPaintLayer::convertToLayerCoords(const DeprecatedPaintLayer* ancestorLayer, LayoutPoint& location) const
+void DeprecatedPaintLayer::convertToLayerCoords(const DeprecatedPaintLayer* ancestorLayer, LayoutPoint& location, LocationQueryBehavior behavior) const
{
if (ancestorLayer == this)
return;
const DeprecatedPaintLayer* currLayer = this;
while (currLayer && currLayer != ancestorLayer)
- currLayer = accumulateOffsetTowardsAncestor(currLayer, ancestorLayer, location);
+ currLayer = accumulateOffsetTowardsAncestor(currLayer, ancestorLayer, location, behavior);
}
void DeprecatedPaintLayer::convertToLayerCoords(const DeprecatedPaintLayer* ancestorLayer, LayoutRect& rect) const

Powered by Google App Engine
This is Rietveld 408576698