Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef GPU_IPC_COMMON_GPU_COMMAND_BUFFER_TRAITS_H_ | 5 #ifndef GPU_IPC_COMMON_GPU_COMMAND_BUFFER_TRAITS_H_ |
| 6 #define GPU_IPC_COMMON_GPU_COMMAND_BUFFER_TRAITS_H_ | 6 #define GPU_IPC_COMMON_GPU_COMMAND_BUFFER_TRAITS_H_ |
| 7 | 7 |
| 8 #include "gpu/command_buffer/common/command_buffer.h" | 8 #include "gpu/command_buffer/common/command_buffer.h" |
| 9 #include "gpu/command_buffer/common/id_type.h" | 9 #include "gpu/command_buffer/common/id_type.h" |
| 10 #include "gpu/gpu_export.h" | 10 #include "gpu/gpu_export.h" |
| 11 #include "gpu/ipc/common/gpu_command_buffer_traits_multi.h" | 11 #include "gpu/ipc/common/gpu_command_buffer_traits_multi.h" |
| 12 #include "ipc/ipc_message_utils.h" | 12 #include "ipc/ipc_message_utils.h" |
| 13 #include "ipc/ipc_param_traits.h" | 13 #include "ipc/ipc_param_traits.h" |
| 14 | 14 |
| 15 namespace gpu { | 15 namespace gpu { |
| 16 struct Mailbox; | 16 struct Mailbox; |
| 17 struct MailboxHolder; | 17 struct MailboxHolder; |
| 18 struct SyncToken; | 18 struct SyncToken; |
| 19 struct TextureInUseResponse; | |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace IPC { | 22 namespace IPC { |
| 22 | 23 |
| 23 template <> | 24 template <> |
| 24 struct GPU_EXPORT ParamTraits<gpu::CommandBuffer::State> { | 25 struct GPU_EXPORT ParamTraits<gpu::CommandBuffer::State> { |
| 25 using param_type = gpu::CommandBuffer::State; | 26 using param_type = gpu::CommandBuffer::State; |
| 26 static void GetSize(base::PickleSizer* s, const param_type& p); | 27 static void GetSize(base::PickleSizer* s, const param_type& p); |
| 27 static void Write(base::Pickle* m, const param_type& p); | 28 static void Write(base::Pickle* m, const param_type& p); |
| 28 static bool Read(const base::Pickle* m, | 29 static bool Read(const base::Pickle* m, |
| 29 base::PickleIterator* iter, | 30 base::PickleIterator* iter, |
| 30 param_type* p); | 31 param_type* p); |
| 31 static void Log(const param_type& p, std::string* l); | 32 static void Log(const param_type& p, std::string* l); |
| 32 }; | 33 }; |
| 33 | 34 |
| 34 template <> | 35 template <> |
| 35 struct GPU_EXPORT ParamTraits<gpu::SyncToken> { | 36 struct GPU_EXPORT ParamTraits<gpu::SyncToken> { |
| 36 using param_type = gpu::SyncToken; | 37 using param_type = gpu::SyncToken; |
| 37 static void GetSize(base::PickleSizer* s, const param_type& p); | 38 static void GetSize(base::PickleSizer* s, const param_type& p); |
| 38 static void Write(base::Pickle* m, const param_type& p); | 39 static void Write(base::Pickle* m, const param_type& p); |
| 39 static bool Read(const base::Pickle* m, | 40 static bool Read(const base::Pickle* m, |
| 40 base::PickleIterator* iter, | 41 base::PickleIterator* iter, |
| 41 param_type* p); | 42 param_type* p); |
| 42 static void Log(const param_type& p, std::string* l); | 43 static void Log(const param_type& p, std::string* l); |
| 43 }; | 44 }; |
| 44 | 45 |
| 46 template <> | |
| 47 struct GPU_EXPORT ParamTraits<gpu::TextureInUseResponse> { | |
|
piman
2016/06/15 00:37:47
nit: could this be a IPC_STRUCT_TRAITS in gpu_mess
erikchen
2016/06/15 00:44:01
I tried that at first. gpu_messages.h is a multip
| |
| 48 using param_type = gpu::TextureInUseResponse; | |
| 49 static void GetSize(base::PickleSizer* s, const param_type& p); | |
| 50 static void Write(base::Pickle* m, const param_type& p); | |
| 51 static bool Read(const base::Pickle* m, | |
| 52 base::PickleIterator* iter, | |
| 53 param_type* p); | |
| 54 static void Log(const param_type& p, std::string* l); | |
| 55 }; | |
| 56 | |
| 45 template<> | 57 template<> |
| 46 struct GPU_EXPORT ParamTraits<gpu::Mailbox> { | 58 struct GPU_EXPORT ParamTraits<gpu::Mailbox> { |
| 47 using param_type = gpu::Mailbox; | 59 using param_type = gpu::Mailbox; |
| 48 static void GetSize(base::PickleSizer* s, const param_type& p); | 60 static void GetSize(base::PickleSizer* s, const param_type& p); |
| 49 static void Write(base::Pickle* m, const param_type& p); | 61 static void Write(base::Pickle* m, const param_type& p); |
| 50 static bool Read(const base::Pickle* m, | 62 static bool Read(const base::Pickle* m, |
| 51 base::PickleIterator* iter, | 63 base::PickleIterator* iter, |
| 52 param_type* p); | 64 param_type* p); |
| 53 static void Log(const param_type& p, std::string* l); | 65 static void Log(const param_type& p, std::string* l); |
| 54 }; | 66 }; |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 83 return true; | 95 return true; |
| 84 } | 96 } |
| 85 static void Log(const param_type& p, std::string* l) { | 97 static void Log(const param_type& p, std::string* l) { |
| 86 LogParam(p.GetUnsafeValue(), l); | 98 LogParam(p.GetUnsafeValue(), l); |
| 87 } | 99 } |
| 88 }; | 100 }; |
| 89 | 101 |
| 90 } // namespace IPC | 102 } // namespace IPC |
| 91 | 103 |
| 92 #endif // GPU_IPC_COMMON_GPU_COMMAND_BUFFER_TRAITS_H_ | 104 #endif // GPU_IPC_COMMON_GPU_COMMAND_BUFFER_TRAITS_H_ |
| OLD | NEW |