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

Side by Side Diff: cc/quads/render_pass.cc

Issue 380893004: Move Copy method from DrawQuad to RenderPass (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@moreRP4DQ
Patch Set: rebase Created 6 years, 5 months 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
« no previous file with comments | « cc/quads/draw_quad_unittest.cc ('k') | cc/quads/render_pass_draw_quad.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/values.h" 7 #include "base/values.h"
8 #include "cc/base/math_util.h" 8 #include "cc/base/math_util.h"
9 #include "cc/debug/traced_value.h" 9 #include "cc/debug/traced_value.h"
10 #include "cc/output/copy_output_request.h" 10 #include "cc/output/copy_output_request.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 DCHECK_LT(sqs_i, source->shared_quad_state_list.size()); 100 DCHECK_LT(sqs_i, source->shared_quad_state_list.size());
101 } 101 }
102 DCHECK(source->quad_list[i]->shared_quad_state == 102 DCHECK(source->quad_list[i]->shared_quad_state ==
103 source->shared_quad_state_list[sqs_i]); 103 source->shared_quad_state_list[sqs_i]);
104 104
105 DrawQuad* quad = source->quad_list[i]; 105 DrawQuad* quad = source->quad_list[i];
106 106
107 if (quad->material == DrawQuad::RENDER_PASS) { 107 if (quad->material == DrawQuad::RENDER_PASS) {
108 const RenderPassDrawQuad* pass_quad = 108 const RenderPassDrawQuad* pass_quad =
109 RenderPassDrawQuad::MaterialCast(quad); 109 RenderPassDrawQuad::MaterialCast(quad);
110 copy_pass->quad_list.push_back( 110 copy_pass->CopyFromAndAppendRenderPassDrawQuad(
111 pass_quad->Copy(copy_pass->shared_quad_state_list[sqs_i], 111 pass_quad,
112 pass_quad->render_pass_id).PassAs<DrawQuad>()); 112 copy_pass->shared_quad_state_list[sqs_i],
113 pass_quad->render_pass_id);
113 } else { 114 } else {
114 copy_pass->quad_list.push_back(source->quad_list[i]->Copy( 115 copy_pass->CopyFromAndAppendDrawQuad(
115 copy_pass->shared_quad_state_list[sqs_i])); 116 quad, copy_pass->shared_quad_state_list[sqs_i]);
116 } 117 }
117 } 118 }
118 out->push_back(copy_pass.Pass()); 119 out->push_back(copy_pass.Pass());
119 } 120 }
120 } 121 }
121 122
122 void RenderPass::SetNew(Id id, 123 void RenderPass::SetNew(Id id,
123 const gfx::Rect& output_rect, 124 const gfx::Rect& output_rect,
124 const gfx::Rect& damage_rect, 125 const gfx::Rect& damage_rect,
125 const gfx::Transform& transform_to_root_target) { 126 const gfx::Transform& transform_to_root_target) {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 case DrawQuad::RENDER_PASS: 234 case DrawQuad::RENDER_PASS:
234 case DrawQuad::INVALID: 235 case DrawQuad::INVALID:
235 LOG(FATAL) << "Invalid DrawQuad material " << quad->material; 236 LOG(FATAL) << "Invalid DrawQuad material " << quad->material;
236 break; 237 break;
237 } 238 }
238 quad_list.back()->shared_quad_state = shared_quad_state; 239 quad_list.back()->shared_quad_state = shared_quad_state;
239 return quad_list.back(); 240 return quad_list.back();
240 } 241 }
241 242
242 } // namespace cc 243 } // namespace cc
OLDNEW
« no previous file with comments | « cc/quads/draw_quad_unittest.cc ('k') | cc/quads/render_pass_draw_quad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698