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

Side by Side Diff: content/common/cc_messages.cc

Issue 11418108: cc: Make the ScopedPtrVector and ScopedPtrDeque containers act like STL vector and deque. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android!! Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « cc/tree_synchronizer.cc ('k') | content/common/cc_messages_unittest.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/common/cc_messages.h" 5 #include "content/common/cc_messages.h"
6 6
7 #include "cc/compositor_frame.h" 7 #include "cc/compositor_frame.h"
8 #include "content/public/common/common_param_traits.h" 8 #include "content/public/common/common_param_traits.h"
9 #include "third_party/WebKit/Source/Platform/chromium/public/WebData.h" 9 #include "third_party/WebKit/Source/Platform/chromium/public/WebData.h"
10 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperations .h" 10 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperations .h"
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 output_rect, 401 output_rect,
402 damage_rect, 402 damage_rect,
403 transform_to_root_target, 403 transform_to_root_target,
404 has_transparent_background, 404 has_transparent_background,
405 has_occlusion_from_outside_target_surface); 405 has_occlusion_from_outside_target_surface);
406 406
407 for (size_t i = 0; i < shared_quad_state_list_size; ++i) { 407 for (size_t i = 0; i < shared_quad_state_list_size; ++i) {
408 scoped_ptr<cc::SharedQuadState> state(cc::SharedQuadState::Create()); 408 scoped_ptr<cc::SharedQuadState> state(cc::SharedQuadState::Create());
409 if (!ReadParam(m, iter, state.get())) 409 if (!ReadParam(m, iter, state.get()))
410 return false; 410 return false;
411 p->shared_quad_state_list.append(state.Pass()); 411 p->shared_quad_state_list.push_back(state.Pass());
412 } 412 }
413 413
414 size_t last_shared_quad_state_index = 0; 414 size_t last_shared_quad_state_index = 0;
415 for (size_t i = 0; i < quad_list_size; ++i) { 415 for (size_t i = 0; i < quad_list_size; ++i) {
416 cc::DrawQuad::Material material; 416 cc::DrawQuad::Material material;
417 PickleIterator temp_iter = *iter; 417 PickleIterator temp_iter = *iter;
418 if (!ReadParam(m, &temp_iter, &material)) 418 if (!ReadParam(m, &temp_iter, &material))
419 return false; 419 return false;
420 420
421 scoped_ptr<cc::DrawQuad> draw_quad; 421 scoped_ptr<cc::DrawQuad> draw_quad;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 shared_quad_state_index >= p->shared_quad_state_list.size()) 458 shared_quad_state_index >= p->shared_quad_state_list.size())
459 return false; 459 return false;
460 // SharedQuadState indexes should be in ascending order. 460 // SharedQuadState indexes should be in ascending order.
461 if (shared_quad_state_index < last_shared_quad_state_index) 461 if (shared_quad_state_index < last_shared_quad_state_index)
462 return false; 462 return false;
463 last_shared_quad_state_index = shared_quad_state_index; 463 last_shared_quad_state_index = shared_quad_state_index;
464 464
465 draw_quad->shared_quad_state = 465 draw_quad->shared_quad_state =
466 p->shared_quad_state_list[shared_quad_state_index]; 466 p->shared_quad_state_list[shared_quad_state_index];
467 467
468 p->quad_list.append(draw_quad.Pass()); 468 p->quad_list.push_back(draw_quad.Pass());
469 } 469 }
470 470
471 return true; 471 return true;
472 } 472 }
473 473
474 void ParamTraits<cc::RenderPass>::Log( 474 void ParamTraits<cc::RenderPass>::Log(
475 const param_type& p, std::string* l) { 475 const param_type& p, std::string* l) {
476 l->append("RenderPass(("); 476 l->append("RenderPass((");
477 LogParam(p.id, l); 477 LogParam(p.id, l);
478 l->append("), "); 478 l->append("), ");
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 size_t num_render_passes; 630 size_t num_render_passes;
631 if (!ReadParam(m, iter, &p->size) || 631 if (!ReadParam(m, iter, &p->size) ||
632 !ReadParam(m, iter, &p->resource_list) || 632 !ReadParam(m, iter, &p->resource_list) ||
633 !ReadParam(m, iter, &num_render_passes) || 633 !ReadParam(m, iter, &num_render_passes) ||
634 num_render_passes > kMaxRenderPasses) 634 num_render_passes > kMaxRenderPasses)
635 return false; 635 return false;
636 for (size_t i = 0; i < num_render_passes; ++i) { 636 for (size_t i = 0; i < num_render_passes; ++i) {
637 scoped_ptr<cc::RenderPass> render_pass = cc::RenderPass::Create(); 637 scoped_ptr<cc::RenderPass> render_pass = cc::RenderPass::Create();
638 if (!ReadParam(m, iter, render_pass.get())) 638 if (!ReadParam(m, iter, render_pass.get()))
639 return false; 639 return false;
640 p->render_pass_list.append(render_pass.Pass()); 640 p->render_pass_list.push_back(render_pass.Pass());
641 } 641 }
642 return true; 642 return true;
643 } 643 }
644 644
645 void ParamTraits<cc::DelegatedFrameData>::Log(const param_type& p, 645 void ParamTraits<cc::DelegatedFrameData>::Log(const param_type& p,
646 std::string* l) { 646 std::string* l) {
647 l->append("DelegatedFrameData("); 647 l->append("DelegatedFrameData(");
648 LogParam(p.size, l); 648 LogParam(p.size, l);
649 l->append(", "); 649 l->append(", ");
650 LogParam(p.resource_list, l); 650 LogParam(p.resource_list, l);
651 l->append(", ["); 651 l->append(", [");
652 for (size_t i = 0; i < p.render_pass_list.size(); ++i) { 652 for (size_t i = 0; i < p.render_pass_list.size(); ++i) {
653 if (i) 653 if (i)
654 l->append(", "); 654 l->append(", ");
655 LogParam(*p.render_pass_list[i], l); 655 LogParam(*p.render_pass_list[i], l);
656 } 656 }
657 l->append("])"); 657 l->append("])");
658 } 658 }
659 659
660 } // namespace IPC 660 } // namespace IPC
OLDNEW
« no previous file with comments | « cc/tree_synchronizer.cc ('k') | content/common/cc_messages_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698