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 28 matching lines...) Expand all Loading... |
39 | 39 |
40 TestHooks::~TestHooks() {} | 40 TestHooks::~TestHooks() {} |
41 | 41 |
42 DrawResult TestHooks::PrepareToDrawOnThread( | 42 DrawResult TestHooks::PrepareToDrawOnThread( |
43 LayerTreeHostImpl* host_impl, | 43 LayerTreeHostImpl* host_impl, |
44 LayerTreeHostImpl::FrameData* frame_data, | 44 LayerTreeHostImpl::FrameData* frame_data, |
45 DrawResult draw_result) { | 45 DrawResult draw_result) { |
46 return draw_result; | 46 return draw_result; |
47 } | 47 } |
48 | 48 |
| 49 void TestHooks::CreateRasterizer(LayerTreeHostImpl* host_impl, |
| 50 scoped_ptr<Rasterizer>* rasterizer) { |
| 51 host_impl->LayerTreeHostImpl::CreateRasterizer(rasterizer); |
| 52 } |
| 53 |
49 void TestHooks::CreateResourceAndTileTaskWorkerPool( | 54 void TestHooks::CreateResourceAndTileTaskWorkerPool( |
50 LayerTreeHostImpl* host_impl, | 55 LayerTreeHostImpl* host_impl, |
51 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, | 56 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, |
52 scoped_ptr<ResourcePool>* resource_pool, | 57 scoped_ptr<ResourcePool>* resource_pool, |
53 scoped_ptr<ResourcePool>* staging_resource_pool) { | 58 scoped_ptr<ResourcePool>* staging_resource_pool) { |
54 host_impl->LayerTreeHostImpl::CreateResourceAndTileTaskWorkerPool( | 59 host_impl->LayerTreeHostImpl::CreateResourceAndTileTaskWorkerPool( |
55 tile_task_worker_pool, resource_pool, staging_resource_pool); | 60 tile_task_worker_pool, resource_pool, staging_resource_pool); |
56 } | 61 } |
57 | 62 |
58 // Adapts ThreadProxy for test. Injects test hooks for testing. | 63 // Adapts ThreadProxy for test. Injects test hooks for testing. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 host_impl_client, | 164 host_impl_client, |
160 proxy, | 165 proxy, |
161 stats_instrumentation, | 166 stats_instrumentation, |
162 shared_bitmap_manager, | 167 shared_bitmap_manager, |
163 gpu_memory_buffer_manager, | 168 gpu_memory_buffer_manager, |
164 0), | 169 0), |
165 test_hooks_(test_hooks), | 170 test_hooks_(test_hooks), |
166 block_notify_ready_to_activate_for_testing_(false), | 171 block_notify_ready_to_activate_for_testing_(false), |
167 notify_ready_to_activate_was_blocked_(false) {} | 172 notify_ready_to_activate_was_blocked_(false) {} |
168 | 173 |
| 174 void CreateRasterizer(scoped_ptr<Rasterizer>* rasterizer) override { |
| 175 test_hooks_->CreateRasterizer(this, rasterizer); |
| 176 } |
| 177 |
169 void CreateResourceAndTileTaskWorkerPool( | 178 void CreateResourceAndTileTaskWorkerPool( |
170 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, | 179 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, |
171 scoped_ptr<ResourcePool>* resource_pool, | 180 scoped_ptr<ResourcePool>* resource_pool, |
172 scoped_ptr<ResourcePool>* staging_resource_pool) override { | 181 scoped_ptr<ResourcePool>* staging_resource_pool) override { |
173 test_hooks_->CreateResourceAndTileTaskWorkerPool( | 182 test_hooks_->CreateResourceAndTileTaskWorkerPool( |
174 this, tile_task_worker_pool, resource_pool, staging_resource_pool); | 183 this, tile_task_worker_pool, resource_pool, staging_resource_pool); |
175 } | 184 } |
176 | 185 |
177 void WillBeginImplFrame(const BeginFrameArgs& args) override { | 186 void WillBeginImplFrame(const BeginFrameArgs& args) override { |
178 LayerTreeHostImpl::WillBeginImplFrame(args); | 187 LayerTreeHostImpl::WillBeginImplFrame(args); |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 return -1; | 792 return -1; |
784 } | 793 } |
785 | 794 |
786 void LayerTreeTest::DestroyLayerTreeHost() { | 795 void LayerTreeTest::DestroyLayerTreeHost() { |
787 if (layer_tree_host_ && layer_tree_host_->root_layer()) | 796 if (layer_tree_host_ && layer_tree_host_->root_layer()) |
788 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); | 797 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); |
789 layer_tree_host_ = nullptr; | 798 layer_tree_host_ = nullptr; |
790 } | 799 } |
791 | 800 |
792 } // namespace cc | 801 } // namespace cc |
OLD | NEW |