| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 const C& c, | 135 const C& c, |
| 136 const D& d, | 136 const D& d, |
| 137 const E& e) { | 137 const E& e) { |
| 138 std::unique_ptr<T> layer = T::Create(host_->host_impl()->active_tree(), | 138 std::unique_ptr<T> layer = T::Create(host_->host_impl()->active_tree(), |
| 139 layer_impl_id_++, a, b, c, d, e); | 139 layer_impl_id_++, a, b, c, d, e); |
| 140 T* ptr = layer.get(); | 140 T* ptr = layer.get(); |
| 141 root_layer_for_testing()->test_properties()->AddChild(std::move(layer)); | 141 root_layer_for_testing()->test_properties()->AddChild(std::move(layer)); |
| 142 return ptr; | 142 return ptr; |
| 143 } | 143 } |
| 144 | 144 |
| 145 template <typename T, |
| 146 typename A, |
| 147 typename B, |
| 148 typename C, |
| 149 typename D, |
| 150 typename E> |
| 151 T* AddChild(LayerImpl* parent, |
| 152 const A& a, |
| 153 const B& b, |
| 154 const C& c, |
| 155 const D& d, |
| 156 const E& e) { |
| 157 std::unique_ptr<T> layer = T::Create(host_->host_impl()->active_tree(), |
| 158 layer_impl_id_++, a, b, c, d, e); |
| 159 T* ptr = layer.get(); |
| 160 parent->test_properties()->AddChild(std::move(layer)); |
| 161 return ptr; |
| 162 } |
| 163 |
| 145 void CalcDrawProps(const gfx::Size& viewport_size); | 164 void CalcDrawProps(const gfx::Size& viewport_size); |
| 146 void AppendQuadsWithOcclusion(LayerImpl* layer_impl, | 165 void AppendQuadsWithOcclusion(LayerImpl* layer_impl, |
| 147 const gfx::Rect& occluded); | 166 const gfx::Rect& occluded); |
| 148 void AppendQuadsForPassWithOcclusion(LayerImpl* layer_impl, | 167 void AppendQuadsForPassWithOcclusion(LayerImpl* layer_impl, |
| 149 RenderPass* given_render_pass, | 168 RenderPass* given_render_pass, |
| 150 const gfx::Rect& occluded); | 169 const gfx::Rect& occluded); |
| 151 void AppendSurfaceQuadsWithOcclusion(RenderSurfaceImpl* surface_impl, | 170 void AppendSurfaceQuadsWithOcclusion(RenderSurfaceImpl* surface_impl, |
| 152 const gfx::Rect& occluded); | 171 const gfx::Rect& occluded); |
| 153 | 172 |
| 154 void RequestCopyOfOutput(); | 173 void RequestCopyOfOutput(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 184 std::unique_ptr<RenderPass> render_pass_; | 203 std::unique_ptr<RenderPass> render_pass_; |
| 185 scoped_refptr<AnimationTimeline> timeline_; | 204 scoped_refptr<AnimationTimeline> timeline_; |
| 186 scoped_refptr<AnimationTimeline> timeline_impl_; | 205 scoped_refptr<AnimationTimeline> timeline_impl_; |
| 187 int layer_impl_id_; | 206 int layer_impl_id_; |
| 188 }; | 207 }; |
| 189 }; | 208 }; |
| 190 | 209 |
| 191 } // namespace cc | 210 } // namespace cc |
| 192 | 211 |
| 193 #endif // CC_TEST_LAYER_TEST_COMMON_H_ | 212 #endif // CC_TEST_LAYER_TEST_COMMON_H_ |
| OLD | NEW |