Chromium Code Reviews| Index: cc/trees/layer_tree_host_impl.cc |
| diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc |
| index 75194f6628628b5b8c7a27940422183a691cd0ad..91131a6e4a78cad2d82909adb79182990a570fcf 100644 |
| --- a/cc/trees/layer_tree_host_impl.cc |
| +++ b/cc/trees/layer_tree_host_impl.cc |
| @@ -154,8 +154,8 @@ void RecordCompositorSlowScrollMetric(InputHandler::ScrollInputType type, |
| } |
| } |
| -// Return true if scrollable 'ancestor' is the same layer as 'child' or its |
| -// ancestor along the scroll tree. |
| +// Return true if scrollable 'ancestor' has the same scroll node as 'child' or |
| +// an ancestor along the scroll tree. |
| bool IsScrolledBy(LayerImpl* child, LayerImpl* ancestor) { |
| DCHECK(ancestor && ancestor->scrollable()); |
| if (!child) |
| @@ -165,7 +165,7 @@ bool IsScrolledBy(LayerImpl* child, LayerImpl* ancestor) { |
| child->layer_tree_impl()->property_trees()->scroll_tree; |
| for (ScrollNode* scroll_node = scroll_tree.Node(child->scroll_tree_index()); |
| scroll_node; scroll_node = scroll_tree.parent(scroll_node)) { |
| - if (scroll_node->owning_layer_id == ancestor->id()) |
| + if (scroll_node->id == ancestor->scroll_tree_index()) |
|
ajuma
2017/02/21 16:05:25
Just wanted to point out that this could change be
bokan
2017/02/21 19:45:25
Ali, could you help me understand how that could h
ajuma
2017/02/21 20:07:56
Every layer has a scroll_tree_index. If a layer do
bokan
2017/02/21 20:25:22
Ah, got it - I was misunderstanding how that worke
pdr.
2017/02/23 05:44:26
+1, I had the same misunderstanding.
|
| return true; |
| } |
| return false; |
| @@ -2626,7 +2626,7 @@ static bool IsClosestScrollAncestor(LayerImpl* child, |
| for (; scroll_tree.parent(scroll_node); |
| scroll_node = scroll_tree.parent(scroll_node)) { |
| if (scroll_node->scrollable) |
| - return scroll_node->owning_layer_id == scroll_ancestor->id(); |
| + return scroll_node->id == scroll_ancestor->scroll_tree_index(); |
|
ajuma
2017/02/21 16:05:25
Same comment as above, but this time it looks like
sunxd
2017/02/22 22:25:19
In some cases we have MainThreadScrollingReason::k
|
| } |
| return false; |
| } |