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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // you may have copy_requests present. | 106 // you may have copy_requests present. |
107 DCHECK_EQ(source->copy_requests.size(), 0u); | 107 DCHECK_EQ(source->copy_requests.size(), 0u); |
108 | 108 |
109 std::unique_ptr<RenderPass> copy_pass(Create( | 109 std::unique_ptr<RenderPass> copy_pass(Create( |
110 source->shared_quad_state_list.size(), source->quad_list.size())); | 110 source->shared_quad_state_list.size(), source->quad_list.size())); |
111 copy_pass->SetAll(source->id, | 111 copy_pass->SetAll(source->id, |
112 source->output_rect, | 112 source->output_rect, |
113 source->damage_rect, | 113 source->damage_rect, |
114 source->transform_to_root_target, | 114 source->transform_to_root_target, |
115 source->has_transparent_background); | 115 source->has_transparent_background); |
116 for (const auto& shared_quad_state : source->shared_quad_state_list) { | 116 for (auto* shared_quad_state : source->shared_quad_state_list) { |
117 SharedQuadState* copy_shared_quad_state = | 117 SharedQuadState* copy_shared_quad_state = |
118 copy_pass->CreateAndAppendSharedQuadState(); | 118 copy_pass->CreateAndAppendSharedQuadState(); |
119 *copy_shared_quad_state = *shared_quad_state; | 119 *copy_shared_quad_state = *shared_quad_state; |
120 } | 120 } |
121 SharedQuadStateList::Iterator sqs_iter = | 121 SharedQuadStateList::Iterator sqs_iter = |
122 source->shared_quad_state_list.begin(); | 122 source->shared_quad_state_list.begin(); |
123 SharedQuadStateList::Iterator copy_sqs_iter = | 123 SharedQuadStateList::Iterator copy_sqs_iter = |
124 copy_pass->shared_quad_state_list.begin(); | 124 copy_pass->shared_quad_state_list.begin(); |
125 for (const auto& quad : source->quad_list) { | 125 for (auto* quad : source->quad_list) { |
126 while (quad->shared_quad_state != *sqs_iter) { | 126 while (quad->shared_quad_state != *sqs_iter) { |
127 ++sqs_iter; | 127 ++sqs_iter; |
128 ++copy_sqs_iter; | 128 ++copy_sqs_iter; |
129 DCHECK(sqs_iter != source->shared_quad_state_list.end()); | 129 DCHECK(sqs_iter != source->shared_quad_state_list.end()); |
130 } | 130 } |
131 DCHECK(quad->shared_quad_state == *sqs_iter); | 131 DCHECK(quad->shared_quad_state == *sqs_iter); |
132 | 132 |
133 SharedQuadState* copy_shared_quad_state = *copy_sqs_iter; | 133 SharedQuadState* copy_shared_quad_state = *copy_sqs_iter; |
134 | 134 |
135 if (quad->material == DrawQuad::RENDER_PASS) { | 135 if (quad->material == DrawQuad::RENDER_PASS) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 182 |
183 void RenderPass::AsValueInto(base::trace_event::TracedValue* value) const { | 183 void RenderPass::AsValueInto(base::trace_event::TracedValue* value) const { |
184 MathUtil::AddToTracedValue("output_rect", output_rect, value); | 184 MathUtil::AddToTracedValue("output_rect", output_rect, value); |
185 MathUtil::AddToTracedValue("damage_rect", damage_rect, value); | 185 MathUtil::AddToTracedValue("damage_rect", damage_rect, value); |
186 | 186 |
187 value->SetBoolean("has_transparent_background", has_transparent_background); | 187 value->SetBoolean("has_transparent_background", has_transparent_background); |
188 value->SetInteger("copy_requests", | 188 value->SetInteger("copy_requests", |
189 base::saturated_cast<int>(copy_requests.size())); | 189 base::saturated_cast<int>(copy_requests.size())); |
190 | 190 |
191 value->BeginArray("shared_quad_state_list"); | 191 value->BeginArray("shared_quad_state_list"); |
192 for (const auto& shared_quad_state : shared_quad_state_list) { | 192 for (auto* shared_quad_state : shared_quad_state_list) { |
193 value->BeginDictionary(); | 193 value->BeginDictionary(); |
194 shared_quad_state->AsValueInto(value); | 194 shared_quad_state->AsValueInto(value); |
195 value->EndDictionary(); | 195 value->EndDictionary(); |
196 } | 196 } |
197 value->EndArray(); | 197 value->EndArray(); |
198 | 198 |
199 value->BeginArray("quad_list"); | 199 value->BeginArray("quad_list"); |
200 for (const auto& quad : quad_list) { | 200 for (auto* quad : quad_list) { |
201 value->BeginDictionary(); | 201 value->BeginDictionary(); |
202 quad->AsValueInto(value); | 202 quad->AsValueInto(value); |
203 value->EndDictionary(); | 203 value->EndDictionary(); |
204 } | 204 } |
205 value->EndArray(); | 205 value->EndArray(); |
206 | 206 |
207 TracedValue::MakeDictIntoImplicitSnapshotWithCategory( | 207 TracedValue::MakeDictIntoImplicitSnapshotWithCategory( |
208 TRACE_DISABLED_BY_DEFAULT("cc.debug.quads"), | 208 TRACE_DISABLED_BY_DEFAULT("cc.debug.quads"), |
209 value, | 209 value, |
210 "cc::RenderPass", | 210 "cc::RenderPass", |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 case DrawQuad::RENDER_PASS: | 258 case DrawQuad::RENDER_PASS: |
259 case DrawQuad::INVALID: | 259 case DrawQuad::INVALID: |
260 LOG(FATAL) << "Invalid DrawQuad material " << quad->material; | 260 LOG(FATAL) << "Invalid DrawQuad material " << quad->material; |
261 break; | 261 break; |
262 } | 262 } |
263 quad_list.back()->shared_quad_state = shared_quad_state; | 263 quad_list.back()->shared_quad_state = shared_quad_state; |
264 return quad_list.back(); | 264 return quad_list.back(); |
265 } | 265 } |
266 | 266 |
267 } // namespace cc | 267 } // namespace cc |
OLD | NEW |