OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_COMMON_GPU_MESSAGES_H_ | 5 #ifndef CHROME_COMMON_GPU_MESSAGES_H_ |
6 #define CHROME_COMMON_GPU_MESSAGES_H_ | 6 #define CHROME_COMMON_GPU_MESSAGES_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/process.h" | 12 #include "base/process.h" |
13 #include "chrome/common/common_param_traits.h" | 13 #include "chrome/common/common_param_traits.h" |
14 #include "chrome/common/gpu_info.h" | 14 #include "chrome/common/gpu_info.h" |
15 #include "chrome/common/gpu_native_window_handle.h" | 15 #include "chrome/common/gpu_native_window_handle.h" |
16 #include "gfx/native_widget_types.h" | 16 #include "gfx/native_widget_types.h" |
17 #include "gfx/rect.h" | 17 #include "gfx/rect.h" |
18 #include "gfx/size.h" | 18 #include "gfx/size.h" |
19 #include "gpu/command_buffer/common/command_buffer.h" | 19 #include "gpu/command_buffer/common/command_buffer.h" |
20 | 20 |
| 21 #if defined(OS_MACOSX) |
| 22 // Parameters for the GpuHostMsg_AcceleratedSurfaceSetIOSurface |
| 23 // message, which has too many parameters to be sent with the |
| 24 // predefined IPC macros. |
| 25 struct GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params { |
| 26 int32 renderer_id; |
| 27 int32 render_view_id; |
| 28 gfx::PluginWindowHandle window; |
| 29 int32 width; |
| 30 int32 height; |
| 31 uint64 identifier; |
| 32 |
| 33 GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params() |
| 34 : renderer_id(0), |
| 35 render_view_id(0), |
| 36 window(NULL), |
| 37 width(0), |
| 38 height(0), |
| 39 identifier(0) { |
| 40 } |
| 41 }; |
| 42 #endif |
| 43 |
21 namespace IPC { | 44 namespace IPC { |
| 45 #if defined(OS_MACOSX) |
| 46 template <> |
| 47 struct ParamTraits<GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params> { |
| 48 typedef GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params param_type; |
| 49 static void Write(Message* m, const param_type& p) { |
| 50 WriteParam(m, p.renderer_id); |
| 51 WriteParam(m, p.render_view_id); |
| 52 WriteParam(m, p.window); |
| 53 WriteParam(m, p.width); |
| 54 WriteParam(m, p.height); |
| 55 WriteParam(m, p.identifier); |
| 56 } |
| 57 static bool Read(const Message* m, void** iter, param_type* p) { |
| 58 return ReadParam(m, iter, &p->renderer_id) && |
| 59 ReadParam(m, iter, &p->render_view_id) && |
| 60 ReadParam(m, iter, &p->window) && |
| 61 ReadParam(m, iter, &p->width) && |
| 62 ReadParam(m, iter, &p->height) && |
| 63 ReadParam(m, iter, &p->identifier); |
| 64 } |
| 65 static void Log(const param_type& p, std::wstring* l) { |
| 66 l->append(L"("); |
| 67 LogParam(p.renderer_id, l); |
| 68 l->append(L", "); |
| 69 LogParam(p.render_view_id, l); |
| 70 l->append(L", "); |
| 71 LogParam(p.window, l); |
| 72 l->append(L", "); |
| 73 LogParam(p.width, l); |
| 74 l->append(L", "); |
| 75 LogParam(p.height, l); |
| 76 l->append(L", "); |
| 77 LogParam(p.identifier, l); |
| 78 l->append(L")"); |
| 79 } |
| 80 }; |
| 81 #endif |
| 82 |
22 template <> | 83 template <> |
23 struct ParamTraits<GPUInfo> { | 84 struct ParamTraits<GPUInfo> { |
24 typedef GPUInfo param_type; | 85 typedef GPUInfo param_type; |
25 static void Write(Message* m, const param_type& p) { | 86 static void Write(Message* m, const param_type& p) { |
26 m->WriteUInt32(p.vendor_id()); | 87 m->WriteUInt32(p.vendor_id()); |
27 m->WriteUInt32(p.device_id()); | 88 m->WriteUInt32(p.device_id()); |
28 m->WriteWString(p.driver_version()); | 89 m->WriteWString(p.driver_version()); |
29 m->WriteUInt32(p.pixel_shader_version()); | 90 m->WriteUInt32(p.pixel_shader_version()); |
30 m->WriteUInt32(p.vertex_shader_version()); | 91 m->WriteUInt32(p.vertex_shader_version()); |
31 } | 92 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 l->append(L"<CommandBuffer::State>"); | 138 l->append(L"<CommandBuffer::State>"); |
78 } | 139 } |
79 }; | 140 }; |
80 } // namespace IPC | 141 } // namespace IPC |
81 | 142 |
82 #define MESSAGES_INTERNAL_FILE \ | 143 #define MESSAGES_INTERNAL_FILE \ |
83 "chrome/common/gpu_messages_internal.h" | 144 "chrome/common/gpu_messages_internal.h" |
84 #include "ipc/ipc_message_macros.h" | 145 #include "ipc/ipc_message_macros.h" |
85 | 146 |
86 #endif // CHROME_COMMON_GPU_MESSAGES_H_ | 147 #endif // CHROME_COMMON_GPU_MESSAGES_H_ |
OLD | NEW |