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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 virtual void ScheduleComposite() {} | 91 virtual void ScheduleComposite() {} |
92 virtual void SendBeginFramesToChildren(const BeginFrameArgs& args) {} | 92 virtual void SendBeginFramesToChildren(const BeginFrameArgs& args) {} |
93 | 93 |
94 // Hooks for SchedulerClient. | 94 // Hooks for SchedulerClient. |
95 virtual void ScheduledActionWillSendBeginMainFrame() {} | 95 virtual void ScheduledActionWillSendBeginMainFrame() {} |
96 virtual void ScheduledActionSendBeginMainFrame() {} | 96 virtual void ScheduledActionSendBeginMainFrame() {} |
97 virtual void ScheduledActionDrawAndSwapIfPossible() {} | 97 virtual void ScheduledActionDrawAndSwapIfPossible() {} |
98 virtual void ScheduledActionAnimate() {} | 98 virtual void ScheduledActionAnimate() {} |
99 virtual void ScheduledActionCommit() {} | 99 virtual void ScheduledActionCommit() {} |
100 virtual void ScheduledActionBeginOutputSurfaceCreation() {} | 100 virtual void ScheduledActionBeginOutputSurfaceCreation() {} |
| 101 virtual void ScheduledActionManageTiles() {} |
101 | 102 |
102 // Implementation of AnimationDelegate: | 103 // Implementation of AnimationDelegate: |
103 void NotifyAnimationStarted(base::TimeTicks monotonic_time, | 104 void NotifyAnimationStarted(base::TimeTicks monotonic_time, |
104 Animation::TargetProperty target_property, | 105 Animation::TargetProperty target_property, |
105 int group) override {} | 106 int group) override {} |
106 void NotifyAnimationFinished(base::TimeTicks monotonic_time, | 107 void NotifyAnimationFinished(base::TimeTicks monotonic_time, |
107 Animation::TargetProperty target_property, | 108 Animation::TargetProperty target_property, |
108 int group) override {} | 109 int group) override {} |
109 | 110 |
110 virtual void RequestNewOutputSurface(bool fallback) = 0; | 111 virtual void RequestNewOutputSurface(bool fallback) = 0; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 169 |
169 virtual void AfterTest() = 0; | 170 virtual void AfterTest() = 0; |
170 virtual void WillBeginTest(); | 171 virtual void WillBeginTest(); |
171 virtual void BeginTest() = 0; | 172 virtual void BeginTest() = 0; |
172 virtual void SetupTree(); | 173 virtual void SetupTree(); |
173 | 174 |
174 virtual void RunTest(bool threaded, | 175 virtual void RunTest(bool threaded, |
175 bool delegating_renderer, | 176 bool delegating_renderer, |
176 bool impl_side_painting); | 177 bool impl_side_painting); |
177 virtual void RunTestWithImplSidePainting(); | 178 virtual void RunTestWithImplSidePainting(); |
| 179 virtual void RunTestWithMainThreadLowLatency(); |
178 | 180 |
179 bool HasImplThread() { return proxy() ? proxy()->HasImplThread() : false; } | 181 bool HasImplThread() { return proxy() ? proxy()->HasImplThread() : false; } |
180 base::SingleThreadTaskRunner* ImplThreadTaskRunner() { | 182 base::SingleThreadTaskRunner* ImplThreadTaskRunner() { |
181 DCHECK(proxy()); | 183 DCHECK(proxy()); |
182 return proxy()->ImplThreadTaskRunner() ? proxy()->ImplThreadTaskRunner() | 184 return proxy()->ImplThreadTaskRunner() ? proxy()->ImplThreadTaskRunner() |
183 : main_task_runner_.get(); | 185 : main_task_runner_.get(); |
184 } | 186 } |
185 base::SingleThreadTaskRunner* MainThreadTaskRunner() { | 187 base::SingleThreadTaskRunner* MainThreadTaskRunner() { |
186 return main_task_runner_.get(); | 188 return main_task_runner_.get(); |
187 } | 189 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 230 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
229 scoped_ptr<base::Thread> impl_thread_; | 231 scoped_ptr<base::Thread> impl_thread_; |
230 base::CancelableClosure timeout_; | 232 base::CancelableClosure timeout_; |
231 scoped_refptr<TestContextProvider> compositor_contexts_; | 233 scoped_refptr<TestContextProvider> compositor_contexts_; |
232 base::WeakPtr<LayerTreeTest> main_thread_weak_ptr_; | 234 base::WeakPtr<LayerTreeTest> main_thread_weak_ptr_; |
233 base::WeakPtrFactory<LayerTreeTest> weak_factory_; | 235 base::WeakPtrFactory<LayerTreeTest> weak_factory_; |
234 }; | 236 }; |
235 | 237 |
236 } // namespace cc | 238 } // namespace cc |
237 | 239 |
| 240 #define SINGLE_THREAD_DIRECT_RENDERER_NOIMPL_MAIN_THREAD_LOW_LATENCY_TEST_F( \ |
| 241 TEST_FIXTURE_NAME) \ |
| 242 TEST_F( \ |
| 243 TEST_FIXTURE_NAME, \ |
| 244 RunSingleThread_DirectRenderer_MainThreadPaint_MainThreadLowLatency) { \ |
| 245 RunTestWithMainThreadLowLatency(); \ |
| 246 } \ |
| 247 class SingleThreadDirectNoImplLowLatencyNeedsSemicolon##TEST_FIXTURE_NAME {} |
| 248 |
238 #define SINGLE_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME) \ | 249 #define SINGLE_THREAD_DIRECT_RENDERER_NOIMPL_TEST_F(TEST_FIXTURE_NAME) \ |
| 250 SINGLE_THREAD_DIRECT_RENDERER_NOIMPL_MAIN_THREAD_LOW_LATENCY_TEST_F( \ |
| 251 TEST_FIXTURE_NAME); \ |
239 TEST_F(TEST_FIXTURE_NAME, RunSingleThread_DirectRenderer_MainThreadPaint) { \ | 252 TEST_F(TEST_FIXTURE_NAME, RunSingleThread_DirectRenderer_MainThreadPaint) { \ |
240 RunTest(false, false, false); \ | 253 RunTest(false, false, false); \ |
241 } \ | 254 } \ |
242 class SingleThreadDirectNoImplNeedsSemicolon##TEST_FIXTURE_NAME {} | 255 class SingleThreadDirectNoImplNeedsSemicolon##TEST_FIXTURE_NAME {} |
243 | 256 |
244 #define SINGLE_THREAD_DIRECT_RENDERER_IMPL_TEST_F(TEST_FIXTURE_NAME) \ | 257 #define SINGLE_THREAD_DIRECT_RENDERER_IMPL_TEST_F(TEST_FIXTURE_NAME) \ |
245 TEST_F(TEST_FIXTURE_NAME, RunSingleThread_DirectRenderer_ImplSidePaint) { \ | 258 TEST_F(TEST_FIXTURE_NAME, RunSingleThread_DirectRenderer_ImplSidePaint) { \ |
246 RunTest(false, false, true); \ | 259 RunTest(false, false, true); \ |
247 } \ | 260 } \ |
248 class SingleThreadDirectImplNeedsSemicolon##TEST_FIXTURE_NAME {} | 261 class SingleThreadDirectImplNeedsSemicolon##TEST_FIXTURE_NAME {} |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ | 378 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ |
366 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) | 379 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) |
367 | 380 |
368 // Some tests want to control when notify ready for activation occurs, | 381 // Some tests want to control when notify ready for activation occurs, |
369 // but this is not supported in the single-threaded case. | 382 // but this is not supported in the single-threaded case. |
370 #define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ | 383 #define SINGLE_AND_MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ |
371 SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ | 384 SINGLE_THREAD_NOIMPL_TEST_F(TEST_FIXTURE_NAME); \ |
372 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 385 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
373 | 386 |
374 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 387 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
OLD | NEW |