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

Side by Side Diff: cc/trees/layer_tree_host_common_unittest.cc

Issue 2714043002: Store non-fast scrollable regions on ScrollNode (Closed)
Patch Set: Rebase from space Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 10656 matching lines...) Expand 10 before | Expand all | Expand 10 after
10667 property_trees.is_main_thread = true; 10667 property_trees.is_main_thread = true;
10668 property_trees.is_active = false; 10668 property_trees.is_active = false;
10669 ScrollTree& expected_scroll_tree = property_trees.scroll_tree; 10669 ScrollTree& expected_scroll_tree = property_trees.scroll_tree;
10670 ScrollNode* property_tree_root = expected_scroll_tree.Node(0); 10670 ScrollNode* property_tree_root = expected_scroll_tree.Node(0);
10671 property_tree_root->id = kRootPropertyTreeNodeId; 10671 property_tree_root->id = kRootPropertyTreeNodeId;
10672 property_tree_root->parent_id = ScrollTree::kInvalidNodeId; 10672 property_tree_root->parent_id = ScrollTree::kInvalidNodeId;
10673 property_tree_root->owning_layer_id = Layer::INVALID_ID; 10673 property_tree_root->owning_layer_id = Layer::INVALID_ID;
10674 property_tree_root->scrollable = false; 10674 property_tree_root->scrollable = false;
10675 property_tree_root->main_thread_scrolling_reasons = 10675 property_tree_root->main_thread_scrolling_reasons =
10676 MainThreadScrollingReason::kNotScrollingOnMain; 10676 MainThreadScrollingReason::kNotScrollingOnMain;
10677 property_tree_root->contains_non_fast_scrollable_region = false; 10677 property_tree_root->non_fast_scrollable_region = Region();
10678 property_tree_root->transform_id = kRootPropertyTreeNodeId; 10678 property_tree_root->transform_id = kRootPropertyTreeNodeId;
10679 10679
10680 // The node owned by root1 10680 // The node owned by root1
10681 ScrollNode scroll_root1; 10681 ScrollNode scroll_root1;
10682 scroll_root1.id = 1; 10682 scroll_root1.id = 1;
10683 scroll_root1.owning_layer_id = root1->id(); 10683 scroll_root1.owning_layer_id = root1->id();
10684 scroll_root1.user_scrollable_horizontal = true; 10684 scroll_root1.user_scrollable_horizontal = true;
10685 scroll_root1.user_scrollable_vertical = true; 10685 scroll_root1.user_scrollable_vertical = true;
10686 scroll_root1.transform_id = root1->transform_tree_index(); 10686 scroll_root1.transform_id = root1->transform_tree_index();
10687 expected_scroll_tree.Insert(scroll_root1, 0); 10687 expected_scroll_tree.Insert(scroll_root1, 0);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
10733 scroll_grand_child11.scrollable = true; 10733 scroll_grand_child11.scrollable = true;
10734 scroll_grand_child11.user_scrollable_horizontal = true; 10734 scroll_grand_child11.user_scrollable_horizontal = true;
10735 scroll_grand_child11.user_scrollable_vertical = true; 10735 scroll_grand_child11.user_scrollable_vertical = true;
10736 scroll_grand_child11.transform_id = grand_child11->transform_tree_index(); 10736 scroll_grand_child11.transform_id = grand_child11->transform_tree_index();
10737 expected_scroll_tree.Insert(scroll_grand_child11, 4); 10737 expected_scroll_tree.Insert(scroll_grand_child11, 4);
10738 10738
10739 // The node owned by parent5 10739 // The node owned by parent5
10740 ScrollNode scroll_parent5; 10740 ScrollNode scroll_parent5;
10741 scroll_parent5.id = 8; 10741 scroll_parent5.id = 8;
10742 scroll_parent5.owning_layer_id = parent5->id(); 10742 scroll_parent5.owning_layer_id = parent5->id();
10743 scroll_parent5.contains_non_fast_scrollable_region = true; 10743 scroll_parent5.non_fast_scrollable_region = gfx::Rect(0, 0, 50, 50);
10744 scroll_parent5.bounds = gfx::Size(10, 10); 10744 scroll_parent5.bounds = gfx::Size(10, 10);
10745 scroll_parent5.should_flatten = true; 10745 scroll_parent5.should_flatten = true;
10746 scroll_parent5.user_scrollable_horizontal = true; 10746 scroll_parent5.user_scrollable_horizontal = true;
10747 scroll_parent5.user_scrollable_vertical = true; 10747 scroll_parent5.user_scrollable_vertical = true;
10748 scroll_parent5.transform_id = parent5->transform_tree_index(); 10748 scroll_parent5.transform_id = parent5->transform_tree_index();
10749 expected_scroll_tree.Insert(scroll_parent5, 1); 10749 expected_scroll_tree.Insert(scroll_parent5, 1);
10750 10750
10751 expected_scroll_tree.SetScrollOffset(parent2->id(), gfx::ScrollOffset(0, 0)); 10751 expected_scroll_tree.SetScrollOffset(parent2->id(), gfx::ScrollOffset(0, 0));
10752 expected_scroll_tree.SetScrollOffset(child7->id(), gfx::ScrollOffset(0, 0)); 10752 expected_scroll_tree.SetScrollOffset(child7->id(), gfx::ScrollOffset(0, 0));
10753 expected_scroll_tree.SetScrollOffset(grand_child11->id(), 10753 expected_scroll_tree.SetScrollOffset(grand_child11->id(),
10754 gfx::ScrollOffset(0, 0)); 10754 gfx::ScrollOffset(0, 0));
10755 expected_scroll_tree.set_needs_update(false); 10755 expected_scroll_tree.set_needs_update(false);
10756 10756
10757 EXPECT_EQ(expected_scroll_tree, scroll_tree); 10757 EXPECT_EQ(expected_scroll_tree, scroll_tree);
10758 10758
10759 // Check other layers' scroll_tree_index 10759 // Check other layers' scroll_tree_index
10760 EXPECT_EQ(scroll_root1.id, page_scale_layer->scroll_tree_index()); 10760 EXPECT_EQ(scroll_root1.id, page_scale_layer->scroll_tree_index());
10761 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); 10761 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index());
10762 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); 10762 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index());
10763 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); 10763 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index());
10764 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); 10764 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index());
10765 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); 10765 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index());
10766 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); 10766 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index());
10767 } 10767 }
10768 10768
10769 } // namespace 10769 } // namespace
10770 } // namespace cc 10770 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698