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

Unified Diff: third_party/WebKit/Source/platform/graphics/compositing/PropertyTreeManager.cpp

Issue 2643203002: Rewrite blink->cc scroll offset logic for SPV2 (Closed)
Patch Set: Created 3 years, 11 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 | « third_party/WebKit/Source/platform/graphics/compositing/PropertyTreeManager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/compositing/PropertyTreeManager.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PropertyTreeManager.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PropertyTreeManager.cpp
index 3a58fa717bfd01cd5d48348c23141404cd32f360..e8a9c887ad6cada6a5e84c99276039991c7062a9 100644
--- a/third_party/WebKit/Source/platform/graphics/compositing/PropertyTreeManager.cpp
+++ b/third_party/WebKit/Source/platform/graphics/compositing/PropertyTreeManager.cpp
@@ -272,26 +272,21 @@ int PropertyTreeManager::ensureCompositorScrollNode(
DCHECK(result.isNewEntry);
scrollTree().set_needs_update(true);
- return id;
-}
-
-void PropertyTreeManager::updateScrollOffset(int layerId, int scrollId) {
- cc::ScrollNode& scrollNode = *scrollTree().Node(scrollId);
- cc::TransformNode& transformNode =
- *transformTree().Node(scrollNode.transform_id);
-
- transformNode.scrolls = true;
-
// Blink creates a 2d transform node just for scroll offset whereas cc's
// transform node has a special scroll offset field. To handle this we
- // adjust cc's transform node to remove the 2d scroll translation and
- // let the cc scroll tree update the cc scroll offset.
- DCHECK(transformNode.local.IsIdentityOr2DTranslation());
- auto offset = transformNode.local.To2dTranslation();
- transformNode.local.MakeIdentity();
- scrollTree().SetScrollOffset(layerId,
ajuma 2017/01/20 21:35:48 With this removed, is the scroll offset getting se
- gfx::ScrollOffset(-offset.x(), -offset.y()));
- scrollTree().set_needs_update(true);
+ // adjust the compositor transform node to remove the 2d scroll translation
+ // and instead set a scroll offset.
+ cc::TransformNode& compositorTransformNode =
+ *transformTree().Node(compositorNode.transform_id);
+ DCHECK(compositorTransformNode.local.IsIdentityOr2DTranslation());
+ compositorTransformNode.local.MakeIdentity();
+ auto* scrollOffsetTransform = scrollNode->scrollOffsetTranslation();
+ auto scrollOffset = scrollOffsetTransform->matrix().to2DTranslation();
+ compositorTransformNode.scroll_offset =
+ gfx::ScrollOffset(-scrollOffset.width(), -scrollOffset.height());
+ compositorTransformNode.scrolls = true;
+
+ return id;
}
int PropertyTreeManager::switchToEffectNode(
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/compositing/PropertyTreeManager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698