Chromium Code Reviews| 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/layers/layer.h" | 5 #include "cc/layers/layer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
| 10 #include "cc/animation/animation_host.h" | 10 #include "cc/animation/animation_host.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 | 126 |
| 127 protected: | 127 protected: |
| 128 void SetUp() override { | 128 void SetUp() override { |
| 129 animation_host_ = AnimationHost::CreateForTesting(ThreadInstance::MAIN); | 129 animation_host_ = AnimationHost::CreateForTesting(ThreadInstance::MAIN); |
| 130 | 130 |
| 131 LayerTreeHostInProcess::InitParams params; | 131 LayerTreeHostInProcess::InitParams params; |
| 132 params.client = &fake_client_; | 132 params.client = &fake_client_; |
| 133 params.settings = &settings_; | 133 params.settings = &settings_; |
| 134 params.task_graph_runner = &task_graph_runner_; | 134 params.task_graph_runner = &task_graph_runner_; |
| 135 params.mutator_host = animation_host_.get(); | 135 params.mutator_host = animation_host_.get(); |
| 136 params.image_worker_task_runner = nullptr; | |
|
enne (OOO)
2017/01/03 21:15:25
Doesn't this default to nullptr?
vmpstr
2017/01/03 21:40:34
Yes. Uh... Well, this is a relic of the past. As i
enne (OOO)
2017/01/03 21:49:42
Yah, I think I'd prefer them gone if they're not n
vmpstr
2017/01/06 01:19:03
Done.
| |
| 136 | 137 |
| 137 layer_tree_host_.reset( | 138 layer_tree_host_.reset( |
| 138 new StrictMock<MockLayerTreeHost>(&single_thread_client_, ¶ms)); | 139 new StrictMock<MockLayerTreeHost>(&single_thread_client_, ¶ms)); |
| 139 layer_tree_ = static_cast<StrictMock<MockLayerTree>*>( | 140 layer_tree_ = static_cast<StrictMock<MockLayerTree>*>( |
| 140 layer_tree_host_->GetLayerTree()); | 141 layer_tree_host_->GetLayerTree()); |
| 141 } | 142 } |
| 142 | 143 |
| 143 void TearDown() override { | 144 void TearDown() override { |
| 144 Mock::VerifyAndClearExpectations(layer_tree_host_.get()); | 145 Mock::VerifyAndClearExpectations(layer_tree_host_.get()); |
| 145 Mock::VerifyAndClearExpectations(layer_tree_); | 146 Mock::VerifyAndClearExpectations(layer_tree_); |
| (...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1037 } | 1038 } |
| 1038 | 1039 |
| 1039 std::unique_ptr<LayerTreeHost> Create(LayerTreeSettings settings, | 1040 std::unique_ptr<LayerTreeHost> Create(LayerTreeSettings settings, |
| 1040 MutatorHost* mutator_host) { | 1041 MutatorHost* mutator_host) { |
| 1041 LayerTreeHostInProcess::InitParams params; | 1042 LayerTreeHostInProcess::InitParams params; |
| 1042 params.client = &client_; | 1043 params.client = &client_; |
| 1043 params.task_graph_runner = &task_graph_runner_; | 1044 params.task_graph_runner = &task_graph_runner_; |
| 1044 params.settings = &settings; | 1045 params.settings = &settings; |
| 1045 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); | 1046 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); |
| 1046 params.mutator_host = mutator_host; | 1047 params.mutator_host = mutator_host; |
| 1048 params.image_worker_task_runner = nullptr; | |
| 1047 | 1049 |
| 1048 return LayerTreeHostInProcess::CreateSingleThreaded(&single_thread_client_, | 1050 return LayerTreeHostInProcess::CreateSingleThreaded(&single_thread_client_, |
| 1049 ¶ms); | 1051 ¶ms); |
| 1050 } | 1052 } |
| 1051 | 1053 |
| 1052 private: | 1054 private: |
| 1053 FakeLayerTreeHostClient client_; | 1055 FakeLayerTreeHostClient client_; |
| 1054 StubLayerTreeHostSingleThreadClient single_thread_client_; | 1056 StubLayerTreeHostSingleThreadClient single_thread_client_; |
| 1055 TestTaskGraphRunner task_graph_runner_; | 1057 TestTaskGraphRunner task_graph_runner_; |
| 1056 }; | 1058 }; |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1425 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties()); | 1427 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties()); |
| 1426 | 1428 |
| 1427 test_layer->PushPropertiesTo(impl_layer.get()); | 1429 test_layer->PushPropertiesTo(impl_layer.get()); |
| 1428 | 1430 |
| 1429 EXPECT_EQ(ElementId(2, 0), impl_layer->element_id()); | 1431 EXPECT_EQ(ElementId(2, 0), impl_layer->element_id()); |
| 1430 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties()); | 1432 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties()); |
| 1431 } | 1433 } |
| 1432 | 1434 |
| 1433 } // namespace | 1435 } // namespace |
| 1434 } // namespace cc | 1436 } // namespace cc |
| OLD | NEW |