| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/trees/layer_tree_host_common.h" | 5 #include "cc/trees/layer_tree_host_common.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 9567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9578 scroll_parent5.id = 8; | 9578 scroll_parent5.id = 8; |
| 9579 scroll_parent5.owner_id = parent5->id(); | 9579 scroll_parent5.owner_id = parent5->id(); |
| 9580 scroll_parent5.contains_non_fast_scrollable_region = true; | 9580 scroll_parent5.contains_non_fast_scrollable_region = true; |
| 9581 scroll_parent5.bounds = gfx::Size(10, 10); | 9581 scroll_parent5.bounds = gfx::Size(10, 10); |
| 9582 scroll_parent5.should_flatten = true; | 9582 scroll_parent5.should_flatten = true; |
| 9583 scroll_parent5.user_scrollable_horizontal = true; | 9583 scroll_parent5.user_scrollable_horizontal = true; |
| 9584 scroll_parent5.user_scrollable_vertical = true; | 9584 scroll_parent5.user_scrollable_vertical = true; |
| 9585 scroll_parent5.transform_id = parent5->transform_tree_index(); | 9585 scroll_parent5.transform_id = parent5->transform_tree_index(); |
| 9586 expected_scroll_tree.Insert(scroll_parent5, 1); | 9586 expected_scroll_tree.Insert(scroll_parent5, 1); |
| 9587 | 9587 |
| 9588 expected_scroll_tree.SetScrollOffset(parent2->id(), gfx::ScrollOffset(0, 0)); | 9588 gfx::ScrollOffset offset; |
| 9589 expected_scroll_tree.SetScrollOffset(child7->id(), gfx::ScrollOffset(0, 0)); | 9589 gfx::ScrollOffset overscroll; |
| 9590 expected_scroll_tree.SetScrollOffset(grand_child11->id(), | 9590 expected_scroll_tree.SetScrollOffset(parent2->id(), offset, overscroll); |
| 9591 gfx::ScrollOffset(0, 0)); | 9591 expected_scroll_tree.SetScrollOffset(child7->id(), offset, overscroll); |
| 9592 expected_scroll_tree.SetScrollOffset(grand_child11->id(), offset, overscroll); |
| 9592 expected_scroll_tree.set_needs_update(false); | 9593 expected_scroll_tree.set_needs_update(false); |
| 9593 | 9594 |
| 9594 EXPECT_EQ(expected_scroll_tree, scroll_tree); | 9595 EXPECT_EQ(expected_scroll_tree, scroll_tree); |
| 9595 | 9596 |
| 9596 // Check other layers' scroll_tree_index | 9597 // Check other layers' scroll_tree_index |
| 9597 EXPECT_EQ(scroll_root1.id, page_scale_layer->scroll_tree_index()); | 9598 EXPECT_EQ(scroll_root1.id, page_scale_layer->scroll_tree_index()); |
| 9598 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); | 9599 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); |
| 9599 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); | 9600 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); |
| 9600 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); | 9601 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); |
| 9601 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); | 9602 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); |
| 9602 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); | 9603 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); |
| 9603 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); | 9604 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); |
| 9604 } | 9605 } |
| 9605 | 9606 |
| 9606 } // namespace | 9607 } // namespace |
| 9607 } // namespace cc | 9608 } // namespace cc |
| OLD | NEW |