| 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 #include <vector> | 5 #include <vector> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/shared_memory.h" | 8 #include "base/shared_memory.h" |
| 9 #include "chrome/common/gpu_video_common.h" | 9 #include "chrome/common/gpu_video_common.h" |
| 10 #include "ipc/ipc_message_macros.h" | 10 #include "ipc/ipc_message_macros.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 IPC_MESSAGE_CONTROL1(GpuMsg_CloseChannel, | 46 IPC_MESSAGE_CONTROL1(GpuMsg_CloseChannel, |
| 47 IPC::ChannelHandle /* channel_handle */) | 47 IPC::ChannelHandle /* channel_handle */) |
| 48 | 48 |
| 49 // Provides a synchronization point to guarantee that the processing of | 49 // Provides a synchronization point to guarantee that the processing of |
| 50 // previous asynchronous messages (i.e., GpuMsg_EstablishChannel) has | 50 // previous asynchronous messages (i.e., GpuMsg_EstablishChannel) has |
| 51 // completed. (This message can't be synchronous because the | 51 // completed. (This message can't be synchronous because the |
| 52 // GpuProcessHost uses an IPC::ChannelProxy, which sends all messages | 52 // GpuProcessHost uses an IPC::ChannelProxy, which sends all messages |
| 53 // asynchronously.) Results in a GpuHostMsg_SynchronizeReply. | 53 // asynchronously.) Results in a GpuHostMsg_SynchronizeReply. |
| 54 IPC_MESSAGE_CONTROL0(GpuMsg_Synchronize) | 54 IPC_MESSAGE_CONTROL0(GpuMsg_Synchronize) |
| 55 | 55 |
| 56 // Tells the GPU process to create a new command buffer that renders directly |
| 57 // to a native view. A corresponding GpuCommandBufferStub is created. |
| 58 IPC_MESSAGE_CONTROL4(GpuMsg_CreateViewCommandBuffer, |
| 59 gfx::PluginWindowHandle, /* view */ |
| 60 int32, /* render_view_id */ |
| 61 int32, /* renderer_id */ |
| 62 GPUCreateCommandBufferConfig /* init_params */) |
| 63 |
| 56 // Tells the GPU process to create a context for collecting graphics card | 64 // Tells the GPU process to create a context for collecting graphics card |
| 57 // information. | 65 // information. |
| 58 IPC_MESSAGE_CONTROL0(GpuMsg_CollectGraphicsInfo) | 66 IPC_MESSAGE_CONTROL0(GpuMsg_CollectGraphicsInfo) |
| 59 | 67 |
| 60 #if defined(OS_MACOSX) | 68 #if defined(OS_MACOSX) |
| 61 // Tells the GPU process that the browser process handled the swap | 69 // Tells the GPU process that the browser process handled the swap |
| 62 // buffers request with the given number. Note that it is possible | 70 // buffers request with the given number. Note that it is possible |
| 63 // for the browser process to coalesce frames; it is not guaranteed | 71 // for the browser process to coalesce frames; it is not guaranteed |
| 64 // that every GpuHostMsg_AcceleratedSurfaceBuffersSwapped message | 72 // that every GpuHostMsg_AcceleratedSurfaceBuffersSwapped message |
| 65 // will result in a buffer swap on the browser side. | 73 // will result in a buffer swap on the browser side. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 83 IPC_MESSAGE_CONTROL0(GpuMsg_Hang) | 91 IPC_MESSAGE_CONTROL0(GpuMsg_Hang) |
| 84 | 92 |
| 85 //------------------------------------------------------------------------------ | 93 //------------------------------------------------------------------------------ |
| 86 // GPU Host Messages | 94 // GPU Host Messages |
| 87 // These are messages from the GPU process to the browser. | 95 // These are messages from the GPU process to the browser. |
| 88 // Response to a GpuHostMsg_EstablishChannel message. | 96 // Response to a GpuHostMsg_EstablishChannel message. |
| 89 IPC_MESSAGE_CONTROL2(GpuHostMsg_ChannelEstablished, | 97 IPC_MESSAGE_CONTROL2(GpuHostMsg_ChannelEstablished, |
| 90 IPC::ChannelHandle, /* channel_handle */ | 98 IPC::ChannelHandle, /* channel_handle */ |
| 91 GPUInfo /* GPU logging stats */) | 99 GPUInfo /* GPU logging stats */) |
| 92 | 100 |
| 101 // Respond to a GpuMsg_CreateViewCommandBuffer message. |
| 102 IPC_MESSAGE_CONTROL1(GpuHostMsg_CommandBufferCreated, |
| 103 int32 /* route_id */) |
| 104 |
| 105 // Free the browser resources associated with the command buffer |
| 106 // (typically a window that was drawn into). |
| 107 IPC_MESSAGE_CONTROL3(GpuHostMsg_DestroyCommandBuffer, |
| 108 gfx::PluginWindowHandle, /* view */ |
| 109 int32, /* render_view_id */ |
| 110 int32 /* renderer_id */) |
| 111 |
| 112 // Response to a GpuMsg_CollectGraphicsInfo. |
| 113 IPC_MESSAGE_CONTROL1(GpuHostMsg_GraphicsInfoCollected, |
| 114 GPUInfo /* GPU logging stats */) |
| 115 |
| 93 // Response to a GpuMsg_Synchronize message. | 116 // Response to a GpuMsg_Synchronize message. |
| 94 IPC_MESSAGE_CONTROL0(GpuHostMsg_SynchronizeReply) | 117 IPC_MESSAGE_CONTROL0(GpuHostMsg_SynchronizeReply) |
| 95 | 118 |
| 96 // Response to a GpuMsg_CollectGraphicsInfo. | |
| 97 IPC_MESSAGE_CONTROL1(GpuHostMsg_GraphicsInfoCollected, | |
| 98 GPUInfo /* GPU logging stats */) | |
| 99 | |
| 100 #if defined(OS_LINUX) | 119 #if defined(OS_LINUX) |
| 101 // Get the XID for a view ID. | 120 // Resize the window that is being drawn into. It's important that this |
| 102 IPC_SYNC_MESSAGE_CONTROL1_1(GpuHostMsg_GetViewXID, | 121 // resize be synchronized with the swapping of the front and back buffers. |
| 103 gfx::NativeViewId, /* view */ | |
| 104 unsigned long /* xid */) | |
| 105 | |
| 106 // Release the lock on the window. | |
| 107 // If the associated view has been destroyed, destroy the window. | |
| 108 IPC_MESSAGE_CONTROL1(GpuHostMsg_ReleaseXID, | |
| 109 unsigned long /* xid */) | |
| 110 | |
| 111 IPC_SYNC_MESSAGE_CONTROL2_1(GpuHostMsg_ResizeXID, | 122 IPC_SYNC_MESSAGE_CONTROL2_1(GpuHostMsg_ResizeXID, |
| 112 unsigned long, /* xid */ | 123 unsigned long, /* xid */ |
| 113 gfx::Size, /* size */ | 124 gfx::Size, /* size */ |
| 114 bool /* success */) | 125 bool /* success */) |
| 115 | |
| 116 #elif defined(OS_MACOSX) | 126 #elif defined(OS_MACOSX) |
| 117 // This message, used on Mac OS X 10.6 and later (where IOSurface is | 127 // This message, used on Mac OS X 10.6 and later (where IOSurface is |
| 118 // supported), is sent from the GPU process to the browser to indicate that a | 128 // supported), is sent from the GPU process to the browser to indicate that a |
| 119 // new backing store was allocated for the given "window" (fake | 129 // new backing store was allocated for the given "window" (fake |
| 120 // PluginWindowHandle). The renderer ID and render view ID are needed in | 130 // PluginWindowHandle). The renderer ID and render view ID are needed in |
| 121 // order to uniquely identify the RenderWidgetHostView on the browser side. | 131 // order to uniquely identify the RenderWidgetHostView on the browser side. |
| 122 IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceSetIOSurface, | 132 IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceSetIOSurface, |
| 123 GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params) | 133 GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params) |
| 124 | 134 |
| 125 // This message notifies the browser process that the renderer | 135 // This message notifies the browser process that the renderer |
| 126 // swapped the buffers associated with the given "window", which | 136 // swapped the buffers associated with the given "window", which |
| 127 // should cause the browser to redraw the compositor's contents. | 137 // should cause the browser to redraw the compositor's contents. |
| 128 IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, | 138 IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, |
| 129 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params) | 139 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params) |
| 130 #elif defined(OS_WIN) | 140 #elif defined(OS_WIN) |
| 131 // Get the HWND for the compositor window and if necessary, create it | |
| 132 IPC_SYNC_MESSAGE_CONTROL2_1(GpuHostMsg_GetCompositorHostWindow, | |
| 133 int32, /* renderer_id */ | |
| 134 int32, /* render_view_id */ | |
| 135 gfx::PluginWindowHandle /* compositor_host_id */) | |
| 136 | |
| 137 IPC_MESSAGE_CONTROL2(GpuHostMsg_ScheduleComposite, | 141 IPC_MESSAGE_CONTROL2(GpuHostMsg_ScheduleComposite, |
| 138 int32, /* renderer_id */ | 142 int32, /* renderer_id */ |
| 139 int32 /* render_view_id */) | 143 int32 /* render_view_id */) |
| 140 #endif | 144 #endif |
| 141 | 145 |
| 142 //------------------------------------------------------------------------------ | 146 //------------------------------------------------------------------------------ |
| 143 // GPU Channel Messages | 147 // GPU Channel Messages |
| 144 // These are messages from a renderer process to the GPU process. | 148 // These are messages from a renderer process to the GPU process. |
| 145 // Tells the GPU process to create a new command buffer that renders directly | |
| 146 // to a native view. The |render_view_id| is currently needed only on Mac OS | |
| 147 // X in order to identify the window on the browser side into which the | |
| 148 // rendering results go. A corresponding GpuCommandBufferStub is created. | |
| 149 IPC_SYNC_MESSAGE_CONTROL3_1(GpuChannelMsg_CreateViewCommandBuffer, | |
| 150 gfx::NativeViewId, /* view */ | |
| 151 int32, /* render_view_id */ | |
| 152 GPUCreateCommandBufferConfig, /* init_params */ | |
| 153 int32 /* route_id */) | |
| 154 | 149 |
| 155 // Tells the GPU process to create a new command buffer that renders to an | 150 // Tells the GPU process to create a new command buffer that renders to an |
| 156 // offscreen frame buffer. If parent_route_id is not zero, the texture backing | 151 // offscreen frame buffer. If parent_route_id is not zero, the texture backing |
| 157 // the frame buffer is mapped into the corresponding parent command buffer's | 152 // the frame buffer is mapped into the corresponding parent command buffer's |
| 158 // namespace, with the name of parent_texture_id. This ID is in the parent's | 153 // namespace, with the name of parent_texture_id. This ID is in the parent's |
| 159 // namespace. | 154 // namespace. |
| 160 IPC_SYNC_MESSAGE_CONTROL4_1(GpuChannelMsg_CreateOffscreenCommandBuffer, | 155 IPC_SYNC_MESSAGE_CONTROL4_1(GpuChannelMsg_CreateOffscreenCommandBuffer, |
| 161 int32, /* parent_route_id */ | 156 int32, /* parent_route_id */ |
| 162 gfx::Size, /* size */ | 157 gfx::Size, /* size */ |
| 163 GPUCreateCommandBufferConfig, /* init_params */ | 158 GPUCreateCommandBufferConfig, /* init_params */ |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 // Release all video frames allocated for a hardware video decoder. | 331 // Release all video frames allocated for a hardware video decoder. |
| 337 IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_ReleaseAllVideoFrames) | 332 IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_ReleaseAllVideoFrames) |
| 338 | 333 |
| 339 // GpuVideoDecoder report output format change. | 334 // GpuVideoDecoder report output format change. |
| 340 IPC_MESSAGE_ROUTED1(GpuVideoDecoderHostMsg_MediaFormatChange, | 335 IPC_MESSAGE_ROUTED1(GpuVideoDecoderHostMsg_MediaFormatChange, |
| 341 GpuVideoDecoderFormatChangeParam) | 336 GpuVideoDecoderFormatChangeParam) |
| 342 | 337 |
| 343 // GpuVideoDecoder report error. | 338 // GpuVideoDecoder report error. |
| 344 IPC_MESSAGE_ROUTED1(GpuVideoDecoderHostMsg_ErrorNotification, | 339 IPC_MESSAGE_ROUTED1(GpuVideoDecoderHostMsg_ErrorNotification, |
| 345 GpuVideoDecoderErrorInfoParam) | 340 GpuVideoDecoderErrorInfoParam) |
| OLD | NEW |