| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 virtual void WillBeginMainFrame() {} | 64 virtual void WillBeginMainFrame() {} |
| 65 virtual void DidBeginMainFrame() {} | 65 virtual void DidBeginMainFrame() {} |
| 66 virtual void Layout() {} | 66 virtual void Layout() {} |
| 67 virtual void DidInitializeOutputSurface() {} | 67 virtual void DidInitializeOutputSurface() {} |
| 68 virtual void DidFailToInitializeOutputSurface() {} | 68 virtual void DidFailToInitializeOutputSurface() {} |
| 69 virtual void DidAddAnimation() {} | 69 virtual void DidAddAnimation() {} |
| 70 virtual void WillCommit() {} | 70 virtual void WillCommit() {} |
| 71 virtual void DidCommit() {} | 71 virtual void DidCommit() {} |
| 72 virtual void DidCommitAndDrawFrame() {} | 72 virtual void DidCommitAndDrawFrame() {} |
| 73 virtual void DidCompleteSwapBuffers() {} | 73 virtual void DidCompleteSwapBuffers() {} |
| 74 virtual void ScheduleComposite() {} | |
| 75 virtual void ScheduleAnimation() {} | |
| 76 virtual void DidDeferCommit() {} | 74 virtual void DidDeferCommit() {} |
| 77 virtual void DidSetVisibleOnImplTree(LayerTreeHostImpl* host_impl, | 75 virtual void DidSetVisibleOnImplTree(LayerTreeHostImpl* host_impl, |
| 78 bool visible) {} | 76 bool visible) {} |
| 79 virtual base::TimeDelta LowFrequencyAnimationInterval() const; | 77 virtual base::TimeDelta LowFrequencyAnimationInterval() const; |
| 80 | 78 |
| 81 // Hooks for SchedulerClient. | 79 // Hooks for SchedulerClient. |
| 82 virtual void ScheduledActionBeginOutputSurfaceCreation() {} | 80 virtual void ScheduledActionBeginOutputSurfaceCreation() {} |
| 83 virtual void ScheduledActionWillSendBeginMainFrame() {} | 81 virtual void ScheduledActionWillSendBeginMainFrame() {} |
| 84 virtual void ScheduledActionSendBeginMainFrame() {} | 82 virtual void ScheduledActionSendBeginMainFrame() {} |
| 85 virtual void ScheduledActionCommit() {} | 83 virtual void ScheduledActionCommit() {} |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 void PostSetNextCommitForcesRedrawToMainThread(); | 129 void PostSetNextCommitForcesRedrawToMainThread(); |
| 132 | 130 |
| 133 void DoBeginTest(); | 131 void DoBeginTest(); |
| 134 void Timeout(); | 132 void Timeout(); |
| 135 | 133 |
| 136 protected: | 134 protected: |
| 137 LayerTreeTest(); | 135 LayerTreeTest(); |
| 138 | 136 |
| 139 virtual void InitializeSettings(LayerTreeSettings* settings) {} | 137 virtual void InitializeSettings(LayerTreeSettings* settings) {} |
| 140 | 138 |
| 141 virtual void ScheduleComposite() OVERRIDE; | |
| 142 | |
| 143 void RealEndTest(); | 139 void RealEndTest(); |
| 144 | 140 |
| 145 virtual void DispatchAddAnimation(Layer* layer_to_receive_animation, | 141 virtual void DispatchAddAnimation(Layer* layer_to_receive_animation, |
| 146 double animation_duration); | 142 double animation_duration); |
| 147 void DispatchSetNeedsCommit(); | 143 void DispatchSetNeedsCommit(); |
| 148 void DispatchSetNeedsUpdateLayers(); | 144 void DispatchSetNeedsUpdateLayers(); |
| 149 void DispatchSetNeedsRedraw(); | 145 void DispatchSetNeedsRedraw(); |
| 150 void DispatchSetNeedsRedrawRect(const gfx::Rect& damage_rect); | 146 void DispatchSetNeedsRedrawRect(const gfx::Rect& damage_rect); |
| 151 void DispatchSetVisible(bool visible); | 147 void DispatchSetVisible(bool visible); |
| 152 void DispatchSetNextCommitForcesRedraw(); | 148 void DispatchSetNextCommitForcesRedraw(); |
| 153 void DispatchComposite(); | |
| 154 void DispatchDidAddAnimation(); | 149 void DispatchDidAddAnimation(); |
| 155 | 150 |
| 156 virtual void AfterTest() = 0; | 151 virtual void AfterTest() = 0; |
| 157 virtual void WillBeginTest(); | 152 virtual void WillBeginTest(); |
| 158 virtual void BeginTest() = 0; | 153 virtual void BeginTest() = 0; |
| 159 virtual void SetupTree(); | 154 virtual void SetupTree(); |
| 160 | 155 |
| 161 virtual void RunTest(bool threaded, | 156 virtual void RunTest(bool threaded, |
| 162 bool delegating_renderer, | 157 bool delegating_renderer, |
| 163 bool impl_side_painting); | 158 bool impl_side_painting); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 private: | 191 private: |
| 197 LayerTreeSettings settings_; | 192 LayerTreeSettings settings_; |
| 198 scoped_ptr<LayerTreeHostClientForTesting> client_; | 193 scoped_ptr<LayerTreeHostClientForTesting> client_; |
| 199 scoped_ptr<LayerTreeHost> layer_tree_host_; | 194 scoped_ptr<LayerTreeHost> layer_tree_host_; |
| 200 FakeOutputSurface* output_surface_; | 195 FakeOutputSurface* output_surface_; |
| 201 | 196 |
| 202 bool beginning_; | 197 bool beginning_; |
| 203 bool end_when_begin_returns_; | 198 bool end_when_begin_returns_; |
| 204 bool timed_out_; | 199 bool timed_out_; |
| 205 bool scheduled_; | 200 bool scheduled_; |
| 206 bool schedule_when_set_visible_true_; | |
| 207 bool started_; | 201 bool started_; |
| 208 bool ended_; | 202 bool ended_; |
| 209 bool delegating_renderer_; | 203 bool delegating_renderer_; |
| 210 | 204 |
| 211 int timeout_seconds_; | 205 int timeout_seconds_; |
| 212 | 206 |
| 213 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 207 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
| 214 scoped_ptr<base::Thread> impl_thread_; | 208 scoped_ptr<base::Thread> impl_thread_; |
| 215 base::CancelableClosure timeout_; | 209 base::CancelableClosure timeout_; |
| 216 scoped_refptr<TestContextProvider> compositor_contexts_; | 210 scoped_refptr<TestContextProvider> compositor_contexts_; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 | 283 |
| 290 #define SINGLE_AND_MULTI_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME) \ | 284 #define SINGLE_AND_MULTI_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME) \ |
| 291 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ | 285 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ |
| 292 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME) | 286 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME) |
| 293 | 287 |
| 294 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 288 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
| 295 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ | 289 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ |
| 296 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) | 290 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) |
| 297 | 291 |
| 298 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 292 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
| OLD | NEW |