| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef CC_TEST_LAYER_TEST_COMMON_H_ | 5 #ifndef CC_TEST_LAYER_TEST_COMMON_H_ |
| 6 #define CC_TEST_LAYER_TEST_COMMON_H_ | 6 #define CC_TEST_LAYER_TEST_COMMON_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 T* ptr = layer.get(); | 72 T* ptr = layer.get(); |
| 73 parent->AddChild(std::move(layer)); | 73 parent->AddChild(std::move(layer)); |
| 74 return ptr; | 74 return ptr; |
| 75 } | 75 } |
| 76 | 76 |
| 77 template <typename T> | 77 template <typename T> |
| 78 T* AddReplicaLayer(LayerImpl* origin) { | 78 T* AddReplicaLayer(LayerImpl* origin) { |
| 79 std::unique_ptr<T> layer = | 79 std::unique_ptr<T> layer = |
| 80 T::Create(host_->host_impl()->active_tree(), layer_impl_id_++); | 80 T::Create(host_->host_impl()->active_tree(), layer_impl_id_++); |
| 81 T* ptr = layer.get(); | 81 T* ptr = layer.get(); |
| 82 origin->SetReplicaLayer(std::move(layer)); | 82 origin->test_properties()->SetReplicaLayer(std::move(layer)); |
| 83 return ptr; | 83 return ptr; |
| 84 } | 84 } |
| 85 | 85 |
| 86 template <typename T, typename A> | 86 template <typename T, typename A> |
| 87 T* AddChildToRoot(const A& a) { | 87 T* AddChildToRoot(const A& a) { |
| 88 std::unique_ptr<T> layer = | 88 std::unique_ptr<T> layer = |
| 89 T::Create(host_->host_impl()->active_tree(), layer_impl_id_++, a); | 89 T::Create(host_->host_impl()->active_tree(), layer_impl_id_++, a); |
| 90 T* ptr = layer.get(); | 90 T* ptr = layer.get(); |
| 91 root_layer()->AddChild(std::move(layer)); | 91 root_layer()->AddChild(std::move(layer)); |
| 92 return ptr; | 92 return ptr; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 std::unique_ptr<RenderPass> render_pass_; | 165 std::unique_ptr<RenderPass> render_pass_; |
| 166 scoped_refptr<AnimationTimeline> timeline_; | 166 scoped_refptr<AnimationTimeline> timeline_; |
| 167 scoped_refptr<AnimationTimeline> timeline_impl_; | 167 scoped_refptr<AnimationTimeline> timeline_impl_; |
| 168 int layer_impl_id_; | 168 int layer_impl_id_; |
| 169 }; | 169 }; |
| 170 }; | 170 }; |
| 171 | 171 |
| 172 } // namespace cc | 172 } // namespace cc |
| 173 | 173 |
| 174 #endif // CC_TEST_LAYER_TEST_COMMON_H_ | 174 #endif // CC_TEST_LAYER_TEST_COMMON_H_ |
| OLD | NEW |