| 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 "gpu/ipc/gpu_command_buffer_traits.h" | 5 #include "gpu/ipc/gpu_command_buffer_traits.h" |
| 6 | 6 |
| 7 #include "gpu/command_buffer/common/mailbox_holder.h" | 7 #include "gpu/command_buffer/common/mailbox_holder.h" |
| 8 #include "gpu/command_buffer/common/sync_token.h" | 8 #include "gpu/command_buffer/common/sync_token.h" |
| 9 #include "gpu/command_buffer/common/value_state.h" | 9 #include "gpu/command_buffer/common/value_state.h" |
| 10 | 10 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 } | 110 } |
| 111 | 111 |
| 112 void ParamTraits<gpu::Mailbox>::Log(const param_type& p, std::string* l) { | 112 void ParamTraits<gpu::Mailbox>::Log(const param_type& p, std::string* l) { |
| 113 for (size_t i = 0; i < sizeof(p.name); ++i) | 113 for (size_t i = 0; i < sizeof(p.name); ++i) |
| 114 *l += base::StringPrintf("%02x", p.name[i]); | 114 *l += base::StringPrintf("%02x", p.name[i]); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void ParamTraits<gpu::MailboxHolder>::Write(Message* m, const param_type& p) { | 117 void ParamTraits<gpu::MailboxHolder>::Write(Message* m, const param_type& p) { |
| 118 WriteParam(m, p.mailbox); | 118 WriteParam(m, p.mailbox); |
| 119 WriteParam(m, p.texture_target); | 119 WriteParam(m, p.texture_target); |
| 120 WriteParam(m, p.sync_point); | 120 WriteParam(m, p.sync_token); |
| 121 } | 121 } |
| 122 | 122 |
| 123 bool ParamTraits<gpu::MailboxHolder> ::Read(const Message* m, | 123 bool ParamTraits<gpu::MailboxHolder> ::Read(const Message* m, |
| 124 base::PickleIterator* iter, | 124 base::PickleIterator* iter, |
| 125 param_type* p) { | 125 param_type* p) { |
| 126 if (!ReadParam(m, iter, &p->mailbox) || | 126 if (!ReadParam(m, iter, &p->mailbox) || |
| 127 !ReadParam(m, iter, &p->texture_target) || | 127 !ReadParam(m, iter, &p->texture_target) || |
| 128 !ReadParam(m, iter, &p->sync_point)) | 128 !ReadParam(m, iter, &p->sync_token)) |
| 129 return false; | 129 return false; |
| 130 return true; | 130 return true; |
| 131 } | 131 } |
| 132 | 132 |
| 133 void ParamTraits<gpu::MailboxHolder>::Log(const param_type& p, std::string* l) { | 133 void ParamTraits<gpu::MailboxHolder>::Log(const param_type& p, std::string* l) { |
| 134 ParamTraits<gpu::Mailbox>::Log(p.mailbox, l); | 134 ParamTraits<gpu::Mailbox>::Log(p.mailbox, l); |
| 135 *l += base::StringPrintf(":%04x@%d", p.texture_target, p.sync_point); | 135 *l += base::StringPrintf(":%04x@", p.texture_target); |
| 136 ParamTraits<gpu::SyncToken>::Log(p.sync_token, l); |
| 136 } | 137 } |
| 137 | 138 |
| 138 void ParamTraits<gpu::ValueState>::Write(Message* m, const param_type& p) { | 139 void ParamTraits<gpu::ValueState>::Write(Message* m, const param_type& p) { |
| 139 m->WriteData(reinterpret_cast<const char*>(&p), | 140 m->WriteData(reinterpret_cast<const char*>(&p), |
| 140 sizeof(gpu::ValueState)); | 141 sizeof(gpu::ValueState)); |
| 141 } | 142 } |
| 142 | 143 |
| 143 bool ParamTraits<gpu::ValueState> ::Read(const Message* m, | 144 bool ParamTraits<gpu::ValueState> ::Read(const Message* m, |
| 144 base::PickleIterator* iter, | 145 base::PickleIterator* iter, |
| 145 param_type* p) { | 146 param_type* p) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 156 l->append("<ValueState ("); | 157 l->append("<ValueState ("); |
| 157 for (int value : p.int_value) | 158 for (int value : p.int_value) |
| 158 *l += base::StringPrintf("%i ", value); | 159 *l += base::StringPrintf("%i ", value); |
| 159 l->append(" int values "); | 160 l->append(" int values "); |
| 160 for (float value : p.float_value) | 161 for (float value : p.float_value) |
| 161 *l += base::StringPrintf("%f ", value); | 162 *l += base::StringPrintf("%f ", value); |
| 162 l->append(" float values)>"); | 163 l->append(" float values)>"); |
| 163 } | 164 } |
| 164 | 165 |
| 165 } // namespace IPC | 166 } // namespace IPC |
| OLD | NEW |