Index: cc/test/layer_tree_test.cc |
diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc |
index 055d0817d30466ff13be525e2b5edc9dedb5bd5a..8c6916149fc4770bac42198a863b29d10f8be206 100644 |
--- a/cc/test/layer_tree_test.cc |
+++ b/cc/test/layer_tree_test.cc |
@@ -453,32 +453,18 @@ class LayerTreeHostForTesting : public LayerTreeHost { |
static scoped_ptr<LayerTreeHostForTesting> Create( |
TestHooks* test_hooks, |
LayerTreeHostClientForTesting* client, |
- SharedBitmapManager* shared_bitmap_manager, |
- gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
- TaskGraphRunner* task_graph_runner, |
- const LayerTreeSettings& settings, |
- scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
- scoped_ptr<BeginFrameSource> external_begin_frame_source) { |
+ LayerTreeHost::InitParams* params) { |
danakj
2015/05/07 00:59:56
I think maybe I prefer passing in all the things h
sadrul
2015/05/07 04:39:25
Done.
|
scoped_ptr<LayerTreeHostForTesting> layer_tree_host( |
- new LayerTreeHostForTesting(test_hooks, client, shared_bitmap_manager, |
- gpu_memory_buffer_manager, |
- task_graph_runner, settings)); |
+ new LayerTreeHostForTesting(test_hooks, params)); |
if (impl_task_runner.get()) { |
- layer_tree_host->InitializeForTesting( |
- ThreadProxyForTest::Create(test_hooks, |
- layer_tree_host.get(), |
- main_task_runner, |
- impl_task_runner, |
- external_begin_frame_source.Pass())); |
+ layer_tree_host->InitializeForTesting(ThreadProxyForTest::Create( |
+ test_hooks, layer_tree_host.get(), params->main_task_runner, |
+ impl_task_runner, params->external_begin_frame_source.Pass())); |
} else { |
- layer_tree_host->InitializeForTesting( |
- SingleThreadProxyForTest::Create( |
- test_hooks, |
- layer_tree_host.get(), |
- client, |
- main_task_runner, |
- external_begin_frame_source.Pass())); |
+ layer_tree_host->InitializeForTesting(SingleThreadProxyForTest::Create( |
+ test_hooks, layer_tree_host.get(), client, params->main_task_runner, |
+ params->external_begin_frame_source.Pass())); |
} |
return layer_tree_host.Pass(); |
} |
@@ -500,17 +486,12 @@ class LayerTreeHostForTesting : public LayerTreeHost { |
void set_test_started(bool started) { test_started_ = started; } |
private: |
- LayerTreeHostForTesting( |
- TestHooks* test_hooks, |
- LayerTreeHostClient* client, |
- SharedBitmapManager* shared_bitmap_manager, |
- gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, |
- TaskGraphRunner* task_graph_runner, |
- const LayerTreeSettings& settings) |
- : LayerTreeHost(client, NULL, NULL, NULL, settings), |
- shared_bitmap_manager_(shared_bitmap_manager), |
- gpu_memory_buffer_manager_(gpu_memory_buffer_manager), |
- task_graph_runner_(task_graph_runner), |
+ LayerTreeHostForTesting(TestHooks* test_hooks, |
+ LayerTreeHost::InitParams* params) |
+ : LayerTreeHost(params), |
+ shared_bitmap_manager_(params->shared_bitmap_manager), |
+ gpu_memory_buffer_manager_(params->gpu_memory_buffer_manager), |
+ task_graph_runner_(params->task_graph_runner), |
test_hooks_(test_hooks), |
test_started_(false) {} |
@@ -667,12 +648,19 @@ void LayerTreeTest::DoBeginTest() { |
} |
DCHECK(!impl_thread_ || impl_thread_->task_runner().get()); |
+ LayerTreeHost::InitParams params; |
+ |
danakj
2015/05/07 00:59:56
nit: no whitespace
sadrul
2015/05/07 04:39:25
Done.
|
+ params.client = client_.get(); |
+ params.shared_bitmap_manager = shared_bitmap_manager_.get(); |
+ params.gpu_memory_buffer_manager = gpu_memory_buffer_manager_.get(); |
+ params.task_graph_runner = task_graph_runner_.get(); |
+ params.settings = &settings_; |
+ params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); |
+ params.external_begin_frame_source = external_begin_frame_source.Pass(); |
+ |
layer_tree_host_ = LayerTreeHostForTesting::Create( |
- this, client_.get(), shared_bitmap_manager_.get(), |
- gpu_memory_buffer_manager_.get(), task_graph_runner_.get(), settings_, |
- base::ThreadTaskRunnerHandle::Get(), |
- impl_thread_ ? impl_thread_->task_runner() : NULL, |
- external_begin_frame_source.Pass()); |
+ this, client_.get(), impl_thread_ ? impl_thread_->task_runner() : NULL, |
+ ¶ms); |
ASSERT_TRUE(layer_tree_host_); |
started_ = true; |