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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 virtual void ScheduledActionPrepareTiles() {} | 103 virtual void ScheduledActionPrepareTiles() {} |
104 | 104 |
105 // Implementation of AnimationDelegate: | 105 // Implementation of AnimationDelegate: |
106 void NotifyAnimationStarted(base::TimeTicks monotonic_time, | 106 void NotifyAnimationStarted(base::TimeTicks monotonic_time, |
107 Animation::TargetProperty target_property, | 107 Animation::TargetProperty target_property, |
108 int group) override {} | 108 int group) override {} |
109 void NotifyAnimationFinished(base::TimeTicks monotonic_time, | 109 void NotifyAnimationFinished(base::TimeTicks monotonic_time, |
110 Animation::TargetProperty target_property, | 110 Animation::TargetProperty target_property, |
111 int group) override {} | 111 int group) override {} |
112 | 112 |
113 virtual void RequestNewOutputSurface(bool fallback) = 0; | 113 virtual void RequestNewOutputSurface() = 0; |
114 }; | 114 }; |
115 | 115 |
116 class BeginTask; | 116 class BeginTask; |
117 class LayerTreeHostClientForTesting; | 117 class LayerTreeHostClientForTesting; |
118 class TimeoutTask; | 118 class TimeoutTask; |
119 | 119 |
120 // The LayerTreeTests runs with the main loop running. It instantiates a single | 120 // The LayerTreeTests runs with the main loop running. It instantiates a single |
121 // LayerTreeHostForTesting and associated LayerTreeHostImplForTesting and | 121 // LayerTreeHostForTesting and associated LayerTreeHostImplForTesting and |
122 // LayerTreeHostClientForTesting. | 122 // LayerTreeHostClientForTesting. |
123 // | 123 // |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 bool TestEnded() const { return ended_; } | 195 bool TestEnded() const { return ended_; } |
196 | 196 |
197 LayerTreeHost* layer_tree_host() { return layer_tree_host_.get(); } | 197 LayerTreeHost* layer_tree_host() { return layer_tree_host_.get(); } |
198 bool delegating_renderer() const { return delegating_renderer_; } | 198 bool delegating_renderer() const { return delegating_renderer_; } |
199 FakeOutputSurface* output_surface() { return output_surface_; } | 199 FakeOutputSurface* output_surface() { return output_surface_; } |
200 int LastCommittedSourceFrameNumber(LayerTreeHostImpl* impl) const; | 200 int LastCommittedSourceFrameNumber(LayerTreeHostImpl* impl) const; |
201 | 201 |
202 void DestroyLayerTreeHost(); | 202 void DestroyLayerTreeHost(); |
203 | 203 |
204 // By default, output surface recreation is synchronous. | 204 // By default, output surface recreation is synchronous. |
205 void RequestNewOutputSurface(bool fallback) override; | 205 void RequestNewOutputSurface() override; |
206 // Override this for pixel tests, where you need a real output surface. | 206 // Override this for pixel tests, where you need a real output surface. |
207 virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback); | 207 virtual scoped_ptr<OutputSurface> CreateOutputSurface(); |
208 // Override this for unit tests, which should not produce pixel output. | 208 // Override this for unit tests, which should not produce pixel output. |
209 virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback); | 209 virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(); |
210 | 210 |
211 TestWebGraphicsContext3D* TestContext(); | 211 TestWebGraphicsContext3D* TestContext(); |
212 | 212 |
213 | 213 |
214 private: | 214 private: |
215 LayerTreeSettings settings_; | 215 LayerTreeSettings settings_; |
216 scoped_ptr<LayerTreeHostClientForTesting> client_; | 216 scoped_ptr<LayerTreeHostClientForTesting> client_; |
217 scoped_ptr<LayerTreeHost> layer_tree_host_; | 217 scoped_ptr<LayerTreeHost> layer_tree_host_; |
218 FakeOutputSurface* output_surface_; | 218 FakeOutputSurface* output_surface_; |
219 ExternalBeginFrameSourceForTest* external_begin_frame_source_; | 219 ExternalBeginFrameSourceForTest* external_begin_frame_source_; |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ | 368 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ |
369 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) | 369 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) |
370 | 370 |
371 // Some tests want to control when notify ready for activation occurs, | 371 // Some tests want to control when notify ready for activation occurs, |
372 // but this is not supported in the single-threaded case. | 372 // but this is not supported in the single-threaded case. |
373 #define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ | 373 #define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ |
374 SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ | 374 SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ |
375 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 375 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
376 | 376 |
377 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 377 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
OLD | NEW |