| 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 ed43cd29d57dd8cee214057921d25b3bb426af61..6a77984f8e44c5ab8327143a749f31857d716cf3 100644
|
| --- a/gpu/ipc/gpu_command_buffer_traits.cc
|
| +++ b/gpu/ipc/gpu_command_buffer_traits.cc
|
| @@ -5,6 +5,7 @@
|
| #include "gpu/ipc/gpu_command_buffer_traits.h"
|
|
|
| #include "gpu/command_buffer/common/mailbox_holder.h"
|
| +#include "gpu/command_buffer/common/sync_token.h"
|
| #include "gpu/command_buffer/common/value_state.h"
|
|
|
| // Generate param traits write methods.
|
| @@ -55,6 +56,44 @@ void ParamTraits<gpu::CommandBuffer::State> ::Log(const param_type& p,
|
| l->append("<CommandBuffer::State>");
|
| }
|
|
|
| +void ParamTraits<gpu::SyncToken>::Write(Message* m, const param_type& p) {
|
| + const int namespace_id = static_cast<int>(p.namespace_id());
|
| + const uint64_t command_buffer_id = p.command_buffer_id();
|
| + const uint64_t release_count = p.release_count();
|
| +
|
| + m->WriteBytes(&namespace_id, sizeof(namespace_id));
|
| + m->WriteBytes(&command_buffer_id, sizeof(command_buffer_id));
|
| + m->WriteBytes(&release_count, sizeof(release_count));
|
| +}
|
| +
|
| +bool ParamTraits<gpu::SyncToken>::Read(const Message* m,
|
| + base::PickleIterator* iter,
|
| + param_type* p) {
|
| + int namespace_id = -1;
|
| + if (!iter->ReadInt(&namespace_id))
|
| + return false;
|
| +
|
| + uint64_t command_buffer_id = 0;
|
| + if (!iter->ReadUInt64(&command_buffer_id))
|
| + return false;
|
| +
|
| + uint64_t release_count = 0;
|
| + if (!iter->ReadUInt64(&release_count))
|
| + return false;
|
| +
|
| + p->Set(static_cast<gpu::CommandBufferNamespace>(namespace_id),
|
| + command_buffer_id,
|
| + release_count);
|
| + return true;
|
| +}
|
| +
|
| +void ParamTraits<gpu::SyncToken>::Log(const param_type& p, std::string* l) {
|
| + *l +=
|
| + base::StringPrintf("[%d:%llX] %llu", static_cast<int>(p.namespace_id()),
|
| + static_cast<unsigned long long>(p.command_buffer_id()),
|
| + static_cast<unsigned long long>(p.release_count()));
|
| +}
|
| +
|
| void ParamTraits<gpu::Mailbox>::Write(Message* m, const param_type& p) {
|
| m->WriteBytes(p.name, sizeof(p.name));
|
| }
|
|
|