| OLD | NEW |
| 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 Loading... |
| 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 (const auto& source : in) { |
| 98 RenderPass* source = in[i]; | |
| 99 | |
| 100 // Since we can't copy these, it's wrong to use CopyAll in a situation where | 98 // Since we can't copy these, it's wrong to use CopyAll in a situation where |
| 101 // you may have copy_requests present. | 99 // you may have copy_requests present. |
| 102 DCHECK_EQ(source->copy_requests.size(), 0u); | 100 DCHECK_EQ(source->copy_requests.size(), 0u); |
| 103 | 101 |
| 104 scoped_ptr<RenderPass> copy_pass(Create( | 102 scoped_ptr<RenderPass> copy_pass(Create( |
| 105 source->shared_quad_state_list.size(), source->quad_list.size())); | 103 source->shared_quad_state_list.size(), source->quad_list.size())); |
| 106 copy_pass->SetAll(source->id, | 104 copy_pass->SetAll(source->id, |
| 107 source->output_rect, | 105 source->output_rect, |
| 108 source->damage_rect, | 106 source->damage_rect, |
| 109 source->transform_to_root_target, | 107 source->transform_to_root_target, |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 case DrawQuad::RENDER_PASS: | 254 case DrawQuad::RENDER_PASS: |
| 257 case DrawQuad::INVALID: | 255 case DrawQuad::INVALID: |
| 258 LOG(FATAL) << "Invalid DrawQuad material " << quad->material; | 256 LOG(FATAL) << "Invalid DrawQuad material " << quad->material; |
| 259 break; | 257 break; |
| 260 } | 258 } |
| 261 quad_list.back()->shared_quad_state = shared_quad_state; | 259 quad_list.back()->shared_quad_state = shared_quad_state; |
| 262 return quad_list.back(); | 260 return quad_list.back(); |
| 263 } | 261 } |
| 264 | 262 |
| 265 } // namespace cc | 263 } // namespace cc |
| OLD | NEW |