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 1666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1677 MainThreadScrollingReason::kEventHandlers)); | 1677 MainThreadScrollingReason::kEventHandlers)); |
1678 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetNonFastScrollableRegion( | 1678 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetNonFastScrollableRegion( |
1679 Region(gfx::Rect(1, 1, 2, 2)))); | 1679 Region(gfx::Rect(1, 1, 2, 2)))); |
1680 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetTransform( | 1680 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetTransform( |
1681 gfx::Transform(0.0, 0.0, 0.0, 0.0, 0.0, 0.0))); | 1681 gfx::Transform(0.0, 0.0, 0.0, 0.0, 0.0, 0.0))); |
1682 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetDoubleSided(false)); | 1682 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetDoubleSided(false)); |
1683 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetTouchEventHandlerRegion( | 1683 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetTouchEventHandlerRegion( |
1684 gfx::Rect(10, 10))); | 1684 gfx::Rect(10, 10))); |
1685 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetForceRenderSurfaceForTesting(true)); | 1685 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetForceRenderSurfaceForTesting(true)); |
1686 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetHideLayerAndSubtree(true)); | 1686 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetHideLayerAndSubtree(true)); |
1687 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetElementId(ElementId(2, 0))); | 1687 EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetElementId(2)); |
1688 EXPECT_SET_NEEDS_COMMIT( | 1688 EXPECT_SET_NEEDS_COMMIT( |
1689 1, test_layer->SetMutableProperties(MutableProperty::kTransform)); | 1689 1, test_layer->SetMutableProperties(MutableProperty::kTransform)); |
1690 | 1690 |
1691 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, test_layer->SetMaskLayer( | 1691 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, test_layer->SetMaskLayer( |
1692 dummy_layer1.get())); | 1692 dummy_layer1.get())); |
1693 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, test_layer->SetReplicaLayer( | 1693 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, test_layer->SetReplicaLayer( |
1694 dummy_layer2.get())); | 1694 dummy_layer2.get())); |
1695 | 1695 |
1696 // The above tests should not have caused a change to the needs_display flag. | 1696 // The above tests should not have caused a change to the needs_display flag. |
1697 EXPECT_FALSE(test_layer->NeedsDisplayForTesting()); | 1697 EXPECT_FALSE(test_layer->NeedsDisplayForTesting()); |
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2474 TEST_F(LayerTest, ElementIdAndMutablePropertiesArePushed) { | 2474 TEST_F(LayerTest, ElementIdAndMutablePropertiesArePushed) { |
2475 scoped_refptr<Layer> test_layer = Layer::Create(); | 2475 scoped_refptr<Layer> test_layer = Layer::Create(); |
2476 std::unique_ptr<LayerImpl> impl_layer = | 2476 std::unique_ptr<LayerImpl> impl_layer = |
2477 LayerImpl::Create(host_impl_.active_tree(), 1); | 2477 LayerImpl::Create(host_impl_.active_tree(), 1); |
2478 | 2478 |
2479 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, | 2479 EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, |
2480 layer_tree_host_->SetRootLayer(test_layer)); | 2480 layer_tree_host_->SetRootLayer(test_layer)); |
2481 | 2481 |
2482 EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(2); | 2482 EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(2); |
2483 | 2483 |
2484 test_layer->SetElementId(ElementId(2, 0)); | 2484 test_layer->SetElementId(2); |
2485 test_layer->SetMutableProperties(MutableProperty::kTransform); | 2485 test_layer->SetMutableProperties(MutableProperty::kTransform); |
2486 | 2486 |
2487 EXPECT_FALSE(impl_layer->element_id()); | 2487 EXPECT_EQ(0lu, impl_layer->element_id()); |
2488 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties()); | 2488 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties()); |
2489 | 2489 |
2490 test_layer->PushPropertiesTo(impl_layer.get()); | 2490 test_layer->PushPropertiesTo(impl_layer.get()); |
2491 | 2491 |
2492 EXPECT_EQ(ElementId(2, 0), impl_layer->element_id()); | 2492 EXPECT_EQ(2lu, impl_layer->element_id()); |
2493 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties()); | 2493 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties()); |
2494 } | 2494 } |
2495 | 2495 |
2496 } // namespace | 2496 } // namespace |
2497 } // namespace cc | 2497 } // namespace cc |
OLD | NEW |