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

Side by Side Diff: cc/quads/render_pass.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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/quads/render_pass.h" 5 #include "cc/quads/render_pass.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/numerics/safe_conversions.h" 9 #include "base/numerics/safe_conversions.h"
10 #include "base/trace_event/trace_event_argument.h" 10 #include "base/trace_event/trace_event_argument.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 Create(shared_quad_state_list.size(), quad_list.size())); 85 Create(shared_quad_state_list.size(), quad_list.size()));
86 copy_pass->SetAll(new_id, 86 copy_pass->SetAll(new_id,
87 output_rect, 87 output_rect,
88 damage_rect, 88 damage_rect,
89 transform_to_root_target, 89 transform_to_root_target,
90 has_transparent_background); 90 has_transparent_background);
91 return copy_pass.Pass(); 91 return copy_pass.Pass();
92 } 92 }
93 93
94 // static 94 // static
95 void RenderPass::CopyAll(const ScopedPtrVector<RenderPass>& in, 95 void RenderPass::CopyAll(const std::vector<scoped_ptr<RenderPass>>& in,
96 ScopedPtrVector<RenderPass>* out) { 96 std::vector<scoped_ptr<RenderPass>>* out) {
97 for (size_t i = 0; i < in.size(); ++i) { 97 for (size_t i = 0; i < in.size(); ++i) {
danakj 2015/11/17 01:12:17 ouch. should be range-based too. whyyyy does it ha
vmpstr 2015/11/17 23:26:24 Done.
98 RenderPass* source = in[i]; 98 RenderPass* source = in[i].get();
99 99
100 // Since we can't copy these, it's wrong to use CopyAll in a situation where 100 // Since we can't copy these, it's wrong to use CopyAll in a situation where
101 // you may have copy_requests present. 101 // you may have copy_requests present.
102 DCHECK_EQ(source->copy_requests.size(), 0u); 102 DCHECK_EQ(source->copy_requests.size(), 0u);
103 103
104 scoped_ptr<RenderPass> copy_pass(Create( 104 scoped_ptr<RenderPass> copy_pass(Create(
105 source->shared_quad_state_list.size(), source->quad_list.size())); 105 source->shared_quad_state_list.size(), source->quad_list.size()));
106 copy_pass->SetAll(source->id, 106 copy_pass->SetAll(source->id,
107 source->output_rect, 107 source->output_rect,
108 source->damage_rect, 108 source->damage_rect,
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 case DrawQuad::RENDER_PASS: 256 case DrawQuad::RENDER_PASS:
257 case DrawQuad::INVALID: 257 case DrawQuad::INVALID:
258 LOG(FATAL) << "Invalid DrawQuad material " << quad->material; 258 LOG(FATAL) << "Invalid DrawQuad material " << quad->material;
259 break; 259 break;
260 } 260 }
261 quad_list.back()->shared_quad_state = shared_quad_state; 261 quad_list.back()->shared_quad_state = shared_quad_state;
262 return quad_list.back(); 262 return quad_list.back();
263 } 263 }
264 264
265 } // namespace cc 265 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698