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 27 matching lines...) Expand all Loading... |
38 | 38 |
39 TestHooks::~TestHooks() {} | 39 TestHooks::~TestHooks() {} |
40 | 40 |
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::CreateResourceAndRasterWorkerPool( | 48 void TestHooks::CreateResourceAndTileTaskWorkerPool( |
49 LayerTreeHostImpl* host_impl, | 49 LayerTreeHostImpl* host_impl, |
50 scoped_ptr<RasterWorkerPool>* raster_worker_pool, | 50 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, |
51 scoped_ptr<ResourcePool>* resource_pool, | 51 scoped_ptr<ResourcePool>* resource_pool, |
52 scoped_ptr<ResourcePool>* staging_resource_pool) { | 52 scoped_ptr<ResourcePool>* staging_resource_pool) { |
53 host_impl->LayerTreeHostImpl::CreateResourceAndRasterWorkerPool( | 53 host_impl->LayerTreeHostImpl::CreateResourceAndTileTaskWorkerPool( |
54 raster_worker_pool, resource_pool, staging_resource_pool); | 54 tile_task_worker_pool, resource_pool, staging_resource_pool); |
55 } | 55 } |
56 | 56 |
57 class ExternalBeginFrameSourceForTest | 57 class ExternalBeginFrameSourceForTest |
58 : public BeginFrameSourceMixIn, | 58 : public BeginFrameSourceMixIn, |
59 public NON_EXPORTED_BASE(base::NonThreadSafe) { | 59 public NON_EXPORTED_BASE(base::NonThreadSafe) { |
60 public: | 60 public: |
61 explicit ExternalBeginFrameSourceForTest(double refresh_rate) | 61 explicit ExternalBeginFrameSourceForTest(double refresh_rate) |
62 : milliseconds_per_frame_(1000.0 / refresh_rate), | 62 : milliseconds_per_frame_(1000.0 / refresh_rate), |
63 is_ready_(false), | 63 is_ready_(false), |
64 weak_ptr_factory_(this) { | 64 weak_ptr_factory_(this) { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 host_impl_client, | 204 host_impl_client, |
205 proxy, | 205 proxy, |
206 stats_instrumentation, | 206 stats_instrumentation, |
207 shared_bitmap_manager, | 207 shared_bitmap_manager, |
208 gpu_memory_buffer_manager, | 208 gpu_memory_buffer_manager, |
209 0), | 209 0), |
210 test_hooks_(test_hooks), | 210 test_hooks_(test_hooks), |
211 block_notify_ready_to_activate_for_testing_(false), | 211 block_notify_ready_to_activate_for_testing_(false), |
212 notify_ready_to_activate_was_blocked_(false) {} | 212 notify_ready_to_activate_was_blocked_(false) {} |
213 | 213 |
214 void CreateResourceAndRasterWorkerPool( | 214 void CreateResourceAndTileTaskWorkerPool( |
215 scoped_ptr<RasterWorkerPool>* raster_worker_pool, | 215 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, |
216 scoped_ptr<ResourcePool>* resource_pool, | 216 scoped_ptr<ResourcePool>* resource_pool, |
217 scoped_ptr<ResourcePool>* staging_resource_pool) override { | 217 scoped_ptr<ResourcePool>* staging_resource_pool) override { |
218 test_hooks_->CreateResourceAndRasterWorkerPool( | 218 test_hooks_->CreateResourceAndTileTaskWorkerPool( |
219 this, raster_worker_pool, resource_pool, staging_resource_pool); | 219 this, tile_task_worker_pool, resource_pool, staging_resource_pool); |
220 } | 220 } |
221 | 221 |
222 void WillBeginImplFrame(const BeginFrameArgs& args) override { | 222 void WillBeginImplFrame(const BeginFrameArgs& args) override { |
223 LayerTreeHostImpl::WillBeginImplFrame(args); | 223 LayerTreeHostImpl::WillBeginImplFrame(args); |
224 test_hooks_->WillBeginImplFrameOnThread(this, args); | 224 test_hooks_->WillBeginImplFrameOnThread(this, args); |
225 } | 225 } |
226 | 226 |
227 void BeginMainFrameAborted(bool did_handle) override { | 227 void BeginMainFrameAborted(bool did_handle) override { |
228 LayerTreeHostImpl::BeginMainFrameAborted(did_handle); | 228 LayerTreeHostImpl::BeginMainFrameAborted(did_handle); |
229 test_hooks_->BeginMainFrameAbortedOnThread(this, did_handle); | 229 test_hooks_->BeginMainFrameAbortedOnThread(this, did_handle); |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 return -1; | 829 return -1; |
830 } | 830 } |
831 | 831 |
832 void LayerTreeTest::DestroyLayerTreeHost() { | 832 void LayerTreeTest::DestroyLayerTreeHost() { |
833 if (layer_tree_host_ && layer_tree_host_->root_layer()) | 833 if (layer_tree_host_ && layer_tree_host_->root_layer()) |
834 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); | 834 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); |
835 layer_tree_host_ = nullptr; | 835 layer_tree_host_ = nullptr; |
836 } | 836 } |
837 | 837 |
838 } // namespace cc | 838 } // namespace cc |
OLD | NEW |