Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: cc/test/layer_tree_host_common_test.cc

Issue 1944623002: CC Animation: Use ElementId to attach CC animation players. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@erasedomids
Patch Set: Let CC clients generate their own ElementIds locally. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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(NextTestElementId());
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(NextTestElementId());
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698