| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_NO_NEED_TO_PUSH_PROPERTIES_AND_SUBTREE_CHANGED( | 186 EXECUTE_AND_VERIFY_NO_NEED_TO_PUSH_PROPERTIES_AND_SUBTREE_CHANGED( |
| 187 host_impl.active_tree()->property_trees()->effect_tree.OnOpacityAnimated( | 187 host_impl.active_tree()->property_trees()->effect_tree.OnOpacityAnimated( |
| 188 arbitrary_number, root->effect_tree_index(), | 188 arbitrary_number, root->effect_tree_index(), |
| 189 host_impl.active_tree())); | 189 host_impl.active_tree())); |
| 190 EXECUTE_AND_VERIFY_NO_NEED_TO_PUSH_PROPERTIES_AND_SUBTREE_CHANGED( | 190 EXECUTE_AND_VERIFY_NO_NEED_TO_PUSH_PROPERTIES_AND_SUBTREE_CHANGED( |
| 191 root->OnTransformAnimated(arbitrary_transform)); | 191 host_impl.active_tree() |
| 192 ->property_trees() |
| 193 ->transform_tree.OnTransformAnimated(arbitrary_transform, |
| 194 root->transform_tree_index(), |
| 195 host_impl.active_tree())); |
| 192 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->ScrollBy(arbitrary_vector2d); | 196 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->ScrollBy(arbitrary_vector2d); |
| 193 root->SetNeedsPushProperties()); | 197 root->SetNeedsPushProperties()); |
| 194 // SetBoundsDelta changes subtree only when masks_to_bounds is true and it | 198 // SetBoundsDelta changes subtree only when masks_to_bounds is true and it |
| 195 // doesn't set needs_push_properties as it is always called on active tree. | 199 // doesn't set needs_push_properties as it is always called on active tree. |
| 196 root->SetMasksToBounds(true); | 200 root->SetMasksToBounds(true); |
| 197 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetBoundsDelta(arbitrary_vector2d); | 201 EXECUTE_AND_VERIFY_SUBTREE_CHANGED(root->SetBoundsDelta(arbitrary_vector2d); |
| 198 root->SetNeedsPushProperties()); | 202 root->SetNeedsPushProperties()); |
| 199 | 203 |
| 200 // Changing these properties only affects the layer itself. | 204 // Changing these properties only affects the layer itself. |
| 201 EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(root->SetDrawsContent(true)); | 205 EXECUTE_AND_VERIFY_ONLY_LAYER_CHANGED(root->SetDrawsContent(true)); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 layer->NoteLayerPropertyChanged()); | 324 layer->NoteLayerPropertyChanged()); |
| 321 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->Set3dSortingContextId(1); | 325 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->Set3dSortingContextId(1); |
| 322 layer->NoteLayerPropertyChanged()); | 326 layer->NoteLayerPropertyChanged()); |
| 323 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES( | 327 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES( |
| 324 layer->SetBackgroundColor(arbitrary_color)); | 328 layer->SetBackgroundColor(arbitrary_color)); |
| 325 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES( | 329 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES( |
| 326 host_impl.active_tree()->property_trees()->effect_tree.OnOpacityAnimated( | 330 host_impl.active_tree()->property_trees()->effect_tree.OnOpacityAnimated( |
| 327 arbitrary_number, layer->effect_tree_index(), | 331 arbitrary_number, layer->effect_tree_index(), |
| 328 host_impl.active_tree())); | 332 host_impl.active_tree())); |
| 329 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES( | 333 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES( |
| 330 layer->OnTransformAnimated(arbitrary_transform)); | 334 host_impl.active_tree() |
| 335 ->property_trees() |
| 336 ->transform_tree.OnTransformAnimated(arbitrary_transform, |
| 337 layer->transform_tree_index(), |
| 338 host_impl.active_tree())); |
| 331 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetBounds(arbitrary_size); | 339 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetBounds(arbitrary_size); |
| 332 layer->NoteLayerPropertyChanged()); | 340 layer->NoteLayerPropertyChanged()); |
| 333 | 341 |
| 334 // Unrelated functions, set to the same values, no needs update. | 342 // Unrelated functions, set to the same values, no needs update. |
| 335 layer->test_properties()->filters = arbitrary_filters; | 343 layer->test_properties()->filters = arbitrary_filters; |
| 336 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting(); | 344 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting(); |
| 337 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES( | 345 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES( |
| 338 layer->OnFilterAnimated(arbitrary_filters)); | 346 layer->OnFilterAnimated(arbitrary_filters)); |
| 339 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetMasksToBounds(true)); | 347 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetMasksToBounds(true)); |
| 340 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetContentsOpaque(true)); | 348 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetContentsOpaque(true)); |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 | 579 |
| 572 pending_layer->PushPropertiesTo(layer()); | 580 pending_layer->PushPropertiesTo(layer()); |
| 573 | 581 |
| 574 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset()); | 582 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset()); |
| 575 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(), | 583 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(), |
| 576 pending_layer->CurrentScrollOffset()); | 584 pending_layer->CurrentScrollOffset()); |
| 577 } | 585 } |
| 578 | 586 |
| 579 } // namespace | 587 } // namespace |
| 580 } // namespace cc | 588 } // namespace cc |
| OLD | NEW |