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/layers/layer_impl.h" | 5 #include "cc/layers/layer_impl.h" |
6 | 6 |
7 #include "cc/layers/painted_scrollbar_layer_impl.h" | 7 #include "cc/layers/painted_scrollbar_layer_impl.h" |
8 #include "cc/output/filter_operation.h" | 8 #include "cc/output/filter_operation.h" |
9 #include "cc/output/filter_operations.h" | 9 #include "cc/output/filter_operations.h" |
10 #include "cc/test/fake_impl_proxy.h" | 10 #include "cc/test/fake_impl_proxy.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 193 |
194 // Changing these properties should cause the layer to need to push properties | 194 // Changing these properties should cause the layer to need to push properties |
195 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE( | 195 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE( |
196 root->SetScrollParent(scroll_parent.get())); | 196 root->SetScrollParent(scroll_parent.get())); |
197 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE( | 197 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE( |
198 root->SetScrollChildren(scroll_children)); | 198 root->SetScrollChildren(scroll_children)); |
199 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE( | 199 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE( |
200 root->SetClipParent(clip_parent.get())); | 200 root->SetClipParent(clip_parent.get())); |
201 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE( | 201 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE( |
202 root->SetClipChildren(clip_children)); | 202 root->SetClipChildren(clip_children)); |
| 203 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE( |
| 204 root->SetNumDescendantsThatDrawContent(10)); |
203 | 205 |
204 // After setting all these properties already, setting to the exact same | 206 // After setting all these properties already, setting to the exact same |
205 // values again should not cause any change. | 207 // values again should not cause any change. |
206 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE( | 208 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE( |
207 root->SetTransformOrigin(arbitrary_point_3f)); | 209 root->SetTransformOrigin(arbitrary_point_3f)); |
208 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->SetMasksToBounds(true)); | 210 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->SetMasksToBounds(true)); |
209 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE( | 211 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE( |
210 root->SetPosition(arbitrary_point_f)); | 212 root->SetPosition(arbitrary_point_f)); |
211 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE( | 213 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE( |
212 root->SetShouldFlattenTransform(false)); | 214 root->SetShouldFlattenTransform(false)); |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 layer()->id(), tree()->root_layer()->id()); | 684 layer()->id(), tree()->root_layer()->id()); |
683 | 685 |
684 int expected_horizontal_maximum = | 686 int expected_horizontal_maximum = |
685 layer()->bounds().width() - tree()->root_layer()->bounds().width(); | 687 layer()->bounds().width() - tree()->root_layer()->bounds().width(); |
686 EXPECT_EQ(expected_horizontal_maximum, horizontal_scrollbar->maximum()); | 688 EXPECT_EQ(expected_horizontal_maximum, horizontal_scrollbar->maximum()); |
687 EXPECT_EQ(scroll_offset.x(), horizontal_scrollbar->current_pos()); | 689 EXPECT_EQ(scroll_offset.x(), horizontal_scrollbar->current_pos()); |
688 } | 690 } |
689 | 691 |
690 } // namespace | 692 } // namespace |
691 } // namespace cc | 693 } // namespace cc |
OLD | NEW |