| 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 | 213 |
| 214 // After setting all these properties already, setting to the exact same | 214 // After setting all these properties already, setting to the exact same |
| 215 // values again should not cause any change. | 215 // values again should not cause any change. |
| 216 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->SetMasksToBounds(true)); | 216 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->SetMasksToBounds(true)); |
| 217 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE( | 217 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE( |
| 218 root->SetPosition(arbitrary_point_f)); | 218 root->SetPosition(arbitrary_point_f)); |
| 219 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->Set3dSortingContextId(1)); | 219 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->Set3dSortingContextId(1)); |
| 220 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE( | 220 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE( |
| 221 root->SetTransform(arbitrary_transform)); | 221 root->SetTransform(arbitrary_transform)); |
| 222 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->SetContentsOpaque(true)); | 222 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->SetContentsOpaque(true)); |
| 223 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->SetOpacity(arbitrary_number)); | |
| 224 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE( | 223 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE( |
| 225 root->SetBlendMode(arbitrary_blend_mode)); | 224 root->SetBlendMode(arbitrary_blend_mode)); |
| 226 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->SetDrawsContent(true)); | 225 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->SetDrawsContent(true)); |
| 227 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->SetBounds(bounds_size)); | 226 EXECUTE_AND_VERIFY_SUBTREE_DID_NOT_CHANGE(root->SetBounds(bounds_size)); |
| 228 } | 227 } |
| 229 | 228 |
| 230 TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties) { | 229 TEST(LayerImplTest, VerifyNeedsUpdateDrawProperties) { |
| 231 FakeImplTaskRunnerProvider task_runner_provider; | 230 FakeImplTaskRunnerProvider task_runner_provider; |
| 232 TestSharedBitmapManager shared_bitmap_manager; | 231 TestSharedBitmapManager shared_bitmap_manager; |
| 233 TestTaskGraphRunner task_graph_runner; | 232 TestTaskGraphRunner task_graph_runner; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetMasksToBounds(true)); | 340 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetMasksToBounds(true)); |
| 342 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetContentsOpaque(true)); | 341 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetContentsOpaque(true)); |
| 343 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES( | 342 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES( |
| 344 layer2->SetPosition(arbitrary_point_f)); | 343 layer2->SetPosition(arbitrary_point_f)); |
| 345 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->Set3dSortingContextId(1)); | 344 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->Set3dSortingContextId(1)); |
| 346 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetDrawsContent(true)); | 345 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetDrawsContent(true)); |
| 347 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES( | 346 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES( |
| 348 layer->SetBackgroundColor(arbitrary_color)); | 347 layer->SetBackgroundColor(arbitrary_color)); |
| 349 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES( | 348 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES( |
| 350 layer->SetBackgroundFilters(arbitrary_filters)); | 349 layer->SetBackgroundFilters(arbitrary_filters)); |
| 351 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetOpacity(arbitrary_number)); | |
| 352 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES( | 350 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES( |
| 353 layer->SetBlendMode(arbitrary_blend_mode)); | 351 layer->SetBlendMode(arbitrary_blend_mode)); |
| 354 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES( | 352 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES( |
| 355 layer->SetTransform(arbitrary_transform)); | 353 layer->SetTransform(arbitrary_transform)); |
| 356 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetBounds(arbitrary_size)); | 354 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetBounds(arbitrary_size)); |
| 357 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetElementId(2)); | 355 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetElementId(2)); |
| 358 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES( | 356 VERIFY_NO_NEEDS_UPDATE_DRAW_PROPERTIES( |
| 359 layer->SetMutableProperties(MutableProperty::kTransform)); | 357 layer->SetMutableProperties(MutableProperty::kTransform)); |
| 360 } | 358 } |
| 361 | 359 |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 | 570 |
| 573 pending_layer->PushPropertiesTo(layer()); | 571 pending_layer->PushPropertiesTo(layer()); |
| 574 | 572 |
| 575 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset()); | 573 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset()); |
| 576 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(), | 574 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(), |
| 577 pending_layer->CurrentScrollOffset()); | 575 pending_layer->CurrentScrollOffset()); |
| 578 } | 576 } |
| 579 | 577 |
| 580 } // namespace | 578 } // namespace |
| 581 } // namespace cc | 579 } // namespace cc |
| OLD | NEW |