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/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1122 bool received_stop_flinging = false; | 1122 bool received_stop_flinging = false; |
1123 LayerTreeSettings settings; | 1123 LayerTreeSettings settings; |
1124 | 1124 |
1125 ThreadCheckingInputHandlerClient input_handler_client( | 1125 ThreadCheckingInputHandlerClient input_handler_client( |
1126 impl_thread.task_runner().get(), &received_stop_flinging); | 1126 impl_thread.task_runner().get(), &received_stop_flinging); |
1127 FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DIRECT_3D); | 1127 FakeLayerTreeHostClient client(FakeLayerTreeHostClient::DIRECT_3D); |
1128 | 1128 |
1129 ASSERT_TRUE(impl_thread.task_runner().get()); | 1129 ASSERT_TRUE(impl_thread.task_runner().get()); |
1130 scoped_ptr<SharedBitmapManager> shared_bitmap_manager( | 1130 scoped_ptr<SharedBitmapManager> shared_bitmap_manager( |
1131 new TestSharedBitmapManager()); | 1131 new TestSharedBitmapManager()); |
1132 scoped_ptr<LayerTreeHost> layer_tree_host = LayerTreeHost::CreateThreaded( | 1132 |
1133 &client, shared_bitmap_manager.get(), NULL, NULL, settings, | 1133 LayerTreeHost::InitParams params; |
1134 base::ThreadTaskRunnerHandle::Get(), impl_thread.task_runner(), nullptr); | 1134 params.client = &client; |
| 1135 params.shared_bitmap_manager = shared_bitmap_manager.get(); |
| 1136 params.settings = &settings; |
| 1137 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); |
| 1138 scoped_ptr<LayerTreeHost> layer_tree_host = |
| 1139 LayerTreeHost::CreateThreaded(impl_thread.task_runner(), ¶ms); |
1135 | 1140 |
1136 impl_thread.task_runner()->PostTask( | 1141 impl_thread.task_runner()->PostTask( |
1137 FROM_HERE, base::Bind(&BindInputHandlerOnCompositorThread, | 1142 FROM_HERE, base::Bind(&BindInputHandlerOnCompositorThread, |
1138 layer_tree_host->GetInputHandler(), | 1143 layer_tree_host->GetInputHandler(), |
1139 base::Unretained(&input_handler_client))); | 1144 base::Unretained(&input_handler_client))); |
1140 | 1145 |
1141 layer_tree_host->DidStopFlinging(); | 1146 layer_tree_host->DidStopFlinging(); |
1142 layer_tree_host = nullptr; | 1147 layer_tree_host = nullptr; |
1143 impl_thread.Stop(); | 1148 impl_thread.Stop(); |
1144 EXPECT_TRUE(received_stop_flinging); | 1149 EXPECT_TRUE(received_stop_flinging); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1231 RunTest(true, false, true); | 1236 RunTest(true, false, true); |
1232 } | 1237 } |
1233 | 1238 |
1234 TEST_F(LayerTreeHostScrollTestLayerStructureChange, ScrollDestroyWholeTree) { | 1239 TEST_F(LayerTreeHostScrollTestLayerStructureChange, ScrollDestroyWholeTree) { |
1235 scroll_destroy_whole_tree_ = true; | 1240 scroll_destroy_whole_tree_ = true; |
1236 RunTest(true, false, true); | 1241 RunTest(true, false, true); |
1237 } | 1242 } |
1238 | 1243 |
1239 } // namespace | 1244 } // namespace |
1240 } // namespace cc | 1245 } // namespace cc |
OLD | NEW |