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

Side by Side Diff: cc/layers/layer_position_constraint_unittest.cc

Issue 2661523003: cc: Merge LayerTree into the LayerTreeHost. (Closed)
Patch Set: auto Created 3 years, 10 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 | « cc/layers/layer_list_iterator_unittest.cc ('k') | cc/layers/layer_unittest.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/layers/layer_position_constraint.h" 5 #include "cc/layers/layer_position_constraint.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "cc/animation/animation_host.h" 9 #include "cc/animation/animation_host.h"
10 #include "cc/layers/layer.h" 10 #include "cc/layers/layer.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 grand_child_->AddChild(great_grand_child_); 128 grand_child_->AddChild(great_grand_child_);
129 child_->AddChild(grand_child_); 129 child_->AddChild(grand_child_);
130 child_transform_layer_->AddChild(child_); 130 child_transform_layer_->AddChild(child_);
131 outer_viewport_container_layer_->AddChild(child_transform_layer_); 131 outer_viewport_container_layer_->AddChild(child_transform_layer_);
132 scroll_layer_->AddChild(outer_viewport_container_layer_); 132 scroll_layer_->AddChild(outer_viewport_container_layer_);
133 inner_viewport_container_layer_->AddChild(scroll_layer_); 133 inner_viewport_container_layer_->AddChild(scroll_layer_);
134 root_->AddChild(inner_viewport_container_layer_); 134 root_->AddChild(inner_viewport_container_layer_);
135 135
136 layer_tree_host_->SetRootLayer(root_); 136 layer_tree_host_->SetRootLayer(root_);
137 layer_tree_host_->GetLayerTree()->RegisterViewportLayers( 137 layer_tree_host_->RegisterViewportLayers(nullptr, root_, scroll_layer_,
138 nullptr, root_, scroll_layer_, child_); 138 child_);
139 } 139 }
140 140
141 void CommitAndUpdateImplPointers() { 141 void CommitAndUpdateImplPointers() {
142 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( 142 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs(
143 root_.get(), root_->bounds()); 143 root_.get(), root_->bounds());
144 inputs.inner_viewport_scroll_layer = 144 inputs.inner_viewport_scroll_layer =
145 layer_tree_host_->GetLayerTree()->inner_viewport_scroll_layer(); 145 layer_tree_host_->inner_viewport_scroll_layer();
146 inputs.outer_viewport_scroll_layer = 146 inputs.outer_viewport_scroll_layer =
147 layer_tree_host_->GetLayerTree()->outer_viewport_scroll_layer(); 147 layer_tree_host_->outer_viewport_scroll_layer();
148 LayerTreeHostCommon::CalculateDrawPropertiesForTesting(&inputs); 148 LayerTreeHostCommon::CalculateDrawPropertiesForTesting(&inputs);
149 149
150 // Since scroll deltas aren't sent back to the main thread in this test 150 // Since scroll deltas aren't sent back to the main thread in this test
151 // setup, clear them to maintain consistent state. 151 // setup, clear them to maintain consistent state.
152 if (root_impl_) { 152 if (root_impl_) {
153 SetScrollOffsetDelta(scroll_layer_impl_, gfx::Vector2dF()); 153 SetScrollOffsetDelta(scroll_layer_impl_, gfx::Vector2dF());
154 SetScrollOffsetDelta(child_impl_, gfx::Vector2dF()); 154 SetScrollOffsetDelta(child_impl_, gfx::Vector2dF());
155 SetScrollOffsetDelta(grand_child_impl_, gfx::Vector2dF()); 155 SetScrollOffsetDelta(grand_child_impl_, gfx::Vector2dF());
156 } 156 }
157 root_impl_ = layer_tree_host_->CommitAndCreateLayerImplTree(); 157 root_impl_ = layer_tree_host_->CommitAndCreateLayerImplTree();
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after
1141 expected_fixed_child_transform.Translate(20.0, 20.0); 1141 expected_fixed_child_transform.Translate(20.0, 20.0);
1142 1142
1143 EXPECT_TRANSFORMATION_MATRIX_EQ(expected_scroll_layer_transform, 1143 EXPECT_TRANSFORMATION_MATRIX_EQ(expected_scroll_layer_transform,
1144 scroll_layer_impl_->DrawTransform()); 1144 scroll_layer_impl_->DrawTransform());
1145 EXPECT_TRANSFORMATION_MATRIX_EQ(expected_fixed_child_transform, 1145 EXPECT_TRANSFORMATION_MATRIX_EQ(expected_fixed_child_transform,
1146 fixed_child_impl->DrawTransform()); 1146 fixed_child_impl->DrawTransform());
1147 } 1147 }
1148 1148
1149 } // namespace 1149 } // namespace
1150 } // namespace cc 1150 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_list_iterator_unittest.cc ('k') | cc/layers/layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698