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/animation/mutable_properties.h" | 7 #include "cc/animation/mutable_properties.h" |
8 #include "cc/layers/painted_scrollbar_layer_impl.h" | 8 #include "cc/layers/painted_scrollbar_layer_impl.h" |
9 #include "cc/layers/solid_color_scrollbar_layer_impl.h" | 9 #include "cc/layers/solid_color_scrollbar_layer_impl.h" |
10 #include "cc/output/filter_operation.h" | 10 #include "cc/output/filter_operation.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE( | 176 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE( |
177 root->SetUpdateRect(arbitrary_rect)); | 177 root->SetUpdateRect(arbitrary_rect)); |
178 EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(root->SetBounds(arbitrary_size)); | 178 EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(root->SetBounds(arbitrary_size)); |
179 host_impl.active_tree()->property_trees()->needs_rebuild = true; | 179 host_impl.active_tree()->property_trees()->needs_rebuild = true; |
180 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting(); | 180 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting(); |
181 | 181 |
182 // Changing these properties affects the entire subtree of layers. | 182 // Changing these properties affects the entire subtree of layers. |
183 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->OnFilterAnimated(arbitrary_filters)); | 183 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->OnFilterAnimated(arbitrary_filters)); |
184 EXECUTE_AND_VERIFY_SUBTREE_CHANGED( | 184 EXECUTE_AND_VERIFY_SUBTREE_CHANGED( |
185 root->OnFilterAnimated(FilterOperations())); | 185 root->OnFilterAnimated(FilterOperations())); |
186 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->OnOpacityAnimated(arbitrary_number)); | 186 EXECUTE_AND_VERIFY_NO_NEED_TO_PUSH_PROPERTIES_AND_SUBTREE_CHANGED( |
| 187 host_impl.active_tree()->property_trees()->effect_tree.OnOpacityAnimated( |
| 188 arbitrary_number, root->effect_tree_index(), |
| 189 host_impl.active_tree())); |
187 EXECUTE_AND_VERIFY_NO_NEED_TO_PUSH_PROPERTIES_AND_SUBTREE_CHANGED( | 190 EXECUTE_AND_VERIFY_NO_NEED_TO_PUSH_PROPERTIES_AND_SUBTREE_CHANGED( |
188 root->OnTransformAnimated(arbitrary_transform)); | 191 root->OnTransformAnimated(arbitrary_transform)); |
189 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->ScrollBy(arbitrary_vector2d); | 192 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->ScrollBy(arbitrary_vector2d); |
190 root->SetNeedsPushProperties()); | 193 root->SetNeedsPushProperties()); |
191 // SetBoundsDelta changes subtree only when masks_to_bounds is true and it | 194 // SetBoundsDelta changes subtree only when masks_to_bounds is true and it |
192 // doesn't set needs_push_properties as it is always called on active tree. | 195 // doesn't set needs_push_properties as it is always called on active tree. |
193 root->SetMasksToBounds(true); | 196 root->SetMasksToBounds(true); |
194 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetBoundsDelta(arbitrary_vector2d); | 197 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetBoundsDelta(arbitrary_vector2d); |
195 root->SetNeedsPushProperties()); | 198 root->SetNeedsPushProperties()); |
196 | 199 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 layer->NoteLayerPropertyChanged()); | 316 layer->NoteLayerPropertyChanged()); |
314 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetContentsOpaque(true); | 317 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetContentsOpaque(true); |
315 layer->NoteLayerPropertyChanged()); | 318 layer->NoteLayerPropertyChanged()); |
316 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer2->SetPosition(arbitrary_point_f); | 319 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer2->SetPosition(arbitrary_point_f); |
317 layer->NoteLayerPropertyChanged()); | 320 layer->NoteLayerPropertyChanged()); |
318 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->Set3dSortingContextId(1); | 321 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->Set3dSortingContextId(1); |
319 layer->NoteLayerPropertyChanged()); | 322 layer->NoteLayerPropertyChanged()); |
320 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES( | 323 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES( |
321 layer->SetBackgroundColor(arbitrary_color)); | 324 layer->SetBackgroundColor(arbitrary_color)); |
322 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES( | 325 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES( |
323 layer->OnOpacityAnimated(arbitrary_number)); | 326 host_impl.active_tree()->property_trees()->effect_tree.OnOpacityAnimated( |
| 327 arbitrary_number, layer->effect_tree_index(), |
| 328 host_impl.active_tree())); |
324 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES( | 329 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES( |
325 layer->OnTransformAnimated(arbitrary_transform)); | 330 layer->OnTransformAnimated(arbitrary_transform)); |
326 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetBounds(arbitrary_size); | 331 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetBounds(arbitrary_size); |
327 layer->NoteLayerPropertyChanged()); | 332 layer->NoteLayerPropertyChanged()); |
328 | 333 |
329 // Unrelated functions, set to the same values, no needs update. | 334 // Unrelated functions, set to the same values, no needs update. |
330 layer->test_properties()->filters = arbitrary_filters; | 335 layer->test_properties()->filters = arbitrary_filters; |
331 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting(); | 336 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting(); |
332 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES( | 337 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES( |
333 layer->OnFilterAnimated(arbitrary_filters)); | 338 layer->OnFilterAnimated(arbitrary_filters)); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 | 571 |
567 pending_layer->PushPropertiesTo(layer()); | 572 pending_layer->PushPropertiesTo(layer()); |
568 | 573 |
569 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset()); | 574 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset()); |
570 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(), | 575 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(), |
571 pending_layer->CurrentScrollOffset()); | 576 pending_layer->CurrentScrollOffset()); |
572 } | 577 } |
573 | 578 |
574 } // namespace | 579 } // namespace |
575 } // namespace cc | 580 } // namespace cc |
OLD | NEW |