OLD | NEW |
1 // Copyright (c) 2011 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 namespace IPC { | 7 namespace IPC { |
8 | 8 |
9 void ParamTraits<gpu::CommandBuffer::State> ::Write(Message* m, | 9 void ParamTraits<gpu::CommandBuffer::State> ::Write(Message* m, |
10 const param_type& p) { | 10 const param_type& p) { |
11 WriteParam(m, p.num_entries); | 11 WriteParam(m, p.num_entries); |
12 WriteParam(m, p.get_offset); | 12 WriteParam(m, p.get_offset); |
13 WriteParam(m, p.put_offset); | 13 WriteParam(m, p.put_offset); |
14 WriteParam(m, p.token); | 14 WriteParam(m, p.token); |
15 WriteParam(m, static_cast<int32>(p.error)); | 15 WriteParam(m, static_cast<int32>(p.error)); |
16 WriteParam(m, p.generation); | 16 WriteParam(m, p.generation); |
17 } | 17 } |
18 | 18 |
19 bool ParamTraits<gpu::CommandBuffer::State> ::Read(const Message* m, | 19 bool ParamTraits<gpu::CommandBuffer::State> ::Read(const Message* m, |
20 void** iter, | 20 PickleIterator* iter, |
21 param_type* p) { | 21 param_type* p) { |
22 int32 temp; | 22 int32 temp; |
23 if (ReadParam(m, iter, &p->num_entries) && | 23 if (ReadParam(m, iter, &p->num_entries) && |
24 ReadParam(m, iter, &p->get_offset) && | 24 ReadParam(m, iter, &p->get_offset) && |
25 ReadParam(m, iter, &p->put_offset) && | 25 ReadParam(m, iter, &p->put_offset) && |
26 ReadParam(m, iter, &p->token) && | 26 ReadParam(m, iter, &p->token) && |
27 ReadParam(m, iter, &temp) && | 27 ReadParam(m, iter, &temp) && |
28 ReadParam(m, iter, &p->generation)) { | 28 ReadParam(m, iter, &p->generation)) { |
29 p->error = static_cast<gpu::error::Error>(temp); | 29 p->error = static_cast<gpu::error::Error>(temp); |
30 return true; | 30 return true; |
31 } else { | 31 } else { |
32 return false; | 32 return false; |
33 } | 33 } |
34 } | 34 } |
35 | 35 |
36 void ParamTraits<gpu::CommandBuffer::State> ::Log(const param_type& p, | 36 void ParamTraits<gpu::CommandBuffer::State> ::Log(const param_type& p, |
37 std::string* l) { | 37 std::string* l) { |
38 l->append("<CommandBuffer::State>"); | 38 l->append("<CommandBuffer::State>"); |
39 } | 39 } |
40 | 40 |
41 } // namespace IPC | 41 } // namespace IPC |
OLD | NEW |