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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 290 |
288 // Create a TransportTexture corresponding to |host_id|. | 291 // Create a TransportTexture corresponding to |host_id|. |
289 IPC_MESSAGE_CONTROL2(GpuChannelMsg_CreateTransportTexture, | 292 IPC_MESSAGE_CONTROL2(GpuChannelMsg_CreateTransportTexture, |
290 int32, /* context_route_id */ | 293 int32, /* context_route_id */ |
291 int32 /* host_id */) | 294 int32 /* host_id */) |
292 | 295 |
293 // Request that the GPU process reply with the given message. | 296 // Request that the GPU process reply with the given message. |
294 IPC_MESSAGE_CONTROL1(GpuChannelMsg_Echo, | 297 IPC_MESSAGE_CONTROL1(GpuChannelMsg_Echo, |
295 IPC::Message /* reply */) | 298 IPC::Message /* reply */) |
296 | 299 |
| 300 // Asks the GPU process whether the creation or destruction of a |
| 301 // command buffer on the given GPU (integrated or discrete) will cause |
| 302 // the system to switch which GPU it is using. All contexts that share |
| 303 // resources need to be created on the same GPU. |
| 304 IPC_SYNC_MESSAGE_CONTROL2_1(GpuChannelMsg_WillGpuSwitchOccur, |
| 305 bool /* is_creating_context */, |
| 306 gfx::GpuPreference /* preference */, |
| 307 bool /* will_cause_switch */) |
| 308 |
| 309 // Forcibly closes the channel on the GPU process side, in order to |
| 310 // have the side effect that all contexts associated with this |
| 311 // renderer go into the lost state. |
| 312 IPC_MESSAGE_CONTROL0(GpuChannelMsg_CloseChannel) |
| 313 |
297 //------------------------------------------------------------------------------ | 314 //------------------------------------------------------------------------------ |
298 // GPU Command Buffer Messages | 315 // GPU Command Buffer Messages |
299 // These are messages between a renderer process to the GPU process relating to | 316 // These are messages between a renderer process to the GPU process relating to |
300 // a single OpenGL context. | 317 // a single OpenGL context. |
301 // Initialize a command buffer with the given number of command entries. | 318 // Initialize a command buffer with the given number of command entries. |
302 // Returns the shared memory handle for the command buffer mapped to the | 319 // Returns the shared memory handle for the command buffer mapped to the |
303 // calling process. | 320 // calling process. |
304 IPC_SYNC_MESSAGE_ROUTED2_1(GpuCommandBufferMsg_Initialize, | 321 IPC_SYNC_MESSAGE_ROUTED2_1(GpuCommandBufferMsg_Initialize, |
305 base::SharedMemoryHandle /* ring_buffer */, | 322 base::SharedMemoryHandle /* ring_buffer */, |
306 int32 /* size */, | 323 int32 /* size */, |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 | 513 |
497 // Confirm decoder has been reset. | 514 // Confirm decoder has been reset. |
498 IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_ResetDone) | 515 IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_ResetDone) |
499 | 516 |
500 // Decoder has faced end of stream marker in the stream. | 517 // Decoder has faced end of stream marker in the stream. |
501 IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_EndOfStream) | 518 IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_EndOfStream) |
502 | 519 |
503 // Video decoder has encountered an error. | 520 // Video decoder has encountered an error. |
504 IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderHostMsg_ErrorNotification, | 521 IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderHostMsg_ErrorNotification, |
505 uint32) /* Error ID */ | 522 uint32) /* Error ID */ |
OLD | NEW |