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/trees/tree_synchronizer.h" | 5 #include "cc/trees/tree_synchronizer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> |
8 | 9 |
9 #include "cc/animation/layer_animation_controller.h" | 10 #include "cc/animation/layer_animation_controller.h" |
10 #include "cc/layers/layer.h" | 11 #include "cc/layers/layer.h" |
11 #include "cc/layers/layer_impl.h" | 12 #include "cc/layers/layer_impl.h" |
12 #include "cc/test/animation_test_common.h" | 13 #include "cc/test/animation_test_common.h" |
13 #include "cc/test/fake_impl_proxy.h" | 14 #include "cc/test/fake_impl_proxy.h" |
14 #include "cc/test/fake_layer_tree_host_impl.h" | 15 #include "cc/test/fake_layer_tree_host_impl.h" |
15 #include "cc/trees/proxy.h" | 16 #include "cc/trees/proxy.h" |
16 #include "cc/trees/single_thread_proxy.h" | 17 #include "cc/trees/single_thread_proxy.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 } | 56 } |
56 | 57 |
57 virtual void PushPropertiesTo(LayerImpl* layer_impl) OVERRIDE { | 58 virtual void PushPropertiesTo(LayerImpl* layer_impl) OVERRIDE { |
58 Layer::PushPropertiesTo(layer_impl); | 59 Layer::PushPropertiesTo(layer_impl); |
59 | 60 |
60 MockLayerImpl* mock_layer_impl = static_cast<MockLayerImpl*>(layer_impl); | 61 MockLayerImpl* mock_layer_impl = static_cast<MockLayerImpl*>(layer_impl); |
61 mock_layer_impl->SetLayerImplDestructionList(layer_impl_destruction_list_); | 62 mock_layer_impl->SetLayerImplDestructionList(layer_impl_destruction_list_); |
62 } | 63 } |
63 | 64 |
64 private: | 65 private: |
65 MockLayer(std::vector<int>* layer_impl_destruction_list) | 66 explicit MockLayer(std::vector<int>* layer_impl_destruction_list) |
66 : Layer(), layer_impl_destruction_list_(layer_impl_destruction_list) {} | 67 : Layer(), layer_impl_destruction_list_(layer_impl_destruction_list) {} |
67 virtual ~MockLayer() {} | 68 virtual ~MockLayer() {} |
68 | 69 |
69 std::vector<int>* layer_impl_destruction_list_; | 70 std::vector<int>* layer_impl_destruction_list_; |
70 }; | 71 }; |
71 | 72 |
72 class FakeLayerAnimationController : public LayerAnimationController { | 73 class FakeLayerAnimationController : public LayerAnimationController { |
73 public: | 74 public: |
74 static scoped_refptr<LayerAnimationController> Create() { | 75 static scoped_refptr<LayerAnimationController> Create() { |
75 return static_cast<LayerAnimationController*>( | 76 return static_cast<LayerAnimationController*>( |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 TreeSynchronizer::SynchronizeTrees(layer_tree_root.get(), | 510 TreeSynchronizer::SynchronizeTrees(layer_tree_root.get(), |
510 layer_impl_tree_root.Pass(), | 511 layer_impl_tree_root.Pass(), |
511 host_impl_.active_tree()); | 512 host_impl_.active_tree()); |
512 | 513 |
513 EXPECT_TRUE(static_cast<FakeLayerAnimationController*>( | 514 EXPECT_TRUE(static_cast<FakeLayerAnimationController*>( |
514 layer_tree_root->layer_animation_controller())->SynchronizedAnimations()); | 515 layer_tree_root->layer_animation_controller())->SynchronizedAnimations()); |
515 } | 516 } |
516 | 517 |
517 } // namespace | 518 } // namespace |
518 } // namespace cc | 519 } // namespace cc |
OLD | NEW |