Index: content/common/gpu/gpu_messages.h |
diff --git a/content/common/gpu/gpu_messages.h b/content/common/gpu/gpu_messages.h |
index 8ad2fce97602e25b711d0adc2c0f0f15fcae5f8b..e4db8b3d496114c6517960317304e1131834c30e 100644 |
--- a/content/common/gpu/gpu_messages.h |
+++ b/content/common/gpu/gpu_messages.h |
@@ -53,8 +53,10 @@ |
#undef IPC_MESSAGE_EXPORT |
#define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
-#define IPC_MESSAGE_START GpuChannelMsgStart |
- |
+#define IPC_MESSAGE_START GpuMsgStart |
+ |
+IPC_ENUM_TRAITS_MAX_VALUE(content::CauseForGpuLaunch, |
+ content::CAUSE_FOR_GPU_LAUNCH_MAX_ENUM - 1) |
IPC_ENUM_TRAITS_MAX_VALUE(gfx::GpuPreference, |
gfx::GpuPreferenceLast) |
IPC_ENUM_TRAITS_MAX_VALUE(content::GpuStreamPriority, |
@@ -88,6 +90,50 @@ |
IPC_STRUCT_MEMBER(GURL, active_url) |
IPC_STRUCT_MEMBER(gfx::GpuPreference, gpu_preference) |
IPC_STRUCT_END() |
+ |
+IPC_STRUCT_BEGIN(GpuMsg_EstablishChannel_Params) |
+ IPC_STRUCT_MEMBER(int, client_id) |
+ IPC_STRUCT_MEMBER(uint64_t, client_tracing_id) |
+ IPC_STRUCT_MEMBER(bool, preempts) |
+ IPC_STRUCT_MEMBER(bool, allow_view_command_buffers) |
+ IPC_STRUCT_MEMBER(bool, allow_real_time_streams) |
+IPC_STRUCT_END() |
+ |
+IPC_STRUCT_BEGIN(GpuMsg_CreateGpuMemoryBuffer_Params) |
+ IPC_STRUCT_MEMBER(gfx::GpuMemoryBufferId, id) |
+ IPC_STRUCT_MEMBER(gfx::Size, size) |
+ IPC_STRUCT_MEMBER(gfx::BufferFormat, format) |
+ IPC_STRUCT_MEMBER(gfx::BufferUsage, usage) |
+ IPC_STRUCT_MEMBER(int32_t, client_id) |
+ IPC_STRUCT_MEMBER(gfx::PluginWindowHandle, surface_handle) |
+IPC_STRUCT_END() |
+ |
+IPC_STRUCT_BEGIN(GpuMsg_CreateGpuMemoryBufferFromHandle_Params) |
+ IPC_STRUCT_MEMBER(gfx::GpuMemoryBufferHandle, handle) |
+ IPC_STRUCT_MEMBER(gfx::GpuMemoryBufferId, id) |
+ IPC_STRUCT_MEMBER(gfx::Size, size) |
+ IPC_STRUCT_MEMBER(gfx::BufferFormat, format) |
+ IPC_STRUCT_MEMBER(int32_t, client_id) |
+IPC_STRUCT_END() |
+ |
+#if defined(OS_MACOSX) |
+IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params) |
+ IPC_STRUCT_MEMBER(int32_t, surface_id) |
+ // Only one of ca_context_id or io_surface may be non-0. |
+ IPC_STRUCT_MEMBER(CAContextID, ca_context_id) |
+ IPC_STRUCT_MEMBER(gfx::ScopedRefCountedIOSurfaceMachPort, io_surface) |
+ IPC_STRUCT_MEMBER(int32_t, route_id) |
+ IPC_STRUCT_MEMBER(gfx::Size, size) |
+ IPC_STRUCT_MEMBER(float, scale_factor) |
+ IPC_STRUCT_MEMBER(std::vector<ui::LatencyInfo>, latency_info) |
+IPC_STRUCT_END() |
+ |
+IPC_STRUCT_BEGIN(AcceleratedSurfaceMsg_BufferPresented_Params) |
+ // The vsync parameters, to synchronize presentation with the display. |
+ IPC_STRUCT_MEMBER(base::TimeTicks, vsync_timebase) |
+ IPC_STRUCT_MEMBER(base::TimeDelta, vsync_interval) |
+IPC_STRUCT_END() |
+#endif |
IPC_STRUCT_BEGIN(AcceleratedJpegDecoderMsg_Decode_Params) |
IPC_STRUCT_MEMBER(int32_t, input_buffer_id) |
@@ -239,6 +285,22 @@ |
IPC_STRUCT_TRAITS_MEMBER(jpeg_decode_accelerator_supported) |
IPC_STRUCT_TRAITS_END() |
+IPC_STRUCT_TRAITS_BEGIN(content::GPUVideoMemoryUsageStats::ProcessStats) |
+ IPC_STRUCT_TRAITS_MEMBER(video_memory) |
+ IPC_STRUCT_TRAITS_MEMBER(has_duplicates) |
+IPC_STRUCT_TRAITS_END() |
+ |
+IPC_STRUCT_TRAITS_BEGIN(content::GPUVideoMemoryUsageStats) |
+ IPC_STRUCT_TRAITS_MEMBER(process_map) |
+ IPC_STRUCT_TRAITS_MEMBER(bytes_allocated) |
+ IPC_STRUCT_TRAITS_MEMBER(bytes_allocated_historical_max) |
+IPC_STRUCT_TRAITS_END() |
+ |
+IPC_STRUCT_TRAITS_BEGIN(content::GPUMemoryUmaStats) |
+ IPC_STRUCT_TRAITS_MEMBER(bytes_allocated_current) |
+ IPC_STRUCT_TRAITS_MEMBER(bytes_allocated_max) |
+IPC_STRUCT_TRAITS_END() |
+ |
IPC_STRUCT_TRAITS_BEGIN(gpu::MemoryAllocation) |
IPC_STRUCT_TRAITS_MEMBER(bytes_limit_when_visible) |
IPC_STRUCT_TRAITS_MEMBER(priority_cutoff_when_visible) |
@@ -253,6 +315,185 @@ |
IPC_STRUCT_TRAITS_MEMBER(clear_bytes) |
IPC_STRUCT_TRAITS_MEMBER(cypher_bytes) |
IPC_STRUCT_TRAITS_END() |
+ |
+//------------------------------------------------------------------------------ |
+// GPU Messages |
+// These are messages from the browser to the GPU process. |
+ |
+// Tells the GPU process to initialize itself. The browser explicitly |
+// requests this be done so that we are guaranteed that the channel is set |
+// up between the browser and GPU process before doing any work that might |
+// potentially crash the GPU process. Detection of the child process |
+// exiting abruptly is predicated on having the IPC channel set up. |
+IPC_MESSAGE_CONTROL0(GpuMsg_Initialize) |
+ |
+// Tells the GPU process to shutdown itself. |
+IPC_MESSAGE_CONTROL0(GpuMsg_Finalize) |
+ |
+// Tells the GPU process to create a new channel for communication with a |
+// given client. The channel name is returned in a |
+// GpuHostMsg_ChannelEstablished message. The client ID is passed so that |
+// the GPU process reuses an existing channel to that process if it exists. |
+// This ID is a unique opaque identifier generated by the browser process. |
+// The client_tracing_id is a unique ID used for the purposes of tracing. |
+IPC_MESSAGE_CONTROL1(GpuMsg_EstablishChannel, |
+ GpuMsg_EstablishChannel_Params /* params */) |
+ |
+// Tells the GPU process to close the channel identified by IPC channel |
+// handle. If no channel can be identified, do nothing. |
+IPC_MESSAGE_CONTROL1(GpuMsg_CloseChannel, |
+ IPC::ChannelHandle /* channel_handle */) |
+ |
+// Tells the GPU process to create a new gpu memory buffer. |
+IPC_MESSAGE_CONTROL1(GpuMsg_CreateGpuMemoryBuffer, |
+ GpuMsg_CreateGpuMemoryBuffer_Params) |
+ |
+// Tells the GPU process to create a new gpu memory buffer from an existing |
+// handle. |
+IPC_MESSAGE_CONTROL1(GpuMsg_CreateGpuMemoryBufferFromHandle, |
+ GpuMsg_CreateGpuMemoryBufferFromHandle_Params) |
+ |
+// Tells the GPU process to destroy buffer. |
+IPC_MESSAGE_CONTROL3(GpuMsg_DestroyGpuMemoryBuffer, |
+ gfx::GpuMemoryBufferId, /* id */ |
+ int32_t, /* client_id */ |
+ gpu::SyncToken /* sync_token */) |
+ |
+// Tells the GPU process to create a context for collecting graphics card |
+// information. |
+IPC_MESSAGE_CONTROL0(GpuMsg_CollectGraphicsInfo) |
+ |
+// Tells the GPU process to report video_memory information for the task manager |
+IPC_MESSAGE_CONTROL0(GpuMsg_GetVideoMemoryUsageStats) |
+ |
+#if defined(OS_MACOSX) |
+// Tells the GPU process that the browser process has handled the swap |
+// buffers or post sub-buffer request. |
+IPC_MESSAGE_ROUTED1(AcceleratedSurfaceMsg_BufferPresented, |
+ AcceleratedSurfaceMsg_BufferPresented_Params) |
+#endif |
+ |
+#if defined(OS_ANDROID) |
+// Tells the GPU process to wake up the GPU because we're about to draw. |
+IPC_MESSAGE_CONTROL0(GpuMsg_WakeUpGpu) |
+#endif |
+ |
+// Tells the GPU process to remove all contexts. |
+IPC_MESSAGE_CONTROL0(GpuMsg_Clean) |
+ |
+// Tells the GPU process to crash. |
+IPC_MESSAGE_CONTROL0(GpuMsg_Crash) |
+ |
+// Tells the GPU process to hang. |
+IPC_MESSAGE_CONTROL0(GpuMsg_Hang) |
+ |
+// Tells the GPU process to disable the watchdog thread. |
+IPC_MESSAGE_CONTROL0(GpuMsg_DisableWatchdog) |
+ |
+// Tells the GPU process that the browser has seen a GPU switch. |
+IPC_MESSAGE_CONTROL0(GpuMsg_GpuSwitched) |
+ |
+// Sends an input event to the gpu service. |
+IPC_MESSAGE_CONTROL3(GpuMsg_UpdateValueState, |
+ int, /* client_id */ |
+ unsigned int, /* target */ |
+ gpu::ValueState /* valuestate */) |
+ |
+//------------------------------------------------------------------------------ |
+// GPU Host Messages |
+// These are messages to the browser. |
+ |
+// A renderer sends this when it wants to create a connection to the GPU |
+// process. The browser will create the GPU process if necessary, and will |
+// return a handle to the channel via a GpuChannelEstablished message. |
+IPC_SYNC_MESSAGE_CONTROL1_3(GpuHostMsg_EstablishGpuChannel, |
+ content::CauseForGpuLaunch, |
+ int /* client id */, |
+ IPC::ChannelHandle /* handle to channel */, |
+ gpu::GPUInfo /* stats about GPU process*/) |
+ |
+// A renderer sends this when it wants to know whether a gpu process exists. |
+IPC_SYNC_MESSAGE_CONTROL0_1(GpuHostMsg_HasGpuProcess, bool /* result */) |
+ |
+// Response from GPU to a GputMsg_Initialize message. |
+IPC_MESSAGE_CONTROL2(GpuHostMsg_Initialized, |
+ bool /* result */, |
+ ::gpu::GPUInfo /* gpu_info */) |
+ |
+// Response from GPU to a GpuHostMsg_EstablishChannel message. |
+IPC_MESSAGE_CONTROL1(GpuHostMsg_ChannelEstablished, |
+ IPC::ChannelHandle /* channel_handle */) |
+ |
+// Message from GPU to notify to destroy the channel. |
+IPC_MESSAGE_CONTROL1(GpuHostMsg_DestroyChannel, int32_t /* client_id */) |
+ |
+// Message to cache the given shader information. |
+IPC_MESSAGE_CONTROL3(GpuHostMsg_CacheShader, |
+ int32_t /* client_id */, |
+ std::string /* key */, |
+ std::string /* shader */) |
+ |
+// Message to the GPU that a shader was loaded from disk. |
+IPC_MESSAGE_CONTROL1(GpuMsg_LoadedShader, |
+ std::string /* encoded shader */) |
+ |
+// Response from GPU to a GpuMsg_CreateGpuMemoryBuffer message. |
+IPC_MESSAGE_CONTROL1(GpuHostMsg_GpuMemoryBufferCreated, |
+ gfx::GpuMemoryBufferHandle /* handle */) |
+ |
+// Response from GPU to a GpuMsg_CollectGraphicsInfo. |
+IPC_MESSAGE_CONTROL1(GpuHostMsg_GraphicsInfoCollected, |
+ gpu::GPUInfo /* GPU logging stats */) |
+ |
+// Response from GPU to a GpuMsg_GetVideoMemory. |
+IPC_MESSAGE_CONTROL1(GpuHostMsg_VideoMemoryUsageStats, |
+ content::GPUVideoMemoryUsageStats /* GPU memory stats */) |
+ |
+// Message from GPU to add a GPU log message to the about:gpu page. |
+IPC_MESSAGE_CONTROL3(GpuHostMsg_OnLogMessage, |
+ int /*severity*/, |
+ std::string /* header */, |
+ std::string /* message */) |
+ |
+ |
+#if defined(OS_MACOSX) |
+// Tells the browser that an accelerated surface has swapped. |
+IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, |
+ GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params) |
+#endif |
+ |
+#if defined(OS_WIN) |
+IPC_MESSAGE_CONTROL2(GpuHostMsg_AcceleratedSurfaceCreatedChildWindow, |
+ gfx::PluginWindowHandle /* parent_window */, |
+ gfx::PluginWindowHandle /* child_window */) |
+#endif |
+ |
+IPC_MESSAGE_CONTROL1(GpuHostMsg_DidCreateOffscreenContext, |
+ GURL /* url */) |
+ |
+IPC_MESSAGE_CONTROL3(GpuHostMsg_DidLoseContext, |
+ bool /* offscreen */, |
+ gpu::error::ContextLostReason /* reason */, |
+ GURL /* url */) |
+ |
+IPC_MESSAGE_CONTROL1(GpuHostMsg_DidDestroyOffscreenContext, |
+ GURL /* url */) |
+ |
+// Tells the browser about GPU memory usage statistics for UMA logging. |
+IPC_MESSAGE_CONTROL1(GpuHostMsg_GpuMemoryUmaStats, |
+ content::GPUMemoryUmaStats /* GPU memory UMA stats */) |
+ |
+// Tells the browser that a context has subscribed to a new target and |
+// the browser should start sending the corresponding information |
+IPC_MESSAGE_CONTROL2(GpuHostMsg_AddSubscription, |
+ int32_t /* client_id */, |
+ unsigned int /* target */) |
+ |
+// Tells the browser that no contexts are subscribed to the target anymore |
+// so the browser should stop sending the corresponding information |
+IPC_MESSAGE_CONTROL2(GpuHostMsg_RemoveSubscription, |
+ int32_t /* client_id */, |
+ unsigned int /* target */) |
//------------------------------------------------------------------------------ |
// GPU Channel Messages |