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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
246 | 246 |
247 virtual void AfterTest() = 0; | 247 virtual void AfterTest() = 0; |
248 virtual void WillBeginTest(); | 248 virtual void WillBeginTest(); |
249 virtual void BeginTest() = 0; | 249 virtual void BeginTest() = 0; |
250 virtual void SetupTree(); | 250 virtual void SetupTree(); |
251 | 251 |
252 virtual void RunTest(bool threaded, bool delegating_renderer); | 252 virtual void RunTest(bool threaded, bool delegating_renderer); |
253 | 253 |
254 bool HasImplThread() { return !!impl_thread_; } | 254 bool HasImplThread() { return !!impl_thread_; } |
255 base::SingleThreadTaskRunner* ImplThreadTaskRunner() { | 255 base::SingleThreadTaskRunner* ImplThreadTaskRunner() { |
256 DCHECK(proxy()); | 256 DCHECK(task_runner_provider()); |
257 return proxy()->ImplThreadTaskRunner() ? proxy()->ImplThreadTaskRunner() | 257 return task_runner_provider()->ImplThreadTaskRunner() |
vmpstr
2015/11/10 21:59:34
save it into a temporary impl_thread_task_runner,
Khushal
2015/11/10 23:34:03
Done.
| |
258 : main_task_runner_.get(); | 258 ? task_runner_provider()->ImplThreadTaskRunner() |
259 : main_task_runner_.get(); | |
259 } | 260 } |
260 base::SingleThreadTaskRunner* MainThreadTaskRunner() { | 261 base::SingleThreadTaskRunner* MainThreadTaskRunner() { |
261 return main_task_runner_.get(); | 262 return main_task_runner_.get(); |
262 } | 263 } |
263 Proxy* proxy() const { | 264 Proxy* proxy() const { |
264 return layer_tree_host_ ? layer_tree_host_->proxy() : NULL; | 265 return layer_tree_host_ ? layer_tree_host_->proxy() : NULL; |
265 } | 266 } |
267 TaskRunnerProvider* task_runner_provider() const { | |
268 return layer_tree_host_ ? layer_tree_host_->task_runner_provider() | |
269 : nullptr; | |
270 } | |
266 TaskGraphRunner* task_graph_runner() const { | 271 TaskGraphRunner* task_graph_runner() const { |
267 return task_graph_runner_.get(); | 272 return task_graph_runner_.get(); |
268 } | 273 } |
269 | 274 |
270 bool TestEnded() const { return ended_; } | 275 bool TestEnded() const { return ended_; } |
271 | 276 |
272 LayerTreeHost* layer_tree_host(); | 277 LayerTreeHost* layer_tree_host(); |
273 bool delegating_renderer() const { return delegating_renderer_; } | 278 bool delegating_renderer() const { return delegating_renderer_; } |
274 FakeOutputSurface* output_surface() { return output_surface_; } | 279 FakeOutputSurface* output_surface() { return output_surface_; } |
275 int LastCommittedSourceFrameNumber(LayerTreeHostImpl* impl) const; | 280 int LastCommittedSourceFrameNumber(LayerTreeHostImpl* impl) const; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
365 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ | 370 #define SINGLE_AND_MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) \ |
366 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ | 371 SINGLE_AND_MULTI_THREAD_DIRECT_RENDERER_TEST_F(TEST_FIXTURE_NAME); \ |
367 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) | 372 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F(TEST_FIXTURE_NAME) |
368 | 373 |
369 // Some tests want to control when notify ready for activation occurs, | 374 // Some tests want to control when notify ready for activation occurs, |
370 // but this is not supported in the single-threaded case. | 375 // but this is not supported in the single-threaded case. |
371 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ | 376 #define MULTI_THREAD_BLOCKNOTIFY_TEST_F(TEST_FIXTURE_NAME) \ |
372 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) | 377 MULTI_THREAD_TEST_F(TEST_FIXTURE_NAME) |
373 | 378 |
374 #endif // CC_TEST_LAYER_TREE_TEST_H_ | 379 #endif // CC_TEST_LAYER_TREE_TEST_H_ |
OLD | NEW |