Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Side by Side Diff: gpu/ipc/gpu_command_buffer_traits.cc

Issue 9447084: Refactor Pickle Read methods to use higher performance PickleIterator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile (racing with incoming CLs) Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gpu/ipc/gpu_command_buffer_traits.h ('k') | ipc/ipc_channel_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
OLDNEW
« no previous file with comments | « gpu/ipc/gpu_command_buffer_traits.h ('k') | ipc/ipc_channel_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698