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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 virtual void ScheduledActionBeginOutputSurfaceCreation() {} | 85 virtual void ScheduledActionBeginOutputSurfaceCreation() {} |
86 | 86 |
87 // Implementation of AnimationDelegate: | 87 // Implementation of AnimationDelegate: |
88 virtual void NotifyAnimationStarted(base::TimeTicks monotonic_time, | 88 virtual void NotifyAnimationStarted(base::TimeTicks monotonic_time, |
89 Animation::TargetProperty target_property) | 89 Animation::TargetProperty target_property) |
90 OVERRIDE {} | 90 OVERRIDE {} |
91 virtual void NotifyAnimationFinished( | 91 virtual void NotifyAnimationFinished( |
92 base::TimeTicks monotonic_time, | 92 base::TimeTicks monotonic_time, |
93 Animation::TargetProperty target_property) OVERRIDE {} | 93 Animation::TargetProperty target_property) OVERRIDE {} |
94 | 94 |
95 virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) = 0; | 95 virtual void RequestNewOutputSurface(bool fallback) = 0; |
96 }; | 96 }; |
97 | 97 |
98 class BeginTask; | 98 class BeginTask; |
99 class LayerTreeHostClientForTesting; | 99 class LayerTreeHostClientForTesting; |
100 class TimeoutTask; | 100 class TimeoutTask; |
101 | 101 |
102 // The LayerTreeTests runs with the main loop running. It instantiates a single | 102 // The LayerTreeTests runs with the main loop running. It instantiates a single |
103 // LayerTreeHostForTesting and associated LayerTreeHostImplForTesting and | 103 // LayerTreeHostForTesting and associated LayerTreeHostImplForTesting and |
104 // LayerTreeHostClientForTesting. | 104 // LayerTreeHostClientForTesting. |
105 // | 105 // |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 174 |
175 bool TestEnded() const { return ended_; } | 175 bool TestEnded() const { return ended_; } |
176 | 176 |
177 LayerTreeHost* layer_tree_host() { return layer_tree_host_.get(); } | 177 LayerTreeHost* layer_tree_host() { return layer_tree_host_.get(); } |
178 bool delegating_renderer() const { return delegating_renderer_; } | 178 bool delegating_renderer() const { return delegating_renderer_; } |
179 FakeOutputSurface* output_surface() { return output_surface_; } | 179 FakeOutputSurface* output_surface() { return output_surface_; } |
180 int LastCommittedSourceFrameNumber(LayerTreeHostImpl* impl) const; | 180 int LastCommittedSourceFrameNumber(LayerTreeHostImpl* impl) const; |
181 | 181 |
182 void DestroyLayerTreeHost(); | 182 void DestroyLayerTreeHost(); |
183 | 183 |
| 184 // By default, output surface recreation is synchronous. |
| 185 virtual void RequestNewOutputSurface(bool fallback) OVERRIDE; |
184 // Override this for pixel tests, where you need a real output surface. | 186 // Override this for pixel tests, where you need a real output surface. |
185 virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) OVERRIDE; | 187 virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback); |
186 // Override this for unit tests, which should not produce pixel output. | 188 // Override this for unit tests, which should not produce pixel output. |
187 virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback); | 189 virtual scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface(bool fallback); |
188 | 190 |
189 TestWebGraphicsContext3D* TestContext(); | 191 TestWebGraphicsContext3D* TestContext(); |
190 | 192 |
191 | 193 |
192 private: | 194 private: |
193 LayerTreeSettings settings_; | 195 LayerTreeSettings settings_; |
194 scoped_ptr<LayerTreeHostClientForTesting> client_; | 196 scoped_ptr<LayerTreeHostClientForTesting> client_; |
195 scoped_ptr<LayerTreeHost> layer_tree_host_; | 197 scoped_ptr<LayerTreeHost> layer_tree_host_; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 | 286 |
285 #define SINGLE_AND_MULTI_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME) \ | 287 #define SINGLE_AND_MULTI_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME) \ |
286 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ | 288 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ |
287 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME) | 289 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME) |
288 | 290 |
289 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 291 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
290 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ | 292 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ |
291 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) | 293 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) |
292 | 294 |
293 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 295 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
OLD | NEW |