| 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 10198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10209 scroll_parent5.id = 8; | 10209 scroll_parent5.id = 8; |
| 10210 scroll_parent5.owner_id = parent5->id(); | 10210 scroll_parent5.owner_id = parent5->id(); |
| 10211 scroll_parent5.contains_non_fast_scrollable_region = true; | 10211 scroll_parent5.contains_non_fast_scrollable_region = true; |
| 10212 scroll_parent5.bounds = gfx::Size(10, 10); | 10212 scroll_parent5.bounds = gfx::Size(10, 10); |
| 10213 scroll_parent5.should_flatten = true; | 10213 scroll_parent5.should_flatten = true; |
| 10214 scroll_parent5.user_scrollable_horizontal = true; | 10214 scroll_parent5.user_scrollable_horizontal = true; |
| 10215 scroll_parent5.user_scrollable_vertical = true; | 10215 scroll_parent5.user_scrollable_vertical = true; |
| 10216 scroll_parent5.transform_id = parent5->transform_tree_index(); | 10216 scroll_parent5.transform_id = parent5->transform_tree_index(); |
| 10217 expected_scroll_tree.Insert(scroll_parent5, 1); | 10217 expected_scroll_tree.Insert(scroll_parent5, 1); |
| 10218 | 10218 |
| 10219 expected_scroll_tree.SetScrollOffset(parent2->id(), gfx::ScrollOffset(0, 0)); | 10219 gfx::ScrollOffset offset; |
| 10220 expected_scroll_tree.SetScrollOffset(child7->id(), gfx::ScrollOffset(0, 0)); | 10220 gfx::ScrollOffset overscroll; |
| 10221 expected_scroll_tree.SetScrollOffset(grand_child11->id(), | 10221 expected_scroll_tree.SetScrollOffset(parent2->id(), offset, overscroll); |
| 10222 gfx::ScrollOffset(0, 0)); | 10222 expected_scroll_tree.SetScrollOffset(child7->id(), offset, overscroll); |
| 10223 expected_scroll_tree.SetScrollOffset(grand_child11->id(), offset, overscroll); |
| 10223 expected_scroll_tree.set_needs_update(false); | 10224 expected_scroll_tree.set_needs_update(false); |
| 10224 | 10225 |
| 10225 EXPECT_EQ(expected_scroll_tree, scroll_tree); | 10226 EXPECT_EQ(expected_scroll_tree, scroll_tree); |
| 10226 | 10227 |
| 10227 // Check other layers' scroll_tree_index | 10228 // Check other layers' scroll_tree_index |
| 10228 EXPECT_EQ(scroll_root1.id, page_scale_layer->scroll_tree_index()); | 10229 EXPECT_EQ(scroll_root1.id, page_scale_layer->scroll_tree_index()); |
| 10229 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); | 10230 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); |
| 10230 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); | 10231 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); |
| 10231 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); | 10232 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); |
| 10232 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); | 10233 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); |
| 10233 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); | 10234 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); |
| 10234 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); | 10235 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); |
| 10235 } | 10236 } |
| 10236 | 10237 |
| 10237 } // namespace | 10238 } // namespace |
| 10238 } // namespace cc | 10239 } // namespace cc |
| OLD | NEW |