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

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: 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
« no previous file with comments | « no previous file | no next file » | 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 c3e5612689532ef98719d7440df328ebf2a8041b..096f44ea7001182011306cd0fe52e414573ee898 100644
--- a/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -447,6 +447,13 @@ 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.
+ LayoutPoint graphicsLayerOffset = compositedLayerMapping->compositedBounds().location();
Ian Vollick 2014/04/23 20:18:38 It sounds like you want exactly CompositedLayerMap
Zeeshan Qureshi 2014/04/24 02:32:40 Excellent idea, done.
+ extraOffset = LayoutSize(-graphicsLayerOffset.x(), -graphicsLayerOffset.y());
// If the layer is using composited scrolling, then it's the contents that these
// rects apply to.
graphicsLayer = compositedLayerMapping->scrollingContentsLayer();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698