Chromium Code Reviews| 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( |