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 #ifndef CC_TEST_LAYER_TREE_TEST_H_ | 5 #ifndef CC_TEST_LAYER_TREE_TEST_H_ |
6 #define CC_TEST_LAYER_TREE_TEST_H_ | 6 #define CC_TEST_LAYER_TREE_TEST_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
10 #include "cc/animation/animation_delegate.h" | 10 #include "cc/animation/animation_delegate.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 void PostCompositeImmediatelyToMainThread(); | 149 void PostCompositeImmediatelyToMainThread(); |
150 | 150 |
151 void DoBeginTest(); | 151 void DoBeginTest(); |
152 void Timeout(); | 152 void Timeout(); |
153 | 153 |
154 bool verify_property_trees() const { return verify_property_trees_; } | 154 bool verify_property_trees() const { return verify_property_trees_; } |
155 void set_verify_property_trees(bool verify_property_trees) { | 155 void set_verify_property_trees(bool verify_property_trees) { |
156 verify_property_trees_ = verify_property_trees; | 156 verify_property_trees_ = verify_property_trees; |
157 } | 157 } |
158 | 158 |
| 159 const LayerSettings& layer_settings() { return layer_settings_; } |
| 160 |
159 protected: | 161 protected: |
160 LayerTreeTest(); | 162 LayerTreeTest(); |
161 | 163 |
162 virtual void InitializeSettings(LayerTreeSettings* settings) {} | 164 virtual void InitializeSettings(LayerTreeSettings* settings) {} |
| 165 virtual void InitializeLayerSettings(LayerSettings* layer_settings) {} |
163 | 166 |
164 void RealEndTest(); | 167 void RealEndTest(); |
165 | 168 |
166 virtual void DispatchAddAnimation(Layer* layer_to_receive_animation, | 169 virtual void DispatchAddAnimation(Layer* layer_to_receive_animation, |
167 double animation_duration); | 170 double animation_duration); |
168 void DispatchSetDeferCommits(bool defer_commits); | 171 void DispatchSetDeferCommits(bool defer_commits); |
169 void DispatchSetNeedsCommit(); | 172 void DispatchSetNeedsCommit(); |
170 void DispatchSetNeedsUpdateLayers(); | 173 void DispatchSetNeedsUpdateLayers(); |
171 void DispatchSetNeedsRedraw(); | 174 void DispatchSetNeedsRedraw(); |
172 void DispatchSetNeedsRedrawRect(const gfx::Rect& damage_rect); | 175 void DispatchSetNeedsRedrawRect(const gfx::Rect& damage_rect); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 void RequestNewOutputSurface() override; | 217 void RequestNewOutputSurface() override; |
215 // Override this for pixel tests, where you need a real output surface. | 218 // Override this for pixel tests, where you need a real output surface. |
216 virtual scoped_ptr<OutputSurface> CreateOutputSurface(); | 219 virtual scoped_ptr<OutputSurface> CreateOutputSurface(); |
217 // Override this for unit tests, which should not produce pixel output. | 220 // Override this for unit tests, which should not produce pixel output. |
218 virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(); | 221 virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(); |
219 | 222 |
220 TestWebGraphicsContext3D* TestContext(); | 223 TestWebGraphicsContext3D* TestContext(); |
221 | 224 |
222 private: | 225 private: |
223 LayerTreeSettings settings_; | 226 LayerTreeSettings settings_; |
| 227 LayerSettings layer_settings_; |
| 228 |
224 scoped_ptr<LayerTreeHostClientForTesting> client_; | 229 scoped_ptr<LayerTreeHostClientForTesting> client_; |
225 scoped_ptr<LayerTreeHost> layer_tree_host_; | 230 scoped_ptr<LayerTreeHost> layer_tree_host_; |
226 FakeOutputSurface* output_surface_; | 231 FakeOutputSurface* output_surface_; |
227 FakeExternalBeginFrameSource* external_begin_frame_source_; | 232 FakeExternalBeginFrameSource* external_begin_frame_source_; |
228 | 233 |
229 bool beginning_; | 234 bool beginning_; |
230 bool end_when_begin_returns_; | 235 bool end_when_begin_returns_; |
231 bool timed_out_; | 236 bool timed_out_; |
232 bool scheduled_; | 237 bool scheduled_; |
233 bool started_; | 238 bool started_; |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ | 385 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ |
381 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) | 386 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) |
382 | 387 |
383 // Some tests want to control when notify ready for activation occurs, | 388 // Some tests want to control when notify ready for activation occurs, |
384 // but this is not supported in the single-threaded case. | 389 // but this is not supported in the single-threaded case. |
385 #define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ | 390 #define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ |
386 SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ | 391 SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ |
387 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 392 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
388 | 393 |
389 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 394 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
OLD | NEW |