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

Unified Diff: Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 358913003: Get rid of one-off code in ScrollingCoordinator to handle graphics layer offsets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix. Created 6 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
« no previous file with comments | « no previous file | Source/core/rendering/RenderLayer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/scrolling/ScrollingCoordinator.cpp
diff --git a/Source/core/page/scrolling/ScrollingCoordinator.cpp b/Source/core/page/scrolling/ScrollingCoordinator.cpp
index d9f74ef1448ffdbc2912982ada6461dc79eef43a..b66c1c951c1ca22e60114962889ea9248d980301 100644
--- a/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -419,7 +419,7 @@ static void makeLayerChildFrameMap(const LocalFrame* currentFrame, LayerFrameMap
}
}
-// Return the enclosingCompositedLayerForRepaint for the given RenderLayer
+// Return the enclosingCompositedLayerForPaintInvalidation for the given RenderLayer
// including crossing frame boundaries.
static const RenderLayer* enclosingCompositedLayer(const RenderLayer* layer)
{
@@ -457,21 +457,11 @@ static void projectRectsToGraphicsLayerSpaceRecursive(
// Find the appropriate GraphicsLayer for the composited RenderLayer.
GraphicsLayer* graphicsLayer;
- LayoutSize extraOffset;
if (compositedLayer->compositingState() == PaintsIntoGroupedBacking) {
graphicsLayer = compositedLayer->groupedMapping()->squashingLayer();
- extraOffset = -compositedLayer->offsetFromSquashingLayerOrigin();
} else {
ASSERT(compositedLayer->hasCompositedLayerMapping());
CompositedLayerMappingPtr compositedLayerMapping = compositedLayer->compositedLayerMapping();
- // The origin for the graphics layer does not have to be the same
- // as the composited layer (e.g. when a child layer has negative
- // offset and paints into this layer), so when projecting rects to
- // graphics layer space they have to be offset by the origin for
- // the composited layer.
- extraOffset = compositedLayerMapping->contentOffsetInCompositingLayer();
- // If the layer is using composited scrolling, then it's the contents that these
- // rects apply to.
graphicsLayer = compositedLayerMapping->scrollingContentsLayer();
if (!graphicsLayer)
graphicsLayer = compositedLayerMapping->mainGraphicsLayer();
@@ -483,6 +473,7 @@ static void projectRectsToGraphicsLayerSpaceRecursive(
glRects = &graphicsRects.add(graphicsLayer, Vector<LayoutRect>()).storedValue->value;
else
glRects = &glIter->value;
+
// Transform each rect to the co-ordinate space of the graphicsLayer.
for (size_t i = 0; i < layerIter->value.size(); ++i) {
LayoutRect rect = layerIter->value[i];
@@ -495,7 +486,7 @@ static void projectRectsToGraphicsLayerSpaceRecursive(
if (compositedLayer->renderer()->hasOverflowClip())
rect.move(compositedLayer->renderBox()->scrolledContentOffset());
}
- rect.move(extraOffset);
+ RenderLayer::mapRectToPaintBackingCoordinates(compositedLayer->renderer(), rect);
glRects->append(rect);
}
}
« no previous file with comments | « no previous file | Source/core/rendering/RenderLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698