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

Unified Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2046233002: Revert of Don't include scroll offset in offsetFromLayoutObject for scrolling contents layers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
index d36b46bdf321ddeb49160399dbc4ad3b18f0d130..94dc9dc1c90eecfb94fc31f9a0c1559b5b33f8b1 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -1007,14 +1007,14 @@
DoubleSize scrollingContentsOffset(overflowClipRect.location().x() - adjustedScrollOffset.width(), overflowClipRect.location().y() - adjustedScrollOffset.height());
// The scroll offset change is compared using floating point so that fractional scroll offset
// change can be propagated to compositor.
- if (scrollingContentsOffset != m_scrollingContentsOffset || scrollSize != m_scrollingContentsLayer->size()) {
+ if (scrollingContentsOffset != m_scrollingContentsLayer->offsetDoubleFromLayoutObject() || scrollSize != m_scrollingContentsLayer->size()) {
bool coordinatorHandlesOffset = compositor()->scrollingLayerDidChange(&m_owningLayer);
m_scrollingContentsLayer->setPosition(coordinatorHandlesOffset ? FloatPoint() : FloatPoint(-toFloatSize(adjustedScrollOffset)));
}
- m_scrollingContentsOffset = scrollingContentsOffset;
m_scrollingContentsLayer->setSize(FloatSize(scrollSize));
- m_scrollingContentsLayer->setOffsetDoubleFromLayoutObject(toIntSize(overflowClipRect.location()), GraphicsLayer::DontSetNeedsDisplay);
+ // FIXME: The paint offset and the scroll offset should really be separate concepts.
+ m_scrollingContentsLayer->setOffsetDoubleFromLayoutObject(scrollingContentsOffset, GraphicsLayer::DontSetNeedsDisplay);
if (m_foregroundLayer) {
if (m_foregroundLayer->size() != m_scrollingContentsLayer->size())
@@ -1416,8 +1416,7 @@
ApplyToMaskLayers = (1 << 4),
ApplyToContentLayers = (1 << 5),
ApplyToChildContainingLayers = (1 << 6), // layers between m_graphicsLayer and children
- ApplyToScrollingContentLayers = (1 << 7),
- ApplyToAllGraphicsLayers = (ApplyToSquashingLayer | ApplyToScrollbarLayers | ApplyToBackgroundLayer | ApplyToMaskLayers | ApplyToLayersAffectedByPreserve3D | ApplyToContentLayers | ApplyToScrollingContentLayers)
+ ApplyToAllGraphicsLayers = (ApplyToSquashingLayer | ApplyToScrollbarLayers | ApplyToBackgroundLayer | ApplyToMaskLayers | ApplyToLayersAffectedByPreserve3D | ApplyToContentLayers)
};
typedef unsigned ApplyToGraphicsLayersMode;
@@ -1434,9 +1433,9 @@
f(mapping->clippingLayer());
if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToChildContainingLayers)) && mapping->scrollingLayer())
f(mapping->scrollingLayer());
- if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToContentLayers) || (mode & ApplyToChildContainingLayers) || (mode & ApplyToScrollingContentLayers)) && mapping->scrollingContentsLayer())
+ if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToContentLayers) || (mode & ApplyToChildContainingLayers)) && mapping->scrollingContentsLayer())
f(mapping->scrollingContentsLayer());
- if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToContentLayers) || (mode & ApplyToScrollingContentLayers)) && mapping->foregroundLayer())
+ if (((mode & ApplyToLayersAffectedByPreserve3D) || (mode & ApplyToContentLayers)) && mapping->foregroundLayer())
f(mapping->foregroundLayer());
if ((mode & ApplyToChildContainingLayers) && mapping->childTransformLayer())
@@ -2108,26 +2107,6 @@
client
};
ApplyToGraphicsLayers(this, functor, ApplyToContentLayers);
-}
-
-void CompositedLayerMapping::setScrollingContentsNeedDisplayInRect(const LayoutRect& r, PaintInvalidationReason invalidationReason, const DisplayItemClient& client)
-{
- // TODO(wangxianzhu): Enable the following assert after paint invalidation for spv2 is ready.
- // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled());
-
- SetContentsNeedsDisplayInRectFunctor functor = {
- enclosingIntRect(LayoutRect(r.location() + m_owningLayer.subpixelAccumulation(), r.size())),
- invalidationReason,
- client
- };
- ApplyToGraphicsLayers(this, functor, ApplyToScrollingContentLayers);
-}
-
-void CompositedLayerMapping::scrollingDisplayItemClientWasInvalidated(const DisplayItemClient& displayItemClient, PaintInvalidationReason paintInvalidationReason)
-{
- ApplyToGraphicsLayers(this, [&displayItemClient, paintInvalidationReason](GraphicsLayer* layer) {
- layer->displayItemClientWasInvalidated(displayItemClient, paintInvalidationReason);
- }, ApplyToScrollingContentLayers);
}
void CompositedLayerMapping::displayItemClientWasInvalidated(const DisplayItemClient& displayItemClient, PaintInvalidationReason paintInvalidationReason)
@@ -2261,7 +2240,6 @@
ASSERT(graphicsLayer == m_graphicsLayer || graphicsLayer == m_scrollingContentsLayer);
anchorLayoutObject = m_owningLayer.layoutObject();
offsetFromAnchorLayoutObject = graphicsLayer->offsetFromLayoutObject();
- adjustForCompositedScrolling(graphicsLayer, offsetFromAnchorLayoutObject);
}
// Start with the bounds of the graphics layer in the space of the anchor LayoutObject.
@@ -2360,14 +2338,6 @@
bool CompositedLayerMapping::needsRepaint(const GraphicsLayer& graphicsLayer) const
{
return isScrollableAreaLayer(&graphicsLayer) ? true : m_owningLayer.needsRepaint();
-}
-
-void CompositedLayerMapping::adjustForCompositedScrolling(const GraphicsLayer* graphicsLayer, IntSize& offset) const
-{
- if (graphicsLayer == m_scrollingContentsLayer.get() || graphicsLayer == m_foregroundLayer.get()) {
- DoubleSize adjustedScrollOffset = m_owningLayer.getScrollableArea()->adjustedScrollOffset();
- offset.expand(-adjustedScrollOffset.width(), -adjustedScrollOffset.height());
- }
}
void CompositedLayerMapping::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context,
@@ -2416,7 +2386,6 @@
paintInfo.paintLayer = &m_owningLayer;
paintInfo.compositedBounds = compositedBounds();
paintInfo.offsetFromLayoutObject = graphicsLayer->offsetFromLayoutObject();
- adjustForCompositedScrolling(graphicsLayer, paintInfo.offsetFromLayoutObject);
// We have to use the same root as for hit testing, because both methods can compute and cache clipRects.
doPaintTask(paintInfo, *graphicsLayer, paintLayerFlags, context, interestRect);

Powered by Google App Engine
This is Rietveld 408576698