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 30 matching lines...) Expand all Loading... |
41 DrawResult TestHooks::PrepareToDrawOnThread( | 41 DrawResult TestHooks::PrepareToDrawOnThread( |
42 LayerTreeHostImpl* host_impl, | 42 LayerTreeHostImpl* host_impl, |
43 LayerTreeHostImpl::FrameData* frame_data, | 43 LayerTreeHostImpl::FrameData* frame_data, |
44 DrawResult draw_result) { | 44 DrawResult draw_result) { |
45 return draw_result; | 45 return draw_result; |
46 } | 46 } |
47 | 47 |
48 void TestHooks::CreateResourceAndTileTaskWorkerPool( | 48 void TestHooks::CreateResourceAndTileTaskWorkerPool( |
49 LayerTreeHostImpl* host_impl, | 49 LayerTreeHostImpl* host_impl, |
50 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, | 50 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, |
| 51 scoped_ptr<Rasterizer>* rasterizer, |
51 scoped_ptr<ResourcePool>* resource_pool, | 52 scoped_ptr<ResourcePool>* resource_pool, |
52 scoped_ptr<ResourcePool>* staging_resource_pool) { | 53 scoped_ptr<ResourcePool>* staging_resource_pool) { |
53 host_impl->LayerTreeHostImpl::CreateResourceAndTileTaskWorkerPool( | 54 host_impl->LayerTreeHostImpl::CreateResourceAndTileTaskWorkerPool( |
54 tile_task_worker_pool, resource_pool, staging_resource_pool); | 55 tile_task_worker_pool, rasterizer, resource_pool, staging_resource_pool); |
55 } | 56 } |
56 | 57 |
57 class ExternalBeginFrameSourceForTest | 58 class ExternalBeginFrameSourceForTest |
58 : public BeginFrameSourceMixIn, | 59 : public BeginFrameSourceMixIn, |
59 public NON_EXPORTED_BASE(base::NonThreadSafe) { | 60 public NON_EXPORTED_BASE(base::NonThreadSafe) { |
60 public: | 61 public: |
61 explicit ExternalBeginFrameSourceForTest(double refresh_rate) | 62 explicit ExternalBeginFrameSourceForTest(double refresh_rate) |
62 : milliseconds_per_frame_(1000.0 / refresh_rate), | 63 : milliseconds_per_frame_(1000.0 / refresh_rate), |
63 is_ready_(false), | 64 is_ready_(false), |
64 weak_ptr_factory_(this) { | 65 weak_ptr_factory_(this) { |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 stats_instrumentation, | 207 stats_instrumentation, |
207 shared_bitmap_manager, | 208 shared_bitmap_manager, |
208 gpu_memory_buffer_manager, | 209 gpu_memory_buffer_manager, |
209 0), | 210 0), |
210 test_hooks_(test_hooks), | 211 test_hooks_(test_hooks), |
211 block_notify_ready_to_activate_for_testing_(false), | 212 block_notify_ready_to_activate_for_testing_(false), |
212 notify_ready_to_activate_was_blocked_(false) {} | 213 notify_ready_to_activate_was_blocked_(false) {} |
213 | 214 |
214 void CreateResourceAndTileTaskWorkerPool( | 215 void CreateResourceAndTileTaskWorkerPool( |
215 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, | 216 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, |
| 217 scoped_ptr<Rasterizer>* rasterizer, |
216 scoped_ptr<ResourcePool>* resource_pool, | 218 scoped_ptr<ResourcePool>* resource_pool, |
217 scoped_ptr<ResourcePool>* staging_resource_pool) override { | 219 scoped_ptr<ResourcePool>* staging_resource_pool) override { |
218 test_hooks_->CreateResourceAndTileTaskWorkerPool( | 220 test_hooks_->CreateResourceAndTileTaskWorkerPool( |
219 this, tile_task_worker_pool, resource_pool, staging_resource_pool); | 221 this, tile_task_worker_pool, rasterizer, resource_pool, |
| 222 staging_resource_pool); |
220 } | 223 } |
221 | 224 |
222 void WillBeginImplFrame(const BeginFrameArgs& args) override { | 225 void WillBeginImplFrame(const BeginFrameArgs& args) override { |
223 LayerTreeHostImpl::WillBeginImplFrame(args); | 226 LayerTreeHostImpl::WillBeginImplFrame(args); |
224 test_hooks_->WillBeginImplFrameOnThread(this, args); | 227 test_hooks_->WillBeginImplFrameOnThread(this, args); |
225 } | 228 } |
226 | 229 |
227 void BeginMainFrameAborted(bool did_handle) override { | 230 void BeginMainFrameAborted(bool did_handle) override { |
228 LayerTreeHostImpl::BeginMainFrameAborted(did_handle); | 231 LayerTreeHostImpl::BeginMainFrameAborted(did_handle); |
229 test_hooks_->BeginMainFrameAbortedOnThread(this, did_handle); | 232 test_hooks_->BeginMainFrameAbortedOnThread(this, did_handle); |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 return -1; | 829 return -1; |
827 } | 830 } |
828 | 831 |
829 void LayerTreeTest::DestroyLayerTreeHost() { | 832 void LayerTreeTest::DestroyLayerTreeHost() { |
830 if (layer_tree_host_ && layer_tree_host_->root_layer()) | 833 if (layer_tree_host_ && layer_tree_host_->root_layer()) |
831 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); | 834 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); |
832 layer_tree_host_ = nullptr; | 835 layer_tree_host_ = nullptr; |
833 } | 836 } |
834 | 837 |
835 } // namespace cc | 838 } // namespace cc |
OLD | NEW |