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