| 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 proxy, | 232 proxy, |
| 238 stats_instrumentation, | 233 stats_instrumentation, |
| 239 shared_bitmap_manager, | 234 shared_bitmap_manager, |
| 240 gpu_memory_buffer_manager, | 235 gpu_memory_buffer_manager, |
| 241 task_graph_runner, | 236 task_graph_runner, |
| 242 0), | 237 0), |
| 243 test_hooks_(test_hooks), | 238 test_hooks_(test_hooks), |
| 244 block_notify_ready_to_activate_for_testing_(false), | 239 block_notify_ready_to_activate_for_testing_(false), |
| 245 notify_ready_to_activate_was_blocked_(false) {} | 240 notify_ready_to_activate_was_blocked_(false) {} |
| 246 | 241 |
| 247 scoped_ptr<Rasterizer> CreateRasterizer() override { | |
| 248 return test_hooks_->CreateRasterizer(this); | |
| 249 } | |
| 250 | |
| 251 void CreateResourceAndTileTaskWorkerPool( | 242 void CreateResourceAndTileTaskWorkerPool( |
| 252 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, | 243 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, |
| 253 scoped_ptr<ResourcePool>* resource_pool, | 244 scoped_ptr<ResourcePool>* resource_pool, |
| 254 scoped_ptr<ResourcePool>* staging_resource_pool) override { | 245 scoped_ptr<ResourcePool>* staging_resource_pool) override { |
| 255 test_hooks_->CreateResourceAndTileTaskWorkerPool( | 246 test_hooks_->CreateResourceAndTileTaskWorkerPool( |
| 256 this, tile_task_worker_pool, resource_pool, staging_resource_pool); | 247 this, tile_task_worker_pool, resource_pool, staging_resource_pool); |
| 257 } | 248 } |
| 258 | 249 |
| 259 void WillBeginImplFrame(const BeginFrameArgs& args) override { | 250 void WillBeginImplFrame(const BeginFrameArgs& args) override { |
| 260 LayerTreeHostImpl::WillBeginImplFrame(args); | 251 LayerTreeHostImpl::WillBeginImplFrame(args); |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 LayerTreeHost* LayerTreeTest::layer_tree_host() { | 886 LayerTreeHost* LayerTreeTest::layer_tree_host() { |
| 896 // We check for a null proxy here as we sometimes ask for the layer tree host | 887 // We check for a null proxy here as we sometimes ask for the layer tree host |
| 897 // when the proxy does not exist, often for checking settings after a test has | 888 // when the proxy does not exist, often for checking settings after a test has |
| 898 // completed. For example, LTHPixelResourceTest::RunPixelResourceTest. See | 889 // completed. For example, LTHPixelResourceTest::RunPixelResourceTest. See |
| 899 // elsewhere in this file for other examples. | 890 // elsewhere in this file for other examples. |
| 900 DCHECK(!proxy() || proxy()->IsMainThread() || proxy()->IsMainThreadBlocked()); | 891 DCHECK(!proxy() || proxy()->IsMainThread() || proxy()->IsMainThreadBlocked()); |
| 901 return layer_tree_host_.get(); | 892 return layer_tree_host_.get(); |
| 902 } | 893 } |
| 903 | 894 |
| 904 } // namespace cc | 895 } // namespace cc |
| OLD | NEW |