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

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

Issue 1866203004: Convert //cc from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrcc: rebase Created 4 years, 8 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
« no previous file with comments | « cc/test/layer_test_common.h ('k') | cc/test/layer_tree_host_common_test.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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(&copy_requests); 216 root_layer()->PassCopyRequests(&copy_requests);
217 } 217 }
218 218
219 } // namespace cc 219 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/layer_test_common.h ('k') | cc/test/layer_tree_host_common_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698