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/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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 118 |
119 LayerTestCommon::LayerImplTest::LayerImplTest() | 119 LayerTestCommon::LayerImplTest::LayerImplTest() |
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 scoped_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 host_->host_impl()->active_tree()->SetRootLayer(std::move(root)); | 130 host_->host_impl()->active_tree()->SetRootLayer(std::move(root)); |
131 root_layer()->SetHasRenderSurface(true); | 131 root_layer()->SetHasRenderSurface(true); |
132 host_->host_impl()->SetVisible(true); | 132 host_->host_impl()->SetVisible(true); |
133 host_->host_impl()->InitializeRenderer(output_surface_.get()); | 133 host_->host_impl()->InitializeRenderer(output_surface_.get()); |
134 | 134 |
135 const int timeline_id = AnimationIdProvider::NextTimelineId(); | 135 const int timeline_id = AnimationIdProvider::NextTimelineId(); |
136 timeline_ = AnimationTimeline::Create(timeline_id); | 136 timeline_ = AnimationTimeline::Create(timeline_id); |
137 host_->animation_host()->AddAnimationTimeline(timeline_); | 137 host_->animation_host()->AddAnimationTimeline(timeline_); |
138 // Create impl-side instance. | 138 // Create impl-side instance. |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 render_pass_->quad_list.clear(); | 200 render_pass_->quad_list.clear(); |
201 render_pass_->shared_quad_state_list.clear(); | 201 render_pass_->shared_quad_state_list.clear(); |
202 | 202 |
203 surface_impl->AppendQuads( | 203 surface_impl->AppendQuads( |
204 render_pass_.get(), gfx::Transform(), | 204 render_pass_.get(), gfx::Transform(), |
205 Occlusion(gfx::Transform(), SimpleEnclosedRegion(occluded), | 205 Occlusion(gfx::Transform(), SimpleEnclosedRegion(occluded), |
206 SimpleEnclosedRegion()), | 206 SimpleEnclosedRegion()), |
207 SK_ColorBLACK, 1.f, nullptr, &data, RenderPassId(1, 1)); | 207 SK_ColorBLACK, 1.f, nullptr, &data, RenderPassId(1, 1)); |
208 } | 208 } |
209 | 209 |
210 void EmptyCopyOutputCallback(scoped_ptr<CopyOutputResult> result) {} | 210 void EmptyCopyOutputCallback(std::unique_ptr<CopyOutputResult> result) {} |
211 | 211 |
212 void LayerTestCommon::LayerImplTest::RequestCopyOfOutput() { | 212 void LayerTestCommon::LayerImplTest::RequestCopyOfOutput() { |
213 std::vector<scoped_ptr<CopyOutputRequest>> copy_requests; | 213 std::vector<std::unique_ptr<CopyOutputRequest>> copy_requests; |
214 copy_requests.push_back( | 214 copy_requests.push_back( |
215 CopyOutputRequest::CreateRequest(base::Bind(&EmptyCopyOutputCallback))); | 215 CopyOutputRequest::CreateRequest(base::Bind(&EmptyCopyOutputCallback))); |
216 root_layer()->PassCopyRequests(©_requests); | 216 root_layer()->PassCopyRequests(©_requests); |
217 } | 217 } |
218 | 218 |
219 } // namespace cc | 219 } // namespace cc |
OLD | NEW |