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

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

Issue 12378053: Move Mailbox from cc to gpu, and its traits to gpu/ipc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ios hate Created 7 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') | no next file » | 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) 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.h"
6 7
7 namespace IPC { 8 namespace IPC {
8 9
9 void ParamTraits<gpu::CommandBuffer::State> ::Write(Message* m, 10 void ParamTraits<gpu::CommandBuffer::State> ::Write(Message* m,
10 const param_type& p) { 11 const param_type& p) {
11 WriteParam(m, p.num_entries); 12 WriteParam(m, p.num_entries);
12 WriteParam(m, p.get_offset); 13 WriteParam(m, p.get_offset);
13 WriteParam(m, p.put_offset); 14 WriteParam(m, p.put_offset);
14 WriteParam(m, p.token); 15 WriteParam(m, p.token);
15 WriteParam(m, static_cast<int32>(p.error)); 16 WriteParam(m, static_cast<int32>(p.error));
(...skipping 15 matching lines...) Expand all
31 } else { 32 } else {
32 return false; 33 return false;
33 } 34 }
34 } 35 }
35 36
36 void ParamTraits<gpu::CommandBuffer::State> ::Log(const param_type& p, 37 void ParamTraits<gpu::CommandBuffer::State> ::Log(const param_type& p,
37 std::string* l) { 38 std::string* l) {
38 l->append("<CommandBuffer::State>"); 39 l->append("<CommandBuffer::State>");
39 } 40 }
40 41
42 void ParamTraits<gpu::Mailbox>::Write(Message* m, const param_type& p) {
43 m->WriteBytes(p.name, sizeof(p.name));
44 }
45
46 bool ParamTraits<gpu::Mailbox>::Read(const Message* m,
47 PickleIterator* iter,
48 param_type* p) {
49 const char* bytes = NULL;
50 if (!m->ReadBytes(iter, &bytes, sizeof(p->name)))
51 return false;
52 DCHECK(bytes);
53 memcpy(p->name, bytes, sizeof(p->name));
54 return true;
55 }
56
57 void ParamTraits<gpu::Mailbox>::Log(const param_type& p, std::string* l) {
58 for (size_t i = 0; i < sizeof(p.name); ++i)
59 *l += base::StringPrintf("%02x", p.name[i]);
60 }
61
62
41 } // namespace IPC 63 } // namespace IPC
OLDNEW
« no previous file with comments | « gpu/ipc/gpu_command_buffer_traits.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698