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

Unified Diff: cc/surfaces/surface_aggregator.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/surfaces/surface_aggregator.h ('k') | cc/surfaces/surface_aggregator_perftest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_aggregator.cc
diff --git a/cc/surfaces/surface_aggregator.cc b/cc/surfaces/surface_aggregator.cc
index 4c7e04ea4be8f45a9be958c1403c4f0e5cab053f..1ef8fbe8a6d8e3ce95cb3cadeda56f736faa8939 100644
--- a/cc/surfaces/surface_aggregator.cc
+++ b/cc/surfaces/surface_aggregator.cc
@@ -11,6 +11,7 @@
#include "base/bind.h"
#include "base/logging.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
#include "base/trace_event/trace_event.h"
#include "cc/base/math_util.h"
@@ -30,8 +31,9 @@ namespace {
void MoveMatchingRequests(
RenderPassId id,
- std::multimap<RenderPassId, scoped_ptr<CopyOutputRequest>>* copy_requests,
- std::vector<scoped_ptr<CopyOutputRequest>>* output_requests) {
+ std::multimap<RenderPassId, std::unique_ptr<CopyOutputRequest>>*
+ copy_requests,
+ std::vector<std::unique_ptr<CopyOutputRequest>>* output_requests) {
auto request_range = copy_requests->equal_range(id);
for (auto it = request_range.first; it != request_range.second; ++it) {
DCHECK(it->second);
@@ -120,7 +122,7 @@ static void UnrefHelper(base::WeakPtr<SurfaceFactory> surface_factory,
RenderPassId SurfaceAggregator::RemapPassId(RenderPassId surface_local_pass_id,
SurfaceId surface_id) {
- scoped_ptr<RenderPassIdAllocator>& allocator =
+ std::unique_ptr<RenderPassIdAllocator>& allocator =
render_pass_allocator_map_[surface_id];
if (!allocator)
allocator.reset(new RenderPassIdAllocator(&next_render_pass_id_));
@@ -181,7 +183,7 @@ void SurfaceAggregator::HandleSurfaceQuad(
if (!frame_data)
return;
- std::multimap<RenderPassId, scoped_ptr<CopyOutputRequest>> copy_requests;
+ std::multimap<RenderPassId, std::unique_ptr<CopyOutputRequest>> copy_requests;
surface->TakeCopyOutputRequests(&copy_requests);
const RenderPassList& render_pass_list = frame_data->render_pass_list;
@@ -209,7 +211,8 @@ void SurfaceAggregator::HandleSurfaceQuad(
size_t sqs_size = source.shared_quad_state_list.size();
size_t dq_size = source.quad_list.size();
- scoped_ptr<RenderPass> copy_pass(RenderPass::Create(sqs_size, dq_size));
+ std::unique_ptr<RenderPass> copy_pass(
+ RenderPass::Create(sqs_size, dq_size));
RenderPassId remapped_pass_id = RemapPassId(source.id, surface_id);
@@ -424,7 +427,7 @@ void SurfaceAggregator::CopyPasses(const DelegatedFrameData* frame_data,
Surface* surface) {
// The root surface is allowed to have copy output requests, so grab them
// off its render passes.
- std::multimap<RenderPassId, scoped_ptr<CopyOutputRequest>> copy_requests;
+ std::multimap<RenderPassId, std::unique_ptr<CopyOutputRequest>> copy_requests;
surface->TakeCopyOutputRequests(&copy_requests);
const RenderPassList& source_pass_list = frame_data->render_pass_list;
@@ -443,7 +446,8 @@ void SurfaceAggregator::CopyPasses(const DelegatedFrameData* frame_data,
size_t sqs_size = source.shared_quad_state_list.size();
size_t dq_size = source.quad_list.size();
- scoped_ptr<RenderPass> copy_pass(RenderPass::Create(sqs_size, dq_size));
+ std::unique_ptr<RenderPass> copy_pass(
+ RenderPass::Create(sqs_size, dq_size));
MoveMatchingRequests(source.id, &copy_requests, &copy_pass->copy_requests);
@@ -643,7 +647,8 @@ void SurfaceAggregator::CopyUndrawnSurfaces(PrewalkResult* prewalk_result) {
}
}
-scoped_ptr<CompositorFrame> SurfaceAggregator::Aggregate(SurfaceId surface_id) {
+std::unique_ptr<CompositorFrame> SurfaceAggregator::Aggregate(
+ SurfaceId surface_id) {
Surface* surface = manager_->GetSurfaceForId(surface_id);
DCHECK(surface);
contained_surfaces_[surface_id] = surface->frame_index();
@@ -652,8 +657,8 @@ scoped_ptr<CompositorFrame> SurfaceAggregator::Aggregate(SurfaceId surface_id) {
return nullptr;
TRACE_EVENT0("cc", "SurfaceAggregator::Aggregate");
- scoped_ptr<CompositorFrame> frame(new CompositorFrame);
- frame->delegated_frame_data = make_scoped_ptr(new DelegatedFrameData);
+ std::unique_ptr<CompositorFrame> frame(new CompositorFrame);
+ frame->delegated_frame_data = base::WrapUnique(new DelegatedFrameData);
DCHECK(root_surface_frame->delegated_frame_data);
« no previous file with comments | « cc/surfaces/surface_aggregator.h ('k') | cc/surfaces/surface_aggregator_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698