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

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

Issue 250193002: Offset rects by origin when projecting from composited to graphics layer. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update test expectations Created 6 years, 8 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/page/scrolling/ScrollingCoordinator.cpp
diff --git a/Source/core/page/scrolling/ScrollingCoordinator.cpp b/Source/core/page/scrolling/ScrollingCoordinator.cpp
index c3e5612689532ef98719d7440df328ebf2a8041b..ca643a221cb9b0f41f1ba50d72078d851ae1ba27 100644
--- a/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -447,6 +447,12 @@ static void projectRectsToGraphicsLayerSpaceRecursive(
} 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();

Powered by Google App Engine
This is Rietveld 408576698