OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Multiply-included message file, hence no include guard here, but see below | 5 // Multiply-included message file, hence no include guard here, but see below |
6 // for a much smaller-than-usual include guard section. | 6 // for a much smaller-than-usual include guard section. |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/shared_memory.h" | 11 #include "base/shared_memory.h" |
12 #include "content/common/common_param_traits.h" | 12 #include "content/common/common_param_traits.h" |
13 #include "content/common/gpu/gpu_info.h" | 13 #include "content/common/gpu/gpu_info.h" |
14 #include "content/common/gpu/gpu_process_launch_causes.h" | 14 #include "content/common/gpu/gpu_process_launch_causes.h" |
15 #include "gpu/command_buffer/common/command_buffer.h" | 15 #include "gpu/command_buffer/common/command_buffer.h" |
16 #include "gpu/command_buffer/common/constants.h" | 16 #include "gpu/command_buffer/common/constants.h" |
17 #include "gpu/ipc/gpu_command_buffer_traits.h" | 17 #include "gpu/ipc/gpu_command_buffer_traits.h" |
18 #include "ipc/ipc_channel_handle.h" | 18 #include "ipc/ipc_channel_handle.h" |
19 #include "ipc/ipc_message_macros.h" | 19 #include "ipc/ipc_message_macros.h" |
20 #include "media/video/video_decode_accelerator.h" | 20 #include "media/video/video_decode_accelerator.h" |
| 21 #include "ui/gfx/gl/gpu_preference.h" |
21 #include "ui/gfx/native_widget_types.h" | 22 #include "ui/gfx/native_widget_types.h" |
22 #include "ui/gfx/size.h" | 23 #include "ui/gfx/size.h" |
23 #include "ui/gfx/surface/transport_dib.h" | 24 #include "ui/gfx/surface/transport_dib.h" |
24 | 25 |
25 #define IPC_MESSAGE_START GpuMsgStart | 26 #define IPC_MESSAGE_START GpuMsgStart |
26 | 27 |
27 IPC_STRUCT_BEGIN(GPUCreateCommandBufferConfig) | 28 IPC_STRUCT_BEGIN(GPUCreateCommandBufferConfig) |
28 IPC_STRUCT_MEMBER(int32, share_group_id) | 29 IPC_STRUCT_MEMBER(int32, share_group_id) |
29 IPC_STRUCT_MEMBER(std::string, allowed_extensions) | 30 IPC_STRUCT_MEMBER(std::string, allowed_extensions) |
30 IPC_STRUCT_MEMBER(std::vector<int>, attribs) | 31 IPC_STRUCT_MEMBER(std::vector<int>, attribs) |
31 IPC_STRUCT_MEMBER(GURL, active_url) | 32 IPC_STRUCT_MEMBER(GURL, active_url) |
| 33 IPC_STRUCT_MEMBER(gfx::GpuPreference, gpu_preference) |
32 IPC_STRUCT_END() | 34 IPC_STRUCT_END() |
33 | 35 |
34 #if defined(OS_MACOSX) | 36 #if defined(OS_MACOSX) |
35 IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceNew_Params) | 37 IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceNew_Params) |
36 IPC_STRUCT_MEMBER(int32, renderer_id) | 38 IPC_STRUCT_MEMBER(int32, renderer_id) |
37 IPC_STRUCT_MEMBER(int32, render_view_id) | 39 IPC_STRUCT_MEMBER(int32, render_view_id) |
38 IPC_STRUCT_MEMBER(gfx::PluginWindowHandle, window) | 40 IPC_STRUCT_MEMBER(gfx::PluginWindowHandle, window) |
39 IPC_STRUCT_MEMBER(int32, width) | 41 IPC_STRUCT_MEMBER(int32, width) |
40 IPC_STRUCT_MEMBER(int32, height) | 42 IPC_STRUCT_MEMBER(int32, height) |
41 IPC_STRUCT_MEMBER(uint64, surface_id) | 43 IPC_STRUCT_MEMBER(uint64, surface_id) |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 IPC_STRUCT_TRAITS_MEMBER(gl_vendor) | 107 IPC_STRUCT_TRAITS_MEMBER(gl_vendor) |
106 IPC_STRUCT_TRAITS_MEMBER(gl_renderer) | 108 IPC_STRUCT_TRAITS_MEMBER(gl_renderer) |
107 IPC_STRUCT_TRAITS_MEMBER(gl_extensions) | 109 IPC_STRUCT_TRAITS_MEMBER(gl_extensions) |
108 IPC_STRUCT_TRAITS_MEMBER(can_lose_context) | 110 IPC_STRUCT_TRAITS_MEMBER(can_lose_context) |
109 #if defined(OS_WIN) | 111 #if defined(OS_WIN) |
110 IPC_STRUCT_TRAITS_MEMBER(dx_diagnostics) | 112 IPC_STRUCT_TRAITS_MEMBER(dx_diagnostics) |
111 #endif | 113 #endif |
112 IPC_STRUCT_TRAITS_END() | 114 IPC_STRUCT_TRAITS_END() |
113 | 115 |
114 IPC_ENUM_TRAITS(content::CauseForGpuLaunch) | 116 IPC_ENUM_TRAITS(content::CauseForGpuLaunch) |
| 117 IPC_ENUM_TRAITS(gfx::GpuPreference) |
115 IPC_ENUM_TRAITS(gpu::error::ContextLostReason) | 118 IPC_ENUM_TRAITS(gpu::error::ContextLostReason) |
116 | 119 |
117 IPC_ENUM_TRAITS(media::VideoDecodeAccelerator::Profile) | 120 IPC_ENUM_TRAITS(media::VideoDecodeAccelerator::Profile) |
118 | 121 |
119 //------------------------------------------------------------------------------ | 122 //------------------------------------------------------------------------------ |
120 // GPU Messages | 123 // GPU Messages |
121 // These are messages from the browser to the GPU process. | 124 // These are messages from the browser to the GPU process. |
122 | 125 |
123 // Tells the GPU process to initialize itself. The browser explicitly | 126 // Tells the GPU process to initialize itself. The browser explicitly |
124 // requests this be done so that we are guaranteed that the channel is set | 127 // requests this be done so that we are guaranteed that the channel is set |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 | 292 |
290 // Create a TransportTexture corresponding to |host_id|. | 293 // Create a TransportTexture corresponding to |host_id|. |
291 IPC_MESSAGE_CONTROL2(GpuChannelMsg_CreateTransportTexture, | 294 IPC_MESSAGE_CONTROL2(GpuChannelMsg_CreateTransportTexture, |
292 int32, /* context_route_id */ | 295 int32, /* context_route_id */ |
293 int32 /* host_id */) | 296 int32 /* host_id */) |
294 | 297 |
295 // Request that the GPU process reply with the given message. | 298 // Request that the GPU process reply with the given message. |
296 IPC_MESSAGE_CONTROL1(GpuChannelMsg_Echo, | 299 IPC_MESSAGE_CONTROL1(GpuChannelMsg_Echo, |
297 IPC::Message /* reply */) | 300 IPC::Message /* reply */) |
298 | 301 |
| 302 // Asks the GPU process whether the creation or destruction of a |
| 303 // command buffer on the given GPU (integrated or discrete) will cause |
| 304 // the system to switch which GPU it is using. All contexts that share |
| 305 // resources need to be created on the same GPU. |
| 306 IPC_SYNC_MESSAGE_CONTROL2_1(GpuChannelMsg_WillGpuSwitchOccur, |
| 307 bool /* is_creating_context */, |
| 308 gfx::GpuPreference /* preference */, |
| 309 bool /* will_cause_switch */) |
| 310 |
| 311 // Forcibly closes the channel on the GPU process side, in order to |
| 312 // have the side effect that all contexts associated with this |
| 313 // renderer go into the lost state. |
| 314 IPC_MESSAGE_CONTROL0(GpuChannelMsg_CloseChannel) |
| 315 |
299 //------------------------------------------------------------------------------ | 316 //------------------------------------------------------------------------------ |
300 // GPU Command Buffer Messages | 317 // GPU Command Buffer Messages |
301 // These are messages between a renderer process to the GPU process relating to | 318 // These are messages between a renderer process to the GPU process relating to |
302 // a single OpenGL context. | 319 // a single OpenGL context. |
303 // Initialize a command buffer with the given number of command entries. | 320 // Initialize a command buffer with the given number of command entries. |
304 // Returns the shared memory handle for the command buffer mapped to the | 321 // Returns the shared memory handle for the command buffer mapped to the |
305 // calling process. | 322 // calling process. |
306 IPC_SYNC_MESSAGE_ROUTED2_1(GpuCommandBufferMsg_Initialize, | 323 IPC_SYNC_MESSAGE_ROUTED2_1(GpuCommandBufferMsg_Initialize, |
307 base::SharedMemoryHandle /* ring_buffer */, | 324 base::SharedMemoryHandle /* ring_buffer */, |
308 int32 /* size */, | 325 int32 /* size */, |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 | 515 |
499 // Confirm decoder has been reset. | 516 // Confirm decoder has been reset. |
500 IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_ResetDone) | 517 IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_ResetDone) |
501 | 518 |
502 // Decoder has faced end of stream marker in the stream. | 519 // Decoder has faced end of stream marker in the stream. |
503 IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_EndOfStream) | 520 IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_EndOfStream) |
504 | 521 |
505 // Video decoder has encountered an error. | 522 // Video decoder has encountered an error. |
506 IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderHostMsg_ErrorNotification, | 523 IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderHostMsg_ErrorNotification, |
507 uint32) /* Error ID */ | 524 uint32) /* Error ID */ |
OLD | NEW |