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 #include "cc/test/layer_tree_test.h" | 5 #include "cc/test/layer_tree_test.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "cc/animation/animation.h" | 8 #include "cc/animation/animation.h" |
9 #include "cc/animation/animation_registrar.h" | 9 #include "cc/animation/animation_registrar.h" |
10 #include "cc/animation/layer_animation_controller.h" | 10 #include "cc/animation/layer_animation_controller.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 TestHooks::~TestHooks() {} | 41 TestHooks::~TestHooks() {} |
42 | 42 |
43 DrawResult TestHooks::PrepareToDrawOnThread( | 43 DrawResult TestHooks::PrepareToDrawOnThread( |
44 LayerTreeHostImpl* host_impl, | 44 LayerTreeHostImpl* host_impl, |
45 LayerTreeHostImpl::FrameData* frame_data, | 45 LayerTreeHostImpl::FrameData* frame_data, |
46 DrawResult draw_result) { | 46 DrawResult draw_result) { |
47 return draw_result; | 47 return draw_result; |
48 } | 48 } |
49 | 49 |
50 scoped_ptr<Rasterizer> TestHooks::CreateRasterizer( | |
51 LayerTreeHostImpl* host_impl) { | |
52 return host_impl->LayerTreeHostImpl::CreateRasterizer(); | |
53 } | |
54 | |
55 void TestHooks::CreateResourceAndTileTaskWorkerPool( | 50 void TestHooks::CreateResourceAndTileTaskWorkerPool( |
56 LayerTreeHostImpl* host_impl, | 51 LayerTreeHostImpl* host_impl, |
57 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, | 52 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, |
58 scoped_ptr<ResourcePool>* resource_pool, | 53 scoped_ptr<ResourcePool>* resource_pool, |
59 scoped_ptr<ResourcePool>* staging_resource_pool) { | 54 scoped_ptr<ResourcePool>* staging_resource_pool) { |
60 host_impl->LayerTreeHostImpl::CreateResourceAndTileTaskWorkerPool( | 55 host_impl->LayerTreeHostImpl::CreateResourceAndTileTaskWorkerPool( |
61 tile_task_worker_pool, resource_pool, staging_resource_pool); | 56 tile_task_worker_pool, resource_pool, staging_resource_pool); |
62 } | 57 } |
63 | 58 |
64 // Adapts ThreadProxy for test. Injects test hooks for testing. | 59 // Adapts ThreadProxy for test. Injects test hooks for testing. |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 proxy, | 227 proxy, |
233 stats_instrumentation, | 228 stats_instrumentation, |
234 shared_bitmap_manager, | 229 shared_bitmap_manager, |
235 gpu_memory_buffer_manager, | 230 gpu_memory_buffer_manager, |
236 task_graph_runner, | 231 task_graph_runner, |
237 0), | 232 0), |
238 test_hooks_(test_hooks), | 233 test_hooks_(test_hooks), |
239 block_notify_ready_to_activate_for_testing_(false), | 234 block_notify_ready_to_activate_for_testing_(false), |
240 notify_ready_to_activate_was_blocked_(false) {} | 235 notify_ready_to_activate_was_blocked_(false) {} |
241 | 236 |
242 scoped_ptr<Rasterizer> CreateRasterizer() override { | |
243 return test_hooks_->CreateRasterizer(this); | |
244 } | |
245 | |
246 void CreateResourceAndTileTaskWorkerPool( | 237 void CreateResourceAndTileTaskWorkerPool( |
247 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, | 238 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, |
248 scoped_ptr<ResourcePool>* resource_pool, | 239 scoped_ptr<ResourcePool>* resource_pool, |
249 scoped_ptr<ResourcePool>* staging_resource_pool) override { | 240 scoped_ptr<ResourcePool>* staging_resource_pool) override { |
250 test_hooks_->CreateResourceAndTileTaskWorkerPool( | 241 test_hooks_->CreateResourceAndTileTaskWorkerPool( |
251 this, tile_task_worker_pool, resource_pool, staging_resource_pool); | 242 this, tile_task_worker_pool, resource_pool, staging_resource_pool); |
252 } | 243 } |
253 | 244 |
254 void WillBeginImplFrame(const BeginFrameArgs& args) override { | 245 void WillBeginImplFrame(const BeginFrameArgs& args) override { |
255 LayerTreeHostImpl::WillBeginImplFrame(args); | 246 LayerTreeHostImpl::WillBeginImplFrame(args); |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 LayerTreeHost* LayerTreeTest::layer_tree_host() { | 881 LayerTreeHost* LayerTreeTest::layer_tree_host() { |
891 // We check for a null proxy here as we sometimes ask for the layer tree host | 882 // We check for a null proxy here as we sometimes ask for the layer tree host |
892 // when the proxy does not exist, often for checking settings after a test has | 883 // when the proxy does not exist, often for checking settings after a test has |
893 // completed. For example, LTHPixelResourceTest::RunPixelResourceTest. See | 884 // completed. For example, LTHPixelResourceTest::RunPixelResourceTest. See |
894 // elsewhere in this file for other examples. | 885 // elsewhere in this file for other examples. |
895 DCHECK(!proxy() || proxy()->IsMainThread() || proxy()->IsMainThreadBlocked()); | 886 DCHECK(!proxy() || proxy()->IsMainThread() || proxy()->IsMainThreadBlocked()); |
896 return layer_tree_host_.get(); | 887 return layer_tree_host_.get(); |
897 } | 888 } |
898 | 889 |
899 } // namespace cc | 890 } // namespace cc |
OLD | NEW |