OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 MOJO_SERVICES_GLES2_COMMAND_BUFFER_TYPE_CONVERSIONS_H_ | 5 #ifndef MOJO_SERVICES_GLES2_COMMAND_BUFFER_TYPE_CONVERSIONS_H_ |
6 #define MOJO_SERVICES_GLES2_COMMAND_BUFFER_TYPE_CONVERSIONS_H_ | 6 #define MOJO_SERVICES_GLES2_COMMAND_BUFFER_TYPE_CONVERSIONS_H_ |
7 | 7 |
8 #include "base/memory/shared_memory.h" | |
9 #include "gpu/command_buffer/common/command_buffer.h" | 8 #include "gpu/command_buffer/common/command_buffer.h" |
10 #include "mojo/public/cpp/bindings/type_converter.h" | 9 #include "mojo/public/cpp/bindings/type_converter.h" |
11 | 10 |
12 namespace mojo { | 11 namespace mojo { |
13 | 12 |
14 class ShmHandle; | |
15 class CommandBufferState; | 13 class CommandBufferState; |
16 class Buffer; | 14 class Buffer; |
17 | 15 |
18 template <> | 16 template <> |
19 class TypeConverter<ShmHandle, base::SharedMemoryHandle> { | |
20 public: | |
21 static ShmHandle ConvertFrom(const base::SharedMemoryHandle& input, | |
22 Buffer* buffer); | |
23 static base::SharedMemoryHandle ConvertTo(const ShmHandle& input); | |
24 }; | |
25 | |
26 template <> | |
27 class TypeConverter<CommandBufferState, gpu::CommandBuffer::State> { | 17 class TypeConverter<CommandBufferState, gpu::CommandBuffer::State> { |
28 public: | 18 public: |
29 static CommandBufferState ConvertFrom(const gpu::CommandBuffer::State& input, | 19 static CommandBufferState ConvertFrom(const gpu::CommandBuffer::State& input, |
30 Buffer* buffer); | 20 Buffer* buffer); |
31 static gpu::CommandBuffer::State ConvertTo(const CommandBufferState& input); | 21 static gpu::CommandBuffer::State ConvertTo(const CommandBufferState& input); |
32 }; | 22 }; |
33 | 23 |
34 } // namespace mojo | 24 } // namespace mojo |
35 | 25 |
36 #endif // MOJO_SERVICES_GLES2_COMMAND_BUFFER_TYPE_CONVERSIONS_H_ | 26 #endif // MOJO_SERVICES_GLES2_COMMAND_BUFFER_TYPE_CONVERSIONS_H_ |
OLD | NEW |