| 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 "base/debug/trace_event_argument.h" | 7 #include "base/debug/trace_event_argument.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "cc/base/math_util.h" | 9 #include "cc/base/math_util.h" |
| 10 #include "cc/debug/traced_value.h" | 10 #include "cc/debug/traced_value.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 copy_shared_quad_state->CopyFrom(source->shared_quad_state_list[i]); | 90 copy_shared_quad_state->CopyFrom(source->shared_quad_state_list[i]); |
| 91 } | 91 } |
| 92 for (size_t i = 0, sqs_i = 0; i < source->quad_list.size(); ++i) { | 92 for (size_t i = 0, sqs_i = 0; i < source->quad_list.size(); ++i) { |
| 93 while (source->quad_list[i]->shared_quad_state != | 93 while (source->quad_list[i]->shared_quad_state != |
| 94 source->shared_quad_state_list[sqs_i]) { | 94 source->shared_quad_state_list[sqs_i]) { |
| 95 ++sqs_i; | 95 ++sqs_i; |
| 96 DCHECK_LT(sqs_i, source->shared_quad_state_list.size()); | 96 DCHECK_LT(sqs_i, source->shared_quad_state_list.size()); |
| 97 } | 97 } |
| 98 DCHECK(source->quad_list[i]->shared_quad_state == | 98 DCHECK(source->quad_list[i]->shared_quad_state == |
| 99 source->shared_quad_state_list[sqs_i]); | 99 source->shared_quad_state_list[sqs_i]); |
| 100 | |
| 101 DrawQuad* quad = source->quad_list[i]; | 100 DrawQuad* quad = source->quad_list[i]; |
| 102 | |
| 103 if (quad->material == DrawQuad::RENDER_PASS) { | 101 if (quad->material == DrawQuad::RENDER_PASS) { |
| 104 const RenderPassDrawQuad* pass_quad = | 102 const RenderPassDrawQuad* pass_quad = |
| 105 RenderPassDrawQuad::MaterialCast(quad); | 103 RenderPassDrawQuad::MaterialCast(quad); |
| 106 copy_pass->CopyFromAndAppendRenderPassDrawQuad( | 104 copy_pass->CopyFromAndAppendRenderPassDrawQuad( |
| 107 pass_quad, | 105 pass_quad, |
| 108 copy_pass->shared_quad_state_list[sqs_i], | 106 copy_pass->shared_quad_state_list[sqs_i], |
| 109 pass_quad->render_pass_id); | 107 pass_quad->render_pass_id); |
| 110 } else { | 108 } else { |
| 111 copy_pass->CopyFromAndAppendDrawQuad( | 109 copy_pass->CopyFromAndAppendDrawQuad( |
| 112 quad, copy_pass->shared_quad_state_list[sqs_i]); | 110 quad, copy_pass->shared_quad_state_list[sqs_i]); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 case DrawQuad::RENDER_PASS: | 240 case DrawQuad::RENDER_PASS: |
| 243 case DrawQuad::INVALID: | 241 case DrawQuad::INVALID: |
| 244 LOG(FATAL) << "Invalid DrawQuad material " << quad->material; | 242 LOG(FATAL) << "Invalid DrawQuad material " << quad->material; |
| 245 break; | 243 break; |
| 246 } | 244 } |
| 247 quad_list.back()->shared_quad_state = shared_quad_state; | 245 quad_list.back()->shared_quad_state = shared_quad_state; |
| 248 return quad_list.back(); | 246 return quad_list.back(); |
| 249 } | 247 } |
| 250 | 248 |
| 251 } // namespace cc | 249 } // namespace cc |
| OLD | NEW |