Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/layers/layer.h" | 9 #include "cc/layers/layer.h" |
| 10 #include "cc/layers/layer_impl.h" | 10 #include "cc/layers/layer_impl.h" |
| (...skipping 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 968 // would still have to compensate with respect to its container. | 968 // would still have to compensate with respect to its container. |
| 969 | 969 |
| 970 // Add one more layer to the hierarchy for this test. | 970 // Add one more layer to the hierarchy for this test. |
| 971 scoped_refptr<Layer> great_great_grand_child = | 971 scoped_refptr<Layer> great_great_grand_child = |
| 972 make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings_)); | 972 make_scoped_refptr(new LayerWithForcedDrawsContent(layer_settings_)); |
| 973 great_grand_child_->AddChild(great_great_grand_child); | 973 great_grand_child_->AddChild(great_great_grand_child); |
| 974 | 974 |
| 975 child_->SetIsContainerForFixedPositionLayers(true); | 975 child_->SetIsContainerForFixedPositionLayers(true); |
| 976 grand_child_->SetPositionConstraint(fixed_to_top_left_); | 976 grand_child_->SetPositionConstraint(fixed_to_top_left_); |
| 977 great_grand_child_->SetIsContainerForFixedPositionLayers(true); | 977 great_grand_child_->SetIsContainerForFixedPositionLayers(true); |
| 978 great_grand_child_->SetScrollClipLayerId(root_->id()); | |
|
ajuma
2015/05/29 17:47:08
This test scrolls great_grand_child_, so it should
enne (OOO)
2015/05/29 20:07:53
Is that something that can be DCHECK'd?
ajuma
2015/05/29 21:41:07
Added a DCHECK to LayerImpl::SetScrollDelta.
| |
| 978 great_great_grand_child->SetPositionConstraint(fixed_to_top_left_); | 979 great_great_grand_child->SetPositionConstraint(fixed_to_top_left_); |
| 979 | 980 |
| 980 CommitAndUpdateImplPointers(); | 981 CommitAndUpdateImplPointers(); |
| 981 | 982 |
| 982 LayerImpl* container1 = child_impl_; | 983 LayerImpl* container1 = child_impl_; |
| 983 LayerImpl* fixed_to_container1 = grand_child_impl_; | 984 LayerImpl* fixed_to_container1 = grand_child_impl_; |
| 984 LayerImpl* container2 = great_grand_child_impl_; | 985 LayerImpl* container2 = great_grand_child_impl_; |
| 985 LayerImpl* fixed_to_container2 = container2->children()[0]; | 986 LayerImpl* fixed_to_container2 = container2->children()[0]; |
| 986 | 987 |
| 987 container1->SetScrollDelta(gfx::Vector2d(0, 15)); | 988 container1->SetScrollDelta(gfx::Vector2d(0, 15)); |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 1009 | 1010 |
| 1010 EXPECT_TRANSFORMATION_MATRIX_EQ(expected_container2_transform, | 1011 EXPECT_TRANSFORMATION_MATRIX_EQ(expected_container2_transform, |
| 1011 container2->draw_transform()); | 1012 container2->draw_transform()); |
| 1012 | 1013 |
| 1013 EXPECT_TRANSFORMATION_MATRIX_EQ(expected_fixed_to_container2_transform, | 1014 EXPECT_TRANSFORMATION_MATRIX_EQ(expected_fixed_to_container2_transform, |
| 1014 fixed_to_container2->draw_transform()); | 1015 fixed_to_container2->draw_transform()); |
| 1015 } | 1016 } |
| 1016 | 1017 |
| 1017 } // namespace | 1018 } // namespace |
| 1018 } // namespace cc | 1019 } // namespace cc |
| OLD | NEW |