| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |