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