| 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 "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 LayerTreeHostImplClient* host_impl_client, | 110 LayerTreeHostImplClient* host_impl_client, |
| 111 TaskRunnerProvider* task_runner_provider, | 111 TaskRunnerProvider* task_runner_provider, |
| 112 TaskGraphRunner* task_graph_runner, | 112 TaskGraphRunner* task_graph_runner, |
| 113 RenderingStatsInstrumentation* stats_instrumentation) | 113 RenderingStatsInstrumentation* stats_instrumentation) |
| 114 : LayerTreeHostImpl(settings, | 114 : LayerTreeHostImpl(settings, |
| 115 host_impl_client, | 115 host_impl_client, |
| 116 task_runner_provider, | 116 task_runner_provider, |
| 117 stats_instrumentation, | 117 stats_instrumentation, |
| 118 task_graph_runner, | 118 task_graph_runner, |
| 119 AnimationHost::CreateForTesting(ThreadInstance::IMPL), | 119 AnimationHost::CreateForTesting(ThreadInstance::IMPL), |
| 120 0), | 120 0, |
| 121 nullptr), |
| 121 test_hooks_(test_hooks), | 122 test_hooks_(test_hooks), |
| 122 block_notify_ready_to_activate_for_testing_(false), | 123 block_notify_ready_to_activate_for_testing_(false), |
| 123 notify_ready_to_activate_was_blocked_(false) {} | 124 notify_ready_to_activate_was_blocked_(false) {} |
| 124 | 125 |
| 125 void CreateResourceAndRasterBufferProvider( | 126 void CreateResourceAndRasterBufferProvider( |
| 126 std::unique_ptr<RasterBufferProvider>* raster_buffer_provider, | 127 std::unique_ptr<RasterBufferProvider>* raster_buffer_provider, |
| 127 std::unique_ptr<ResourcePool>* resource_pool) override { | 128 std::unique_ptr<ResourcePool>* resource_pool) override { |
| 128 test_hooks_->CreateResourceAndRasterBufferProvider( | 129 test_hooks_->CreateResourceAndRasterBufferProvider( |
| 129 this, raster_buffer_provider, resource_pool); | 130 this, raster_buffer_provider, resource_pool); |
| 130 } | 131 } |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 TaskGraphRunner* task_graph_runner, | 345 TaskGraphRunner* task_graph_runner, |
| 345 const LayerTreeSettings& settings, | 346 const LayerTreeSettings& settings, |
| 346 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 347 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 347 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, | 348 scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, |
| 348 MutatorHost* mutator_host) { | 349 MutatorHost* mutator_host) { |
| 349 LayerTreeHostInProcess::InitParams params; | 350 LayerTreeHostInProcess::InitParams params; |
| 350 params.client = client; | 351 params.client = client; |
| 351 params.task_graph_runner = task_graph_runner; | 352 params.task_graph_runner = task_graph_runner; |
| 352 params.settings = &settings; | 353 params.settings = &settings; |
| 353 params.mutator_host = mutator_host; | 354 params.mutator_host = mutator_host; |
| 355 params.image_worker_task_runner = nullptr; |
| 354 | 356 |
| 355 std::unique_ptr<LayerTreeHostForTesting> layer_tree_host( | 357 std::unique_ptr<LayerTreeHostForTesting> layer_tree_host( |
| 356 new LayerTreeHostForTesting(test_hooks, ¶ms, mode)); | 358 new LayerTreeHostForTesting(test_hooks, ¶ms, mode)); |
| 357 std::unique_ptr<TaskRunnerProvider> task_runner_provider = | 359 std::unique_ptr<TaskRunnerProvider> task_runner_provider = |
| 358 TaskRunnerProvider::Create(main_task_runner, impl_task_runner); | 360 TaskRunnerProvider::Create(main_task_runner, impl_task_runner); |
| 359 std::unique_ptr<Proxy> proxy; | 361 std::unique_ptr<Proxy> proxy; |
| 360 switch (mode) { | 362 switch (mode) { |
| 361 case CompositorMode::SINGLE_THREADED: | 363 case CompositorMode::SINGLE_THREADED: |
| 362 proxy = SingleThreadProxy::Create(layer_tree_host.get(), | 364 proxy = SingleThreadProxy::Create(layer_tree_host.get(), |
| 363 single_thread_client, | 365 single_thread_client, |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 922 DCHECK(!IsRemoteTest()); | 924 DCHECK(!IsRemoteTest()); |
| 923 return layer_tree_host_in_process_; | 925 return layer_tree_host_in_process_; |
| 924 } | 926 } |
| 925 | 927 |
| 926 Proxy* LayerTreeTest::proxy() { | 928 Proxy* LayerTreeTest::proxy() { |
| 927 return layer_tree_host_in_process() ? layer_tree_host_in_process()->proxy() | 929 return layer_tree_host_in_process() ? layer_tree_host_in_process()->proxy() |
| 928 : NULL; | 930 : NULL; |
| 929 } | 931 } |
| 930 | 932 |
| 931 } // namespace cc | 933 } // namespace cc |
| OLD | NEW |