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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "cc/quads/render_pass.h" | 10 #include "cc/quads/render_pass.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 62 } |
63 | 63 |
64 template <typename T, typename A> | 64 template <typename T, typename A> |
65 T* AddChildToRoot(const A& a) { | 65 T* AddChildToRoot(const A& a) { |
66 scoped_ptr<T> layer = T::Create(host_->host_impl()->active_tree(), 2, a); | 66 scoped_ptr<T> layer = T::Create(host_->host_impl()->active_tree(), 2, a); |
67 T* ptr = layer.get(); | 67 T* ptr = layer.get(); |
68 root_layer_impl_->AddChild(layer.template PassAs<LayerImpl>()); | 68 root_layer_impl_->AddChild(layer.template PassAs<LayerImpl>()); |
69 return ptr; | 69 return ptr; |
70 } | 70 } |
71 | 71 |
| 72 template <typename T, typename A, typename B> |
| 73 T* AddChildToRoot(const A& a, const B& b) { |
| 74 scoped_ptr<T> layer = |
| 75 T::Create(host_->host_impl()->active_tree(), 2, a, b); |
| 76 T* ptr = layer.get(); |
| 77 root_layer_impl_->AddChild(layer.template PassAs<LayerImpl>()); |
| 78 return ptr; |
| 79 } |
| 80 |
72 template <typename T, typename A, typename B, typename C, typename D> | 81 template <typename T, typename A, typename B, typename C, typename D> |
73 T* AddChildToRoot(const A& a, const B& b, const C& c, const D& d) { | 82 T* AddChildToRoot(const A& a, const B& b, const C& c, const D& d) { |
74 scoped_ptr<T> layer = | 83 scoped_ptr<T> layer = |
75 T::Create(host_->host_impl()->active_tree(), 2, a, b, c, d); | 84 T::Create(host_->host_impl()->active_tree(), 2, a, b, c, d); |
76 T* ptr = layer.get(); | 85 T* ptr = layer.get(); |
77 root_layer_impl_->AddChild(layer.template PassAs<LayerImpl>()); | 86 root_layer_impl_->AddChild(layer.template PassAs<LayerImpl>()); |
78 return ptr; | 87 return ptr; |
79 } | 88 } |
80 | 89 |
81 template <typename T, | 90 template <typename T, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 scoped_ptr<FakeLayerTreeHost> host_; | 129 scoped_ptr<FakeLayerTreeHost> host_; |
121 scoped_ptr<LayerImpl> root_layer_impl_; | 130 scoped_ptr<LayerImpl> root_layer_impl_; |
122 scoped_ptr<RenderPass> render_pass_; | 131 scoped_ptr<RenderPass> render_pass_; |
123 MockOcclusionTracker<LayerImpl> occlusion_tracker_; | 132 MockOcclusionTracker<LayerImpl> occlusion_tracker_; |
124 }; | 133 }; |
125 }; | 134 }; |
126 | 135 |
127 } // namespace cc | 136 } // namespace cc |
128 | 137 |
129 #endif // CC_TEST_LAYER_TEST_COMMON_H_ | 138 #endif // CC_TEST_LAYER_TEST_COMMON_H_ |
OLD | NEW |