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.h" | 5 #include "cc/layers/layer.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
10 #include "cc/animation/animation_host.h" | 10 #include "cc/animation/animation_host.h" |
(...skipping 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1702 MainThreadScrollingReason::kEventHandlers)); | 1702 MainThreadScrollingReason::kEventHandlers)); |
1703 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetNonFastScrollableRegion( | 1703 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetNonFastScrollableRegion( |
1704 Region(gfx::Rect(1, 1, 2, 2)))); | 1704 Region(gfx::Rect(1, 1, 2, 2)))); |
1705 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetTransform( | 1705 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetTransform( |
1706 gfx::Transform(0.0, 0.0, 0.0, 0.0, 0.0, 0.0))); | 1706 gfx::Transform(0.0, 0.0, 0.0, 0.0, 0.0, 0.0))); |
1707 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetDoubleSided(false)); | 1707 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetDoubleSided(false)); |
1708 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetTouchEventHandlerRegion( | 1708 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetTouchEventHandlerRegion( |
1709 gfx::Rect(10, 10))); | 1709 gfx::Rect(10, 10))); |
1710 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetForceRenderSurfaceForTesting(true)); | 1710 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetForceRenderSurfaceForTesting(true)); |
1711 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetHideLayerAndSubtree(true)); | 1711 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetHideLayerAndSubtree(true)); |
1712 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetElementId(2)); | 1712 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetElementId(ElementId(2, 0))); |
1713 EXPECT_SET_NEEDS_COMMIT( | 1713 EXPECT_SET_NEEDS_COMMIT( |
1714 1, test_layer->SetMutableProperties(MutableProperty::kTransform)); | 1714 1, test_layer->SetMutableProperties(MutableProperty::kTransform)); |
1715 | 1715 |
1716 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, test_layer->SetMaskLayer( | 1716 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, test_layer->SetMaskLayer( |
1717 dummy_layer1.get())); | 1717 dummy_layer1.get())); |
1718 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, test_layer->SetReplicaLayer( | 1718 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, test_layer->SetReplicaLayer( |
1719 dummy_layer2.get())); | 1719 dummy_layer2.get())); |
1720 | 1720 |
1721 // The above tests should not have caused a change to the needs_display flag. | 1721 // The above tests should not have caused a change to the needs_display flag. |
1722 EXPECT_FALSE(test_layer->NeedsDisplayForTesting()); | 1722 EXPECT_FALSE(test_layer->NeedsDisplayForTesting()); |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2502 TEST_F(LayerTest, ElementIdAndMutablePropertiesArePushed) { | 2502 TEST_F(LayerTest, ElementIdAndMutablePropertiesArePushed) { |
2503 scoped_refptr<Layer> test_layer = Layer::Create(); | 2503 scoped_refptr<Layer> test_layer = Layer::Create(); |
2504 std::unique_ptr<LayerImpl> impl_layer = | 2504 std::unique_ptr<LayerImpl> impl_layer = |
2505 LayerImpl::Create(host_impl_.active_tree(), 1); | 2505 LayerImpl::Create(host_impl_.active_tree(), 1); |
2506 | 2506 |
2507 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, | 2507 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, |
2508 layer_tree_host_->SetRootLayer(test_layer)); | 2508 layer_tree_host_->SetRootLayer(test_layer)); |
2509 | 2509 |
2510 EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(2); | 2510 EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(2); |
2511 | 2511 |
2512 test_layer->SetElementId(2); | 2512 test_layer->SetElementId(ElementId(2, 0)); |
2513 test_layer->SetMutableProperties(MutableProperty::kTransform); | 2513 test_layer->SetMutableProperties(MutableProperty::kTransform); |
2514 | 2514 |
2515 EXPECT_EQ(0lu, impl_layer->element_id()); | 2515 EXPECT_FALSE(impl_layer->element_id()); |
2516 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties()); | 2516 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties()); |
2517 | 2517 |
2518 test_layer->PushPropertiesTo(impl_layer.get()); | 2518 test_layer->PushPropertiesTo(impl_layer.get()); |
2519 | 2519 |
2520 EXPECT_EQ(2lu, impl_layer->element_id()); | 2520 EXPECT_EQ(ElementId(2, 0), impl_layer->element_id()); |
2521 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties()); | 2521 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties()); |
2522 } | 2522 } |
2523 | 2523 |
2524 } // namespace | 2524 } // namespace |
2525 } // namespace cc | 2525 } // namespace cc |
OLD | NEW |