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 #include "gpu/command_buffer/common/mailbox_holder.h" | 6 #include "gpu/command_buffer/common/mailbox_holder.h" |
7 | 7 |
8 namespace IPC { | 8 namespace IPC { |
9 | 9 |
10 void ParamTraits<gpu::CommandBuffer::State> ::Write(Message* m, | 10 void ParamTraits<gpu::CommandBuffer::State> ::Write(Message* m, |
11 const param_type& p) { | 11 const param_type& p) { |
12 WriteParam(m, p.num_entries); | |
13 WriteParam(m, p.get_offset); | 12 WriteParam(m, p.get_offset); |
14 WriteParam(m, p.put_offset); | |
15 WriteParam(m, p.token); | 13 WriteParam(m, p.token); |
16 WriteParam(m, static_cast<int32>(p.error)); | 14 WriteParam(m, static_cast<int32>(p.error)); |
17 WriteParam(m, p.generation); | 15 WriteParam(m, p.generation); |
18 } | 16 } |
19 | 17 |
20 bool ParamTraits<gpu::CommandBuffer::State> ::Read(const Message* m, | 18 bool ParamTraits<gpu::CommandBuffer::State> ::Read(const Message* m, |
21 PickleIterator* iter, | 19 PickleIterator* iter, |
22 param_type* p) { | 20 param_type* p) { |
23 int32 temp; | 21 int32 temp; |
24 if (ReadParam(m, iter, &p->num_entries) && | 22 if (ReadParam(m, iter, &p->get_offset) && |
25 ReadParam(m, iter, &p->get_offset) && | |
26 ReadParam(m, iter, &p->put_offset) && | |
27 ReadParam(m, iter, &p->token) && | 23 ReadParam(m, iter, &p->token) && |
28 ReadParam(m, iter, &temp) && | 24 ReadParam(m, iter, &temp) && |
29 ReadParam(m, iter, &p->generation)) { | 25 ReadParam(m, iter, &p->generation)) { |
30 p->error = static_cast<gpu::error::Error>(temp); | 26 p->error = static_cast<gpu::error::Error>(temp); |
31 return true; | 27 return true; |
32 } else { | 28 } else { |
33 return false; | 29 return false; |
34 } | 30 } |
35 } | 31 } |
36 | 32 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 return false; | 70 return false; |
75 return true; | 71 return true; |
76 } | 72 } |
77 | 73 |
78 void ParamTraits<gpu::MailboxHolder>::Log(const param_type& p, std::string* l) { | 74 void ParamTraits<gpu::MailboxHolder>::Log(const param_type& p, std::string* l) { |
79 ParamTraits<gpu::Mailbox>::Log(p.mailbox, l); | 75 ParamTraits<gpu::Mailbox>::Log(p.mailbox, l); |
80 *l += base::StringPrintf(":%04x@%d", p.texture_target, p.sync_point); | 76 *l += base::StringPrintf(":%04x@%d", p.texture_target, p.sync_point); |
81 } | 77 } |
82 | 78 |
83 } // namespace IPC | 79 } // namespace IPC |
OLD | NEW |