| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| 11 #include "cc/animation/animation_host.h" | 11 #include "cc/animation/animation_host.h" |
| 12 #include "cc/input/main_thread_scrolling_reason.h" | 12 #include "cc/input/main_thread_scrolling_reason.h" |
| 13 #include "cc/input/scroll_elasticity_helper.h" | 13 #include "cc/input/scroll_elasticity_helper.h" |
| 14 #include "cc/layers/layer.h" | 14 #include "cc/layers/layer.h" |
| 15 #include "cc/layers/layer_impl.h" | 15 #include "cc/layers/layer_impl.h" |
| 16 #include "cc/layers/picture_layer.h" | 16 #include "cc/layers/picture_layer.h" |
| 17 #include "cc/scheduler/begin_frame_source.h" | 17 #include "cc/scheduler/begin_frame_source.h" |
| 18 #include "cc/test/fake_content_layer_client.h" | 18 #include "cc/test/fake_content_layer_client.h" |
| 19 #include "cc/test/fake_layer_tree_host_client.h" | 19 #include "cc/test/fake_layer_tree_host_client.h" |
| 20 #include "cc/test/fake_picture_layer.h" | 20 #include "cc/test/fake_picture_layer.h" |
| 21 #include "cc/test/fake_picture_layer_impl.h" | 21 #include "cc/test/fake_picture_layer_impl.h" |
| 22 #include "cc/test/geometry_test_utils.h" | 22 #include "cc/test/geometry_test_utils.h" |
| 23 #include "cc/test/layer_tree_test.h" | 23 #include "cc/test/layer_tree_test.h" |
| 24 #include "cc/test/test_shared_bitmap_manager.h" | |
| 25 #include "cc/test/test_task_graph_runner.h" | 24 #include "cc/test/test_task_graph_runner.h" |
| 26 #include "cc/trees/layer_tree_impl.h" | 25 #include "cc/trees/layer_tree_impl.h" |
| 27 #include "cc/trees/scroll_node.h" | 26 #include "cc/trees/scroll_node.h" |
| 28 #include "cc/trees/transform_node.h" | 27 #include "cc/trees/transform_node.h" |
| 29 #include "testing/gmock/include/gmock/gmock.h" | 28 #include "testing/gmock/include/gmock/gmock.h" |
| 30 #include "ui/gfx/geometry/point_conversions.h" | 29 #include "ui/gfx/geometry/point_conversions.h" |
| 31 #include "ui/gfx/geometry/size_conversions.h" | 30 #include "ui/gfx/geometry/size_conversions.h" |
| 32 #include "ui/gfx/geometry/vector2d_conversions.h" | 31 #include "ui/gfx/geometry/vector2d_conversions.h" |
| 33 | 32 |
| 34 using ::testing::Mock; | 33 using ::testing::Mock; |
| (...skipping 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1301 | 1300 |
| 1302 TEST(LayerTreeHostFlingTest, DidStopFlingingThread) { | 1301 TEST(LayerTreeHostFlingTest, DidStopFlingingThread) { |
| 1303 base::Thread impl_thread("cc"); | 1302 base::Thread impl_thread("cc"); |
| 1304 ASSERT_TRUE(impl_thread.Start()); | 1303 ASSERT_TRUE(impl_thread.Start()); |
| 1305 ASSERT_TRUE(impl_thread.task_runner()); | 1304 ASSERT_TRUE(impl_thread.task_runner()); |
| 1306 | 1305 |
| 1307 bool received_stop_flinging = false; | 1306 bool received_stop_flinging = false; |
| 1308 LayerTreeSettings settings; | 1307 LayerTreeSettings settings; |
| 1309 | 1308 |
| 1310 StubLayerTreeHostClient layer_tree_host_client; | 1309 StubLayerTreeHostClient layer_tree_host_client; |
| 1311 TestSharedBitmapManager shared_bitmap_manager; | |
| 1312 TestTaskGraphRunner task_graph_runner; | 1310 TestTaskGraphRunner task_graph_runner; |
| 1313 | 1311 |
| 1314 LayerTreeHostInProcess::InitParams params; | 1312 LayerTreeHostInProcess::InitParams params; |
| 1315 params.client = &layer_tree_host_client; | 1313 params.client = &layer_tree_host_client; |
| 1316 params.shared_bitmap_manager = &shared_bitmap_manager; | |
| 1317 params.task_graph_runner = &task_graph_runner; | 1314 params.task_graph_runner = &task_graph_runner; |
| 1318 params.settings = &settings; | 1315 params.settings = &settings; |
| 1319 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); | 1316 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); |
| 1320 params.animation_host = AnimationHost::CreateForTesting(ThreadInstance::MAIN); | 1317 params.animation_host = AnimationHost::CreateForTesting(ThreadInstance::MAIN); |
| 1321 std::unique_ptr<LayerTreeHostInProcess> layer_tree_host = | 1318 std::unique_ptr<LayerTreeHostInProcess> layer_tree_host = |
| 1322 LayerTreeHostInProcess::CreateThreaded(impl_thread.task_runner(), | 1319 LayerTreeHostInProcess::CreateThreaded(impl_thread.task_runner(), |
| 1323 ¶ms); | 1320 ¶ms); |
| 1324 | 1321 |
| 1325 ThreadCheckingInputHandlerClient input_handler_client( | 1322 ThreadCheckingInputHandlerClient input_handler_client( |
| 1326 impl_thread.task_runner().get(), &received_stop_flinging); | 1323 impl_thread.task_runner().get(), &received_stop_flinging); |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2041 private: | 2038 private: |
| 2042 gfx::ScrollOffset initial_scroll_; | 2039 gfx::ScrollOffset initial_scroll_; |
| 2043 gfx::ScrollOffset second_scroll_; | 2040 gfx::ScrollOffset second_scroll_; |
| 2044 gfx::Vector2dF scroll_amount_; | 2041 gfx::Vector2dF scroll_amount_; |
| 2045 }; | 2042 }; |
| 2046 | 2043 |
| 2047 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostScrollTestPropertyTreeUpdate); | 2044 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostScrollTestPropertyTreeUpdate); |
| 2048 | 2045 |
| 2049 } // namespace | 2046 } // namespace |
| 2050 } // namespace cc | 2047 } // namespace cc |
| OLD | NEW |