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

Unified 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, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/ipc/gpu_command_buffer_traits.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/gpu_command_buffer_traits.cc
diff --git a/gpu/ipc/gpu_command_buffer_traits.cc b/gpu/ipc/gpu_command_buffer_traits.cc
index b502b0fd1bb4c36660fbc2cd21d2a9fe38913b0b..d9fc17d166070026a45c915f5a68b5b6ff5227c2 100644
--- a/gpu/ipc/gpu_command_buffer_traits.cc
+++ b/gpu/ipc/gpu_command_buffer_traits.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "gpu/ipc/gpu_command_buffer_traits.h"
+#include "gpu/command_buffer/common/mailbox.h"
namespace IPC {
@@ -38,4 +39,25 @@ void ParamTraits<gpu::CommandBuffer::State> ::Log(const param_type& p,
l->append("<CommandBuffer::State>");
}
+void ParamTraits<gpu::Mailbox>::Write(Message* m, const param_type& p) {
+ m->WriteBytes(p.name, sizeof(p.name));
+}
+
+bool ParamTraits<gpu::Mailbox>::Read(const Message* m,
+ PickleIterator* iter,
+ param_type* p) {
+ const char* bytes = NULL;
+ if (!m->ReadBytes(iter, &bytes, sizeof(p->name)))
+ return false;
+ DCHECK(bytes);
+ memcpy(p->name, bytes, sizeof(p->name));
+ return true;
+}
+
+void ParamTraits<gpu::Mailbox>::Log(const param_type& p, std::string* l) {
+ for (size_t i = 0; i < sizeof(p.name); ++i)
+ *l += base::StringPrintf("%02x", p.name[i]);
+}
+
+
} // namespace IPC
« 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