| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_host_common_test.h" | 5 #include "cc/test/layer_tree_host_common_test.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "cc/layers/layer.h" | 9 #include "cc/layers/layer.h" |
| 10 #include "cc/layers/layer_impl.h" | 10 #include "cc/layers/layer_impl.h" |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 } | 219 } |
| 220 | 220 |
| 221 bool LayerTreeHostCommonTestBase::UpdateLayerListContains(int id) const { | 221 bool LayerTreeHostCommonTestBase::UpdateLayerListContains(int id) const { |
| 222 for (size_t i = 0; i < update_layer_list_.size(); ++i) { | 222 for (size_t i = 0; i < update_layer_list_.size(); ++i) { |
| 223 if (update_layer_list_[i]->id() == id) | 223 if (update_layer_list_[i]->id() == id) |
| 224 return true; | 224 return true; |
| 225 } | 225 } |
| 226 return false; | 226 return false; |
| 227 } | 227 } |
| 228 | 228 |
| 229 scoped_refptr<Layer> LayerTreeHostCommonTestBase::CreateTestLayer() { |
| 230 auto layer = Layer::Create(); |
| 231 layer->SetElementId(NextElementId()); |
| 232 return layer; |
| 233 } |
| 234 |
| 235 std::unique_ptr<LayerImpl> LayerTreeHostCommonTestBase::CreateTestLayerImpl( |
| 236 LayerTreeImpl* tree_impl, |
| 237 int id) { |
| 238 auto layer = LayerImpl::Create(tree_impl, id); |
| 239 layer->SetElementId(NextElementId()); |
| 240 return layer; |
| 241 } |
| 242 |
| 229 LayerTreeHostCommonTest::LayerTreeHostCommonTest() | 243 LayerTreeHostCommonTest::LayerTreeHostCommonTest() |
| 230 : LayerTreeHostCommonTestBase(LayerTreeSettings()) {} | 244 : LayerTreeHostCommonTestBase(LayerTreeSettings()) {} |
| 231 | 245 |
| 232 LayerTreeHostCommonTest::LayerTreeHostCommonTest( | 246 LayerTreeHostCommonTest::LayerTreeHostCommonTest( |
| 233 const LayerTreeSettings& settings) | 247 const LayerTreeSettings& settings) |
| 234 : LayerTreeHostCommonTestBase(settings) { | 248 : LayerTreeHostCommonTestBase(settings) { |
| 235 } | 249 } |
| 236 | 250 |
| 237 } // namespace cc | 251 } // namespace cc |
| OLD | NEW |