| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 95 |
| 96 template <typename T, typename A, typename B> | 96 template <typename T, typename A, typename B> |
| 97 T* AddChildToRoot(const A& a, const B& b) { | 97 T* AddChildToRoot(const A& a, const B& b) { |
| 98 std::unique_ptr<T> layer = | 98 std::unique_ptr<T> layer = |
| 99 T::Create(host_->host_impl()->active_tree(), layer_impl_id_++, a, b); | 99 T::Create(host_->host_impl()->active_tree(), layer_impl_id_++, a, b); |
| 100 T* ptr = layer.get(); | 100 T* ptr = layer.get(); |
| 101 root_layer_for_testing()->test_properties()->AddChild(std::move(layer)); | 101 root_layer_for_testing()->test_properties()->AddChild(std::move(layer)); |
| 102 return ptr; | 102 return ptr; |
| 103 } | 103 } |
| 104 | 104 |
| 105 template <typename T, typename A, typename B, typename C> |
| 106 T* AddChildToRoot(const A& a, const B& b, const C& c) { |
| 107 std::unique_ptr<T> layer = T::Create(host_->host_impl()->active_tree(), |
| 108 layer_impl_id_++, a, b, c); |
| 109 T* ptr = layer.get(); |
| 110 root_layer_for_testing()->test_properties()->AddChild(std::move(layer)); |
| 111 return ptr; |
| 112 } |
| 113 |
| 105 template <typename T, typename A, typename B, typename C, typename D> | 114 template <typename T, typename A, typename B, typename C, typename D> |
| 106 T* AddChildToRoot(const A& a, const B& b, const C& c, const D& d) { | 115 T* AddChildToRoot(const A& a, const B& b, const C& c, const D& d) { |
| 107 std::unique_ptr<T> layer = T::Create(host_->host_impl()->active_tree(), | 116 std::unique_ptr<T> layer = T::Create(host_->host_impl()->active_tree(), |
| 108 layer_impl_id_++, a, b, c, d); | 117 layer_impl_id_++, a, b, c, d); |
| 109 T* ptr = layer.get(); | 118 T* ptr = layer.get(); |
| 110 root_layer_for_testing()->test_properties()->AddChild(std::move(layer)); | 119 root_layer_for_testing()->test_properties()->AddChild(std::move(layer)); |
| 111 return ptr; | 120 return ptr; |
| 112 } | 121 } |
| 113 | 122 |
| 114 template <typename T, | 123 template <typename T, |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 std::unique_ptr<RenderPass> render_pass_; | 179 std::unique_ptr<RenderPass> render_pass_; |
| 171 scoped_refptr<AnimationTimeline> timeline_; | 180 scoped_refptr<AnimationTimeline> timeline_; |
| 172 scoped_refptr<AnimationTimeline> timeline_impl_; | 181 scoped_refptr<AnimationTimeline> timeline_impl_; |
| 173 int layer_impl_id_; | 182 int layer_impl_id_; |
| 174 }; | 183 }; |
| 175 }; | 184 }; |
| 176 | 185 |
| 177 } // namespace cc | 186 } // namespace cc |
| 178 | 187 |
| 179 #endif // CC_TEST_LAYER_TEST_COMMON_H_ | 188 #endif // CC_TEST_LAYER_TEST_COMMON_H_ |
| OLD | NEW |