OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/string_piece.h" | 5 #include "base/string_piece.h" |
6 #include "base/sys_string_conversions.h" | 6 #include "base/sys_string_conversions.h" |
7 #include "chrome/common/gpu_create_command_buffer_config.h" | 7 #include "chrome/common/gpu_create_command_buffer_config.h" |
8 #include "chrome/common/gpu_info.h" | 8 #include "chrome/common/gpu_info.h" |
9 #include "chrome/common/dx_diag_node.h" | 9 #include "chrome/common/dx_diag_node.h" |
10 #include "gfx/rect.h" | 10 #include "gfx/rect.h" |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 param_type* p) { | 246 param_type* p) { |
247 bool ret = ReadParam(m, iter, &p->values); | 247 bool ret = ReadParam(m, iter, &p->values); |
248 ret = ret && ReadParam(m, iter, &p->children); | 248 ret = ret && ReadParam(m, iter, &p->children); |
249 return ret; | 249 return ret; |
250 } | 250 } |
251 | 251 |
252 void ParamTraits<DxDiagNode> ::Log(const param_type& p, std::string* l) { | 252 void ParamTraits<DxDiagNode> ::Log(const param_type& p, std::string* l) { |
253 l->append("<DxDiagNode>"); | 253 l->append("<DxDiagNode>"); |
254 } | 254 } |
255 | 255 |
256 void ParamTraits<gpu::CommandBuffer::State> ::Write(Message* m, | |
257 const param_type& p) { | |
258 WriteParam(m, p.num_entries); | |
259 WriteParam(m, p.get_offset); | |
260 WriteParam(m, p.put_offset); | |
261 WriteParam(m, p.token); | |
262 WriteParam(m, static_cast<int32>(p.error)); | |
263 } | |
264 | |
265 bool ParamTraits<gpu::CommandBuffer::State> ::Read(const Message* m, | |
266 void** iter, | |
267 param_type* p) { | |
268 int32 temp; | |
269 if (ReadParam(m, iter, &p->num_entries) && | |
270 ReadParam(m, iter, &p->get_offset) && | |
271 ReadParam(m, iter, &p->put_offset) && | |
272 ReadParam(m, iter, &p->token) && | |
273 ReadParam(m, iter, &temp)) { | |
274 p->error = static_cast<gpu::error::Error>(temp); | |
275 return true; | |
276 } else { | |
277 return false; | |
278 } | |
279 } | |
280 | |
281 void ParamTraits<gpu::CommandBuffer::State> ::Log(const param_type& p, | |
282 std::string* l) { | |
283 l->append("<CommandBuffer::State>"); | |
284 } | |
285 | |
286 void ParamTraits<GPUCreateCommandBufferConfig> ::Write( | 256 void ParamTraits<GPUCreateCommandBufferConfig> ::Write( |
287 Message* m, const param_type& p) { | 257 Message* m, const param_type& p) { |
288 WriteParam(m, p.allowed_extensions); | 258 WriteParam(m, p.allowed_extensions); |
289 WriteParam(m, p.attribs); | 259 WriteParam(m, p.attribs); |
290 } | 260 } |
291 | 261 |
292 bool ParamTraits<GPUCreateCommandBufferConfig> ::Read( | 262 bool ParamTraits<GPUCreateCommandBufferConfig> ::Read( |
293 const Message* m, void** iter, param_type* p) { | 263 const Message* m, void** iter, param_type* p) { |
294 if (!ReadParam(m, iter, &p->allowed_extensions) || | 264 if (!ReadParam(m, iter, &p->allowed_extensions) || |
295 !ReadParam(m, iter, &p->attribs)) { | 265 !ReadParam(m, iter, &p->attribs)) { |
296 return false; | 266 return false; |
297 } | 267 } |
298 return true; | 268 return true; |
299 } | 269 } |
300 | 270 |
301 void ParamTraits<GPUCreateCommandBufferConfig> ::Log( | 271 void ParamTraits<GPUCreateCommandBufferConfig> ::Log( |
302 const param_type& p, std::string* l) { | 272 const param_type& p, std::string* l) { |
303 l->append("<GPUCreateCommandBufferConfig>"); | 273 l->append("<GPUCreateCommandBufferConfig>"); |
304 } | 274 } |
305 | 275 |
306 } // namespace IPC | 276 } // namespace IPC |
OLD | NEW |