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

Side by Side Diff: cc/test/layer_test_common.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 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/test/layer_test_common.h" 5 #include "cc/test/layer_test_common.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "cc/animation/animation_host.h" 9 #include "cc/animation/animation_host.h"
10 #include "cc/animation/animation_id_provider.h" 10 #include "cc/animation/animation_id_provider.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 : LayerImplTest(LayerTreeSettings()) {} 120 : LayerImplTest(LayerTreeSettings()) {}
121 121
122 LayerTestCommon::LayerImplTest::LayerImplTest(const LayerTreeSettings& settings) 122 LayerTestCommon::LayerImplTest::LayerImplTest(const LayerTreeSettings& settings)
123 : client_(FakeLayerTreeHostClient::DIRECT_3D), 123 : client_(FakeLayerTreeHostClient::DIRECT_3D),
124 output_surface_(FakeOutputSurface::Create3d()), 124 output_surface_(FakeOutputSurface::Create3d()),
125 host_(FakeLayerTreeHost::Create(&client_, &task_graph_runner_, settings)), 125 host_(FakeLayerTreeHost::Create(&client_, &task_graph_runner_, settings)),
126 render_pass_(RenderPass::Create()), 126 render_pass_(RenderPass::Create()),
127 layer_impl_id_(2) { 127 layer_impl_id_(2) {
128 std::unique_ptr<LayerImpl> root = 128 std::unique_ptr<LayerImpl> root =
129 LayerImpl::Create(host_->host_impl()->active_tree(), 1); 129 LayerImpl::Create(host_->host_impl()->active_tree(), 1);
130 root->SetElementId(NextTestElementId());
130 host_->host_impl()->active_tree()->SetRootLayer(std::move(root)); 131 host_->host_impl()->active_tree()->SetRootLayer(std::move(root));
131 root_layer()->SetHasRenderSurface(true); 132 root_layer()->SetHasRenderSurface(true);
132 host_->host_impl()->SetVisible(true); 133 host_->host_impl()->SetVisible(true);
133 host_->host_impl()->InitializeRenderer(output_surface_.get()); 134 host_->host_impl()->InitializeRenderer(output_surface_.get());
134 135
135 const int timeline_id = AnimationIdProvider::NextTimelineId(); 136 const int timeline_id = AnimationIdProvider::NextTimelineId();
136 timeline_ = AnimationTimeline::Create(timeline_id); 137 timeline_ = AnimationTimeline::Create(timeline_id);
137 host_->animation_host()->AddAnimationTimeline(timeline_); 138 host_->animation_host()->AddAnimationTimeline(timeline_);
138 // Create impl-side instance. 139 // Create impl-side instance.
139 host_->animation_host()->PushPropertiesTo( 140 host_->animation_host()->PushPropertiesTo(
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 void EmptyCopyOutputCallback(std::unique_ptr<CopyOutputResult> result) {} 209 void EmptyCopyOutputCallback(std::unique_ptr<CopyOutputResult> result) {}
209 210
210 void LayerTestCommon::LayerImplTest::RequestCopyOfOutput() { 211 void LayerTestCommon::LayerImplTest::RequestCopyOfOutput() {
211 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests; 212 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests;
212 copy_requests.push_back( 213 copy_requests.push_back(
213 CopyOutputRequest::CreateRequest(base::Bind(&EmptyCopyOutputCallback))); 214 CopyOutputRequest::CreateRequest(base::Bind(&EmptyCopyOutputCallback)));
214 root_layer()->PassCopyRequests(&copy_requests); 215 root_layer()->PassCopyRequests(&copy_requests);
215 } 216 }
216 217
217 } // namespace cc 218 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698