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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 SkColor arbitrary_color = SkColorSetRGB(10, 20, 30); | 132 SkColor arbitrary_color = SkColorSetRGB(10, 20, 30); |
133 gfx::Transform arbitrary_transform; | 133 gfx::Transform arbitrary_transform; |
134 arbitrary_transform.Scale3d(0.1f, 0.2f, 0.3f); | 134 arbitrary_transform.Scale3d(0.1f, 0.2f, 0.3f); |
135 FilterOperations arbitrary_filters; | 135 FilterOperations arbitrary_filters; |
136 arbitrary_filters.Append(FilterOperation::CreateOpacityFilter(0.5f)); | 136 arbitrary_filters.Append(FilterOperation::CreateOpacityFilter(0.5f)); |
137 SkXfermode::Mode arbitrary_blend_mode = SkXfermode::kMultiply_Mode; | 137 SkXfermode::Mode arbitrary_blend_mode = SkXfermode::kMultiply_Mode; |
138 | 138 |
139 // These properties are internal, and should not be considered "change" when | 139 // These properties are internal, and should not be considered "change" when |
140 // they are used. | 140 // they are used. |
141 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE( | 141 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE( |
142 root->SetUpdateRect(arbitrary_rect_f)); | 142 root->SetUpdateRect(arbitrary_rect)); |
143 EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(root->SetBounds(arbitrary_size)); | 143 EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(root->SetBounds(arbitrary_size)); |
144 | 144 |
145 // Changing these properties affects the entire subtree of layers. | 145 // Changing these properties affects the entire subtree of layers. |
146 EXECUTE_AND_VERIFY_SUBTREE_CHANGED( | 146 EXECUTE_AND_VERIFY_SUBTREE_CHANGED( |
147 root->SetTransformOrigin(arbitrary_point_3f)); | 147 root->SetTransformOrigin(arbitrary_point_3f)); |
148 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetFilters(arbitrary_filters)); | 148 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetFilters(arbitrary_filters)); |
149 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetFilters(FilterOperations())); | 149 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetFilters(FilterOperations())); |
150 EXECUTE_AND_VERIFY_SUBTREE_CHANGED( | 150 EXECUTE_AND_VERIFY_SUBTREE_CHANGED( |
151 root->SetMaskLayer(LayerImpl::Create(host_impl.active_tree(), 9))); | 151 root->SetMaskLayer(LayerImpl::Create(host_impl.active_tree(), 9))); |
152 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetMasksToBounds(true)); | 152 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetMasksToBounds(true)); |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 layer()->id(), tree()->root_layer()->id()); | 693 layer()->id(), tree()->root_layer()->id()); |
694 | 694 |
695 int expected_horizontal_maximum = | 695 int expected_horizontal_maximum = |
696 layer()->bounds().width() - tree()->root_layer()->bounds().width(); | 696 layer()->bounds().width() - tree()->root_layer()->bounds().width(); |
697 EXPECT_EQ(expected_horizontal_maximum, horizontal_scrollbar->maximum()); | 697 EXPECT_EQ(expected_horizontal_maximum, horizontal_scrollbar->maximum()); |
698 EXPECT_EQ(scroll_offset.x(), horizontal_scrollbar->current_pos()); | 698 EXPECT_EQ(scroll_offset.x(), horizontal_scrollbar->current_pos()); |
699 } | 699 } |
700 | 700 |
701 } // namespace | 701 } // namespace |
702 } // namespace cc | 702 } // namespace cc |
OLD | NEW |