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

Side by Side Diff: cc/ipc/cc_param_traits.cc

Issue 2147873003: cc: Dedup IPCs to return resources to client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 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/ipc/cc_param_traits.h ('k') | cc/layers/texture_layer_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 "cc/ipc/cc_param_traits.h" 5 #include "cc/ipc/cc_param_traits.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/numerics/safe_conversions.h" 10 #include "base/numerics/safe_conversions.h"
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 l->append("CompositorFrame("); 667 l->append("CompositorFrame(");
668 LogParam(p.metadata, l); 668 LogParam(p.metadata, l);
669 l->append(", "); 669 l->append(", ");
670 if (p.delegated_frame_data) 670 if (p.delegated_frame_data)
671 LogParam(*p.delegated_frame_data, l); 671 LogParam(*p.delegated_frame_data, l);
672 else if (p.gl_frame_data) 672 else if (p.gl_frame_data)
673 LogParam(*p.gl_frame_data, l); 673 LogParam(*p.gl_frame_data, l);
674 l->append(")"); 674 l->append(")");
675 } 675 }
676 676
677 void ParamTraits<cc::CompositorFrameAck>::Write(base::Pickle* m,
678 const param_type& p) {
679 WriteParam(m, p.resources);
680 }
681
682 bool ParamTraits<cc::CompositorFrameAck>::Read(const base::Pickle* m,
683 base::PickleIterator* iter,
684 param_type* p) {
685 return ReadParam(m, iter, &p->resources);
686 }
687
688 void ParamTraits<cc::CompositorFrameAck>::Log(const param_type& p,
689 std::string* l) {
690 l->append("CompositorFrameAck(");
691 LogParam(p.resources, l);
692 l->append(")");
693 }
694
695 void ParamTraits<cc::DelegatedFrameData>::Write(base::Pickle* m, 677 void ParamTraits<cc::DelegatedFrameData>::Write(base::Pickle* m,
696 const param_type& p) { 678 const param_type& p) {
697 DCHECK_NE(0u, p.render_pass_list.size()); 679 DCHECK_NE(0u, p.render_pass_list.size());
698 680
699 size_t to_reserve = 0u; 681 size_t to_reserve = 0u;
700 to_reserve += p.resource_list.size() * sizeof(cc::TransferableResource); 682 to_reserve += p.resource_list.size() * sizeof(cc::TransferableResource);
701 for (const auto& pass : p.render_pass_list) { 683 for (const auto& pass : p.render_pass_list) {
702 to_reserve += sizeof(size_t) * 2; 684 to_reserve += sizeof(size_t) * 2;
703 to_reserve += ReserveSizeForRenderPassWrite(*pass); 685 to_reserve += ReserveSizeForRenderPassWrite(*pass);
704 } 686 }
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_ 899 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_
918 #include "cc/ipc/cc_param_traits_macros.h" 900 #include "cc/ipc/cc_param_traits_macros.h"
919 } // namespace IPC 901 } // namespace IPC
920 902
921 // Generate param traits log methods. 903 // Generate param traits log methods.
922 #include "ipc/param_traits_log_macros.h" 904 #include "ipc/param_traits_log_macros.h"
923 namespace IPC { 905 namespace IPC {
924 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_ 906 #undef CC_IPC_CC_PARAM_TRAITS_MACROS_H_
925 #include "cc/ipc/cc_param_traits_macros.h" 907 #include "cc/ipc/cc_param_traits_macros.h"
926 } // namespace IPC 908 } // namespace IPC
OLDNEW
« no previous file with comments | « cc/ipc/cc_param_traits.h ('k') | cc/layers/texture_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698