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

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

Issue 2840433002: Move LayerImpl's bounds_delta to property trees (Closed)
Patch Set: Document ViewportBoundsDelta better Created 3 years, 8 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_impl_unittest.cc ('k') | cc/test/fake_layer_tree_host.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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 }; 208 };
209 209
210 namespace { 210 namespace {
211 211
212 void SetFixedContainerSizeDelta(LayerImpl* scroll_layer, 212 void SetFixedContainerSizeDelta(LayerImpl* scroll_layer,
213 const gfx::Vector2d& delta) { 213 const gfx::Vector2d& delta) {
214 DCHECK(scroll_layer); 214 DCHECK(scroll_layer);
215 DCHECK(scroll_layer->scrollable()); 215 DCHECK(scroll_layer->scrollable());
216 216
217 LayerImpl* container_layer = scroll_layer->scroll_clip_layer(); 217 LayerImpl* container_layer = scroll_layer->scroll_clip_layer();
218 container_layer->SetBoundsDelta(delta); 218 container_layer->SetViewportBoundsDelta(delta);
219 } 219 }
220 } // namespace 220 } // namespace
221 221
222 TEST_F(LayerPositionConstraintTest, 222 TEST_F(LayerPositionConstraintTest,
223 ScrollCompensationForFixedPositionLayerWithDirectContainer) { 223 ScrollCompensationForFixedPositionLayerWithDirectContainer) {
224 // This test checks for correct scroll compensation when the fixed-position 224 // This test checks for correct scroll compensation when the fixed-position
225 // container is the direct parent of the fixed-position layer. 225 // container is the direct parent of the fixed-position layer.
226 child_->SetIsContainerForFixedPositionLayers(true); 226 child_->SetIsContainerForFixedPositionLayers(true);
227 grand_child_->SetPositionConstraint(fixed_to_top_left_); 227 grand_child_->SetPositionConstraint(fixed_to_top_left_);
228 228
(...skipping 912 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_impl_unittest.cc ('k') | cc/test/fake_layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698