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