| 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 18 matching lines...) Expand all Loading... |
| 29 #include "cc/test/test_compositor_frame_sink.h" | 29 #include "cc/test/test_compositor_frame_sink.h" |
| 30 #include "cc/test/test_context_provider.h" | 30 #include "cc/test/test_context_provider.h" |
| 31 #include "cc/test/test_shared_bitmap_manager.h" | 31 #include "cc/test/test_shared_bitmap_manager.h" |
| 32 #include "cc/trees/layer_tree_host_client.h" | 32 #include "cc/trees/layer_tree_host_client.h" |
| 33 #include "cc/trees/layer_tree_host_impl.h" | 33 #include "cc/trees/layer_tree_host_impl.h" |
| 34 #include "cc/trees/layer_tree_host_single_thread_client.h" | 34 #include "cc/trees/layer_tree_host_single_thread_client.h" |
| 35 #include "cc/trees/layer_tree_impl.h" | 35 #include "cc/trees/layer_tree_impl.h" |
| 36 #include "cc/trees/proxy_impl.h" | 36 #include "cc/trees/proxy_impl.h" |
| 37 #include "cc/trees/proxy_main.h" | 37 #include "cc/trees/proxy_main.h" |
| 38 #include "cc/trees/single_thread_proxy.h" | 38 #include "cc/trees/single_thread_proxy.h" |
| 39 #include "cc/trees/threaded_channel.h" | |
| 40 #include "testing/gmock/include/gmock/gmock.h" | 39 #include "testing/gmock/include/gmock/gmock.h" |
| 41 #include "ui/gfx/geometry/size_conversions.h" | 40 #include "ui/gfx/geometry/size_conversions.h" |
| 42 | 41 |
| 43 namespace cc { | 42 namespace cc { |
| 44 | 43 |
| 45 void CreateVirtualViewportLayers(Layer* root_layer, | 44 void CreateVirtualViewportLayers(Layer* root_layer, |
| 46 scoped_refptr<Layer> outer_scroll_layer, | 45 scoped_refptr<Layer> outer_scroll_layer, |
| 47 const gfx::Size& inner_bounds, | 46 const gfx::Size& inner_bounds, |
| 48 const gfx::Size& outer_bounds, | 47 const gfx::Size& outer_bounds, |
| 49 LayerTreeHost* host) { | 48 LayerTreeHost* host) { |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 TaskRunnerProvider::Create(main_task_runner, impl_task_runner); | 359 TaskRunnerProvider::Create(main_task_runner, impl_task_runner); |
| 361 std::unique_ptr<Proxy> proxy; | 360 std::unique_ptr<Proxy> proxy; |
| 362 switch (mode) { | 361 switch (mode) { |
| 363 case CompositorMode::SINGLE_THREADED: | 362 case CompositorMode::SINGLE_THREADED: |
| 364 proxy = SingleThreadProxy::Create(layer_tree_host.get(), | 363 proxy = SingleThreadProxy::Create(layer_tree_host.get(), |
| 365 single_thread_client, | 364 single_thread_client, |
| 366 task_runner_provider.get()); | 365 task_runner_provider.get()); |
| 367 break; | 366 break; |
| 368 case CompositorMode::THREADED: | 367 case CompositorMode::THREADED: |
| 369 DCHECK(impl_task_runner.get()); | 368 DCHECK(impl_task_runner.get()); |
| 370 proxy = ProxyMain::CreateThreaded(layer_tree_host.get(), | 369 proxy = base::MakeUnique<ProxyMain>(layer_tree_host.get(), |
| 371 task_runner_provider.get()); | 370 task_runner_provider.get()); |
| 372 break; | 371 break; |
| 373 case CompositorMode::REMOTE: | 372 case CompositorMode::REMOTE: |
| 374 NOTREACHED(); | 373 NOTREACHED(); |
| 375 } | 374 } |
| 376 layer_tree_host->InitializeForTesting(std::move(task_runner_provider), | 375 layer_tree_host->InitializeForTesting(std::move(task_runner_provider), |
| 377 std::move(proxy)); | 376 std::move(proxy)); |
| 378 return layer_tree_host; | 377 return layer_tree_host; |
| 379 } | 378 } |
| 380 | 379 |
| 381 std::unique_ptr<LayerTreeHostImpl> CreateLayerTreeHostImpl( | 380 std::unique_ptr<LayerTreeHostImpl> CreateLayerTreeHostImpl( |
| (...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 924 DCHECK(!IsRemoteTest()); | 923 DCHECK(!IsRemoteTest()); |
| 925 return layer_tree_host_in_process_; | 924 return layer_tree_host_in_process_; |
| 926 } | 925 } |
| 927 | 926 |
| 928 Proxy* LayerTreeTest::proxy() { | 927 Proxy* LayerTreeTest::proxy() { |
| 929 return layer_tree_host_in_process() ? layer_tree_host_in_process()->proxy() | 928 return layer_tree_host_in_process() ? layer_tree_host_in_process()->proxy() |
| 930 : NULL; | 929 : NULL; |
| 931 } | 930 } |
| 932 | 931 |
| 933 } // namespace cc | 932 } // namespace cc |
| OLD | NEW |