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

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

Issue 105743004: Add gpu::MailboxHolder to hold state for a gpu::Mailbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: c301e01d Rebase. Created 6 years, 11 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
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 #include "gpu/command_buffer/common/mailbox.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,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 DCHECK(bytes); 52 DCHECK(bytes);
53 memcpy(p->name, bytes, sizeof(p->name)); 53 memcpy(p->name, bytes, sizeof(p->name));
54 return true; 54 return true;
55 } 55 }
56 56
57 void ParamTraits<gpu::Mailbox>::Log(const param_type& p, std::string* l) { 57 void ParamTraits<gpu::Mailbox>::Log(const param_type& p, std::string* l) {
58 for (size_t i = 0; i < sizeof(p.name); ++i) 58 for (size_t i = 0; i < sizeof(p.name); ++i)
59 *l += base::StringPrintf("%02x", p.name[i]); 59 *l += base::StringPrintf("%02x", p.name[i]);
60 } 60 }
61 61
62 void ParamTraits<gpu::MailboxHolder>::Write(Message* m, const param_type& p) {
63 WriteParam(m, p.mailbox);
64 WriteParam(m, p.texture_target);
65 WriteParam(m, p.sync_point);
66 }
67
68 bool ParamTraits<gpu::MailboxHolder>::Read(const Message* m,
69 PickleIterator* iter,
70 param_type* p) {
71 if (!ReadParam(m, iter, &p->mailbox) ||
72 !ReadParam(m, iter, &p->texture_target) ||
73 !ReadParam(m, iter, &p->sync_point))
74 return false;
75 return true;
76 }
77
78 void ParamTraits<gpu::MailboxHolder>::Log(const param_type& p, std::string* l) {
79 ParamTraits<gpu::Mailbox>::Log(p.mailbox, l);
80 *l += base::StringPrintf(":%04x@%d", p.texture_target, p.sync_point);
81 }
62 82
63 } // namespace IPC 83 } // namespace IPC
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698