OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 // Singly or multiply-included shared traits file depending upon circumstances. | 5 // Singly or multiply-included shared traits file depending upon circumstances. |
6 // This allows the use of IPC serialization macros in more than one IPC message | 6 // This allows the use of IPC serialization macros in more than one IPC message |
7 // file. | 7 // file. |
8 #ifndef UI_GFX_IPC_GFX_PARAM_TRAITS_MACROS_H_ | 8 #ifndef UI_GFX_IPC_GFX_PARAM_TRAITS_MACROS_H_ |
9 #define UI_GFX_IPC_GFX_PARAM_TRAITS_MACROS_H_ | 9 #define UI_GFX_IPC_GFX_PARAM_TRAITS_MACROS_H_ |
10 | 10 |
11 #include "ipc/ipc_message_macros.h" | 11 #include "ipc/ipc_message_macros.h" |
12 #include "ui/gfx/buffer_types.h" | 12 #include "ui/gfx/buffer_types.h" |
13 #include "ui/gfx/gpu_memory_buffer.h" | 13 #include "ui/gfx/gpu_memory_buffer.h" |
14 #include "ui/gfx/ipc/gfx_ipc_export.h" | 14 #include "ui/gfx/ipc/gfx_ipc_export.h" |
15 #include "ui/gfx/selection_bound.h" | 15 #include "ui/gfx/selection_bound.h" |
16 #include "ui/gfx/swap_result.h" | 16 #include "ui/gfx/swap_result.h" |
17 | 17 |
18 #if defined(USE_OZONE) | 18 #if defined(OS_LINUX) |
19 #include "ui/gfx/native_pixmap_handle.h" | 19 #include "ui/gfx/native_pixmap_handle.h" |
20 #endif | 20 #endif |
21 | 21 |
22 #undef IPC_MESSAGE_EXPORT | 22 #undef IPC_MESSAGE_EXPORT |
23 #define IPC_MESSAGE_EXPORT GFX_IPC_EXPORT | 23 #define IPC_MESSAGE_EXPORT GFX_IPC_EXPORT |
24 | 24 |
25 IPC_ENUM_TRAITS_MAX_VALUE(gfx::BufferFormat, gfx::BufferFormat::LAST) | 25 IPC_ENUM_TRAITS_MAX_VALUE(gfx::BufferFormat, gfx::BufferFormat::LAST) |
26 | 26 |
27 IPC_ENUM_TRAITS_MAX_VALUE(gfx::BufferUsage, gfx::BufferUsage::LAST) | 27 IPC_ENUM_TRAITS_MAX_VALUE(gfx::BufferUsage, gfx::BufferUsage::LAST) |
28 | 28 |
29 IPC_ENUM_TRAITS_MAX_VALUE(gfx::GpuMemoryBufferType, | 29 IPC_ENUM_TRAITS_MAX_VALUE(gfx::GpuMemoryBufferType, |
30 gfx::GPU_MEMORY_BUFFER_TYPE_LAST) | 30 gfx::GPU_MEMORY_BUFFER_TYPE_LAST) |
31 | 31 |
32 IPC_ENUM_TRAITS_MAX_VALUE(gfx::SwapResult, gfx::SwapResult::SWAP_RESULT_LAST) | 32 IPC_ENUM_TRAITS_MAX_VALUE(gfx::SwapResult, gfx::SwapResult::SWAP_RESULT_LAST) |
33 | 33 |
34 IPC_ENUM_TRAITS_MAX_VALUE(gfx::SelectionBound::Type, gfx::SelectionBound::LAST); | 34 IPC_ENUM_TRAITS_MAX_VALUE(gfx::SelectionBound::Type, gfx::SelectionBound::LAST); |
35 | 35 |
36 IPC_STRUCT_TRAITS_BEGIN(gfx::GpuMemoryBufferHandle) | 36 IPC_STRUCT_TRAITS_BEGIN(gfx::GpuMemoryBufferHandle) |
37 IPC_STRUCT_TRAITS_MEMBER(id) | 37 IPC_STRUCT_TRAITS_MEMBER(id) |
38 IPC_STRUCT_TRAITS_MEMBER(type) | 38 IPC_STRUCT_TRAITS_MEMBER(type) |
39 IPC_STRUCT_TRAITS_MEMBER(handle) | 39 IPC_STRUCT_TRAITS_MEMBER(handle) |
40 IPC_STRUCT_TRAITS_MEMBER(offset) | 40 IPC_STRUCT_TRAITS_MEMBER(offset) |
41 IPC_STRUCT_TRAITS_MEMBER(stride) | 41 IPC_STRUCT_TRAITS_MEMBER(stride) |
42 #if defined(USE_OZONE) | 42 #if defined(OS_LINUX) |
43 IPC_STRUCT_TRAITS_MEMBER(native_pixmap_handle) | 43 IPC_STRUCT_TRAITS_MEMBER(native_pixmap_handle) |
44 #elif defined(OS_MACOSX) | 44 #elif defined(OS_MACOSX) |
45 IPC_STRUCT_TRAITS_MEMBER(mach_port) | 45 IPC_STRUCT_TRAITS_MEMBER(mach_port) |
46 #endif | 46 #endif |
47 IPC_STRUCT_TRAITS_END() | 47 IPC_STRUCT_TRAITS_END() |
48 | 48 |
49 IPC_STRUCT_TRAITS_BEGIN(gfx::GpuMemoryBufferId) | 49 IPC_STRUCT_TRAITS_BEGIN(gfx::GpuMemoryBufferId) |
50 IPC_STRUCT_TRAITS_MEMBER(id) | 50 IPC_STRUCT_TRAITS_MEMBER(id) |
51 IPC_STRUCT_TRAITS_END() | 51 IPC_STRUCT_TRAITS_END() |
52 | 52 |
53 #if defined(USE_OZONE) | 53 #if defined(OS_LINUX) |
54 IPC_STRUCT_TRAITS_BEGIN(gfx::NativePixmapPlane) | 54 IPC_STRUCT_TRAITS_BEGIN(gfx::NativePixmapPlane) |
55 IPC_STRUCT_TRAITS_MEMBER(stride) | 55 IPC_STRUCT_TRAITS_MEMBER(stride) |
56 IPC_STRUCT_TRAITS_MEMBER(offset) | 56 IPC_STRUCT_TRAITS_MEMBER(offset) |
57 IPC_STRUCT_TRAITS_MEMBER(size) | 57 IPC_STRUCT_TRAITS_MEMBER(size) |
58 IPC_STRUCT_TRAITS_MEMBER(modifier) | 58 IPC_STRUCT_TRAITS_MEMBER(modifier) |
59 IPC_STRUCT_TRAITS_END() | 59 IPC_STRUCT_TRAITS_END() |
60 | 60 |
61 IPC_STRUCT_TRAITS_BEGIN(gfx::NativePixmapHandle) | 61 IPC_STRUCT_TRAITS_BEGIN(gfx::NativePixmapHandle) |
62 IPC_STRUCT_TRAITS_MEMBER(fds) | 62 IPC_STRUCT_TRAITS_MEMBER(fds) |
63 IPC_STRUCT_TRAITS_MEMBER(planes) | 63 IPC_STRUCT_TRAITS_MEMBER(planes) |
64 IPC_STRUCT_TRAITS_END() | 64 IPC_STRUCT_TRAITS_END() |
65 #endif | 65 #endif |
66 | 66 |
67 #undef IPC_MESSAGE_EXPORT | 67 #undef IPC_MESSAGE_EXPORT |
68 #define IPC_MESSAGE_EXPORT | 68 #define IPC_MESSAGE_EXPORT |
69 | 69 |
70 #endif // UI_GFX_IPC_GFX_PARAM_TRAITS_MACROS_H_ | 70 #endif // UI_GFX_IPC_GFX_PARAM_TRAITS_MACROS_H_ |
OLD | NEW |