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

Side by Side Diff: cc/surfaces/surface.cc

Issue 1437413002: cc: Remove ScopedPtrVector and cc::remove_if. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: just the vector Created 5 years, 1 month 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/surfaces/surface.h" 5 #include "cc/surfaces/surface.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "cc/base/container_util.h"
9 #include "cc/output/compositor_frame.h" 10 #include "cc/output/compositor_frame.h"
10 #include "cc/output/copy_output_request.h" 11 #include "cc/output/copy_output_request.h"
11 #include "cc/surfaces/surface_factory.h" 12 #include "cc/surfaces/surface_factory.h"
12 #include "cc/surfaces/surface_id_allocator.h" 13 #include "cc/surfaces/surface_id_allocator.h"
13 #include "cc/surfaces/surface_manager.h" 14 #include "cc/surfaces/surface_manager.h"
14 15
15 namespace cc { 16 namespace cc {
16 17
17 // The frame index starts at 2 so that empty frames will be treated as 18 // The frame index starts at 2 so that empty frames will be treated as
18 // completely damaged the first time they're drawn from. 19 // completely damaged the first time they're drawn from.
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 } 110 }
110 111
111 void Surface::TakeCopyOutputRequests( 112 void Surface::TakeCopyOutputRequests(
112 std::multimap<RenderPassId, CopyOutputRequest*>* copy_requests) { 113 std::multimap<RenderPassId, CopyOutputRequest*>* copy_requests) {
113 DCHECK(copy_requests->empty()); 114 DCHECK(copy_requests->empty());
114 if (current_frame_) { 115 if (current_frame_) {
115 for (const auto& render_pass : 116 for (const auto& render_pass :
116 current_frame_->delegated_frame_data->render_pass_list) { 117 current_frame_->delegated_frame_data->render_pass_list) {
117 while (!render_pass->copy_requests.empty()) { 118 while (!render_pass->copy_requests.empty()) {
118 scoped_ptr<CopyOutputRequest> request = 119 scoped_ptr<CopyOutputRequest> request =
119 render_pass->copy_requests.take_back(); 120 TakeBack(&render_pass->copy_requests);
120 render_pass->copy_requests.pop_back();
121 copy_requests->insert( 121 copy_requests->insert(
122 std::make_pair(render_pass->id, request.release())); 122 std::make_pair(render_pass->id, request.release()));
danakj 2015/11/17 01:12:17 can you put a TODO and a bug to make this multimap
vmpstr 2015/11/17 23:26:24 I'll do this as a follow-up. Added a TODO.
123 } 123 }
124 } 124 }
125 } 125 }
126 } 126 }
127 127
128 const CompositorFrame* Surface::GetEligibleFrame() { 128 const CompositorFrame* Surface::GetEligibleFrame() {
129 return current_frame_.get(); 129 return current_frame_.get();
130 } 130 }
131 131
132 void Surface::TakeLatencyInfo(std::vector<ui::LatencyInfo>* latency_info) { 132 void Surface::TakeLatencyInfo(std::vector<ui::LatencyInfo>* latency_info) {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 if (current_frame_) { 199 if (current_frame_) {
200 for (const auto& render_pass : 200 for (const auto& render_pass :
201 current_frame_->delegated_frame_data->render_pass_list) { 201 current_frame_->delegated_frame_data->render_pass_list) {
202 for (const auto& copy_request : render_pass->copy_requests) 202 for (const auto& copy_request : render_pass->copy_requests)
203 copy_request->SendEmptyResult(); 203 copy_request->SendEmptyResult();
204 } 204 }
205 } 205 }
206 } 206 }
207 207
208 } // namespace cc 208 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698