summaryrefslogtreecommitdiffstats
path: root/content/common/gpu
diff options
context:
space:
mode:
authorfsamuel <fsamuel@chromium.org>2016-03-17 05:15:43 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-17 12:17:26 +0000
commit68efb4803bf77935194d31ca1d93e639282cd7b5 (patch)
tree5c60c58395389131750b55bd4f0c9a27c2d40f15 /content/common/gpu
parent2ba81b5fd3b9584c8839b0478242ea0b9adb57b8 (diff)
downloadchromium_src-68efb4803bf77935194d31ca1d93e639282cd7b5.zip
chromium_src-68efb4803bf77935194d31ca1d93e639282cd7b5.tar.gz
chromium_src-68efb4803bf77935194d31ca1d93e639282cd7b5.tar.bz2
gpu_host_messages.h => content/gpu
gpu_host_messages consists of host <=> gpu IPC messages and is browser specific. Thus, for the time being, it makes sense to keep this file in content. The rest of content/common/gpu is moving to gpu/ipc. Thus, we are moving gpu_host_messages to content/gpu. GpuHostMsg_EstablishGpuChannel, and GpuHostMsg_HasGpuProcess didn't fit in with the rest of gpu_host_messages because they are renderer => browser messages. Thus this CL also moves those oddball IPCs to child_process_messsages.h. Some traits are used by both child_process_messages and gpu_host_messages. I've moved those traits to content/common/gpu/gpu_param_traits_macros.h. BUG=586365 Review URL: https://codereview.chromium.org/1799713002 Cr-Commit-Position: refs/heads/master@{#381693}
Diffstat (limited to 'content/common/gpu')
-rw-r--r--content/common/gpu/client/command_buffer_proxy_impl.cc1
-rw-r--r--content/common/gpu/client/gpu_channel_host.cc1
-rw-r--r--content/common/gpu/gpu_host_messages.h314
-rw-r--r--content/common/gpu/gpu_messages.h100
-rw-r--r--content/common/gpu/gpu_param_traits.cc27
-rw-r--r--content/common/gpu/gpu_param_traits.h10
-rw-r--r--content/common/gpu/gpu_param_traits_macros.h140
-rw-r--r--content/common/gpu/media/media_messages.h22
8 files changed, 191 insertions, 424 deletions
diff --git a/content/common/gpu/client/command_buffer_proxy_impl.cc b/content/common/gpu/client/command_buffer_proxy_impl.cc
index b5ea79e..a4e3203 100644
--- a/content/common/gpu/client/command_buffer_proxy_impl.cc
+++ b/content/common/gpu/client/command_buffer_proxy_impl.cc
@@ -15,6 +15,7 @@
#include "base/trace_event/trace_event.h"
#include "content/common/gpu/client/gpu_channel_host.h"
#include "content/common/gpu/gpu_messages.h"
+#include "content/common/gpu/gpu_param_traits.h"
#include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
#include "gpu/command_buffer/common/cmd_buffer_common.h"
#include "gpu/command_buffer/common/command_buffer_id.h"
diff --git a/content/common/gpu/client/gpu_channel_host.cc b/content/common/gpu/client/gpu_channel_host.cc
index dd2ca53..f4dd8e7 100644
--- a/content/common/gpu/client/gpu_channel_host.cc
+++ b/content/common/gpu/client/gpu_channel_host.cc
@@ -19,6 +19,7 @@
#include "build/build_config.h"
#include "content/common/gpu/client/command_buffer_proxy_impl.h"
#include "content/common/gpu/gpu_messages.h"
+#include "content/common/gpu/gpu_param_traits_macros.h"
#include "ipc/ipc_sync_message_filter.h"
#include "url/gurl.h"
diff --git a/content/common/gpu/gpu_host_messages.h b/content/common/gpu/gpu_host_messages.h
deleted file mode 100644
index 2aa1490..0000000
--- a/content/common/gpu/gpu_host_messages.h
+++ /dev/null
@@ -1,314 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Multiply-included message file, hence no include guard here, but see below
-// for a much smaller-than-usual include guard section.
-
-#include "build/build_config.h"
-#include "content/common/content_export.h"
-#include "content/common/content_param_traits.h"
-#include "content/common/gpu/establish_channel_params.h"
-#include "content/common/gpu/gpu_memory_uma_stats.h"
-#include "content/common/gpu/gpu_process_launch_causes.h"
-#include "gpu/command_buffer/common/sync_token.h"
-#include "gpu/command_buffer/common/value_state.h"
-#include "gpu/command_buffer/service/gpu_preferences.h"
-#include "gpu/config/gpu_info.h"
-#include "gpu/ipc/common/memory_stats.h"
-#include "gpu/ipc/common/surface_handle.h"
-#include "ipc/ipc_channel_handle.h"
-#include "ipc/ipc_message_macros.h"
-#include "ipc/ipc_message_start.h"
-#include "ui/gfx/gpu_memory_buffer.h"
-#include "ui/gfx/ipc/gfx_param_traits.h"
-#include "url/gurl.h"
-#include "url/ipc/url_param_traits.h"
-
-#if defined(OS_MACOSX)
-#include "content/common/gpu/accelerated_surface_buffers_swapped_params_mac.h"
-#include "content/common/gpu/buffer_presented_params_mac.h"
-#include "ui/base/cocoa/remote_layer_api.h"
-#include "ui/gfx/mac/io_surface.h"
-#endif
-
-#undef IPC_MESSAGE_EXPORT
-#define IPC_MESSAGE_EXPORT CONTENT_EXPORT
-
-#define IPC_MESSAGE_START GpuMsgStart
-
-IPC_ENUM_TRAITS_MAX_VALUE(content::CauseForGpuLaunch,
- content::CAUSE_FOR_GPU_LAUNCH_MAX_ENUM - 1)
-
-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::VideoMemoryUsageStats)
- 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(gpu::VideoMemoryUsageStats::ProcessStats)
- IPC_STRUCT_TRAITS_MEMBER(video_memory)
- IPC_STRUCT_TRAITS_MEMBER(has_duplicates)
-IPC_STRUCT_TRAITS_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(gpu::SurfaceHandle, 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()
-
-IPC_STRUCT_TRAITS_BEGIN(content::EstablishChannelParams)
- IPC_STRUCT_TRAITS_MEMBER(client_id)
- IPC_STRUCT_TRAITS_MEMBER(client_tracing_id)
- IPC_STRUCT_TRAITS_MEMBER(preempts)
- IPC_STRUCT_TRAITS_MEMBER(allow_view_command_buffers)
- IPC_STRUCT_TRAITS_MEMBER(allow_real_time_streams)
-IPC_STRUCT_TRAITS_END()
-
-#if defined(OS_MACOSX)
-IPC_STRUCT_TRAITS_BEGIN(content::AcceleratedSurfaceBuffersSwappedParams)
- IPC_STRUCT_TRAITS_MEMBER(surface_id)
- // Only one of ca_context_id or io_surface may be non-0.
- IPC_STRUCT_TRAITS_MEMBER(ca_context_id)
- IPC_STRUCT_TRAITS_MEMBER(io_surface)
- IPC_STRUCT_TRAITS_MEMBER(size)
- IPC_STRUCT_TRAITS_MEMBER(scale_factor)
- IPC_STRUCT_TRAITS_MEMBER(latency_info)
-IPC_STRUCT_TRAITS_END()
-
-IPC_STRUCT_TRAITS_BEGIN(content::BufferPresentedParams)
- // The vsync parameters, to synchronize presentation with the display.
- IPC_STRUCT_TRAITS_MEMBER(surface_id)
- IPC_STRUCT_TRAITS_MEMBER(vsync_timebase)
- IPC_STRUCT_TRAITS_MEMBER(vsync_interval)
-IPC_STRUCT_TRAITS_END()
-#endif
-
-IPC_STRUCT_TRAITS_BEGIN(gpu::GpuPreferences)
- IPC_STRUCT_TRAITS_MEMBER(single_process)
- IPC_STRUCT_TRAITS_MEMBER(in_process_gpu)
- IPC_STRUCT_TRAITS_MEMBER(ui_prioritize_in_gpu_process)
- IPC_STRUCT_TRAITS_MEMBER(disable_accelerated_video_decode)
-#if defined(OS_CHROMEOS)
- IPC_STRUCT_TRAITS_MEMBER(disable_vaapi_accelerated_video_encode)
-#endif
-#if defined(ENABLE_WEBRTC)
- IPC_STRUCT_TRAITS_MEMBER(disable_web_rtc_hw_encoding)
-#endif
-#if defined(OS_WIN)
- IPC_STRUCT_TRAITS_MEMBER(enable_accelerated_vpx_decode)
-#endif
- IPC_STRUCT_TRAITS_MEMBER(compile_shader_always_succeeds)
- IPC_STRUCT_TRAITS_MEMBER(disable_gl_error_limit)
- IPC_STRUCT_TRAITS_MEMBER(disable_glsl_translator)
- IPC_STRUCT_TRAITS_MEMBER(disable_gpu_driver_bug_workarounds)
- IPC_STRUCT_TRAITS_MEMBER(disable_shader_name_hashing)
- IPC_STRUCT_TRAITS_MEMBER(enable_gpu_command_logging)
- IPC_STRUCT_TRAITS_MEMBER(enable_gpu_debugging)
- IPC_STRUCT_TRAITS_MEMBER(enable_gpu_service_logging_gpu)
- IPC_STRUCT_TRAITS_MEMBER(disable_gpu_program_cache)
- IPC_STRUCT_TRAITS_MEMBER(enforce_gl_minimums)
- IPC_STRUCT_TRAITS_MEMBER(force_gpu_mem_available)
- IPC_STRUCT_TRAITS_MEMBER(gpu_program_cache_size)
- IPC_STRUCT_TRAITS_MEMBER(disable_gpu_shader_disk_cache)
- IPC_STRUCT_TRAITS_MEMBER(enable_share_group_async_texture_upload)
- IPC_STRUCT_TRAITS_MEMBER(enable_subscribe_uniform_extension)
- IPC_STRUCT_TRAITS_MEMBER(enable_threaded_texture_mailboxes)
- IPC_STRUCT_TRAITS_MEMBER(gl_shader_interm_output)
- IPC_STRUCT_TRAITS_MEMBER(emulate_shader_precision)
- IPC_STRUCT_TRAITS_MEMBER(enable_gpu_service_logging)
- IPC_STRUCT_TRAITS_MEMBER(enable_gpu_service_tracing)
- IPC_STRUCT_TRAITS_MEMBER(enable_unsafe_es3_apis)
-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_CONTROL1(GpuMsg_Initialize,
- gpu::GpuPreferences /* gpu_prefernces */)
-
-// 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,
- content::EstablishChannelParams /* params */)
-
-// Tells the GPU process to close the channel identified by |client_id|.
-// If no channel can be identified, do nothing.
-IPC_MESSAGE_CONTROL1(GpuMsg_CloseChannel,
- int32_t /* client_id */)
-
-// 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_CONTROL1(AcceleratedSurfaceMsg_BufferPresented,
- content::BufferPresentedParams)
-#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,
- gpu::VideoMemoryUsageStats /* GPU memory stats */)
-
-#if defined(OS_MACOSX)
-// Tells the browser that an accelerated surface has swapped.
-IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceBuffersSwapped,
- content::AcceleratedSurfaceBuffersSwappedParams)
-#endif
-
-#if defined(OS_WIN)
-IPC_MESSAGE_CONTROL2(GpuHostMsg_AcceleratedSurfaceCreatedChildWindow,
- gpu::SurfaceHandle /* parent_window */,
- gpu::SurfaceHandle /* 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 */)
-
-// 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 */)
diff --git a/content/common/gpu/gpu_messages.h b/content/common/gpu/gpu_messages.h
index 3f00427..babf041 100644
--- a/content/common/gpu/gpu_messages.h
+++ b/content/common/gpu/gpu_messages.h
@@ -13,10 +13,9 @@
#include "base/memory/shared_memory.h"
#include "build/build_config.h"
#include "content/common/content_export.h"
-#include "content/common/content_param_traits.h"
#include "content/common/gpu/gpu_memory_uma_stats.h"
+#include "content/common/gpu/gpu_param_traits.h"
#include "content/common/gpu/gpu_process_launch_causes.h"
-#include "content/common/gpu/gpu_stream_constants.h"
#include "gpu/command_buffer/common/capabilities.h"
#include "gpu/command_buffer/common/command_buffer.h"
#include "gpu/command_buffer/common/constants.h"
@@ -29,13 +28,13 @@
#include "gpu/ipc/common/surface_handle.h"
#include "ipc/ipc_channel_handle.h"
#include "ipc/ipc_message_macros.h"
+#include "ui/events/ipc/latency_info_param_traits.h"
#include "ui/events/latency_info.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/gpu_memory_buffer.h"
#include "ui/gfx/ipc/gfx_param_traits.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/swap_result.h"
-#include "ui/gl/gpu_preference.h"
#include "url/ipc/url_param_traits.h"
#if defined(OS_ANDROID)
@@ -50,21 +49,10 @@
#define IPC_MESSAGE_START GpuChannelMsgStart
-IPC_ENUM_TRAITS_MAX_VALUE(gfx::GpuPreference,
- gfx::GpuPreferenceLast)
-IPC_ENUM_TRAITS_MAX_VALUE(content::GpuStreamPriority,
- content::GpuStreamPriority::LAST)
-IPC_ENUM_TRAITS_MAX_VALUE(gfx::SwapResult, gfx::SwapResult::SWAP_RESULT_LAST)
-IPC_ENUM_TRAITS_MAX_VALUE(gpu::MemoryAllocation::PriorityCutoff,
- gpu::MemoryAllocation::CUTOFF_LAST)
-IPC_ENUM_TRAITS_MAX_VALUE(gpu::error::ContextLostReason,
- gpu::error::kContextLostReasonLast)
-IPC_ENUM_TRAITS_MIN_MAX_VALUE(gpu::CollectInfoResult,
- gpu::kCollectInfoNone,
- gpu::kCollectInfoFatalFailure)
-IPC_ENUM_TRAITS_MIN_MAX_VALUE(gpu::VideoCodecProfile,
- gpu::VIDEO_CODEC_PROFILE_MIN,
- gpu::VIDEO_CODEC_PROFILE_MAX)
+IPC_STRUCT_BEGIN(GPUCommandBufferConsoleMessage)
+ IPC_STRUCT_MEMBER(int32_t, id)
+ IPC_STRUCT_MEMBER(std::string, message)
+IPC_STRUCT_END()
IPC_STRUCT_BEGIN(GPUCreateCommandBufferConfig)
IPC_STRUCT_MEMBER(int32_t, share_group_id)
@@ -75,9 +63,13 @@ IPC_STRUCT_BEGIN(GPUCreateCommandBufferConfig)
IPC_STRUCT_MEMBER(gfx::GpuPreference, gpu_preference)
IPC_STRUCT_END()
-IPC_STRUCT_BEGIN(GPUCommandBufferConsoleMessage)
+IPC_STRUCT_BEGIN(GpuCommandBufferMsg_CreateImage_Params)
IPC_STRUCT_MEMBER(int32_t, id)
- IPC_STRUCT_MEMBER(std::string, message)
+ IPC_STRUCT_MEMBER(gfx::GpuMemoryBufferHandle, gpu_memory_buffer)
+ IPC_STRUCT_MEMBER(gfx::Size, size)
+ IPC_STRUCT_MEMBER(gfx::BufferFormat, format)
+ IPC_STRUCT_MEMBER(uint32_t, internal_format)
+ IPC_STRUCT_MEMBER(uint64_t, image_release_count)
IPC_STRUCT_END()
#if defined(OS_ANDROID)
@@ -101,74 +93,6 @@ IPC_STRUCT_BEGIN(GpuStreamTextureMsg_MatrixChanged_Params)
IPC_STRUCT_END()
#endif
-IPC_STRUCT_BEGIN(GpuCommandBufferMsg_CreateImage_Params)
- IPC_STRUCT_MEMBER(int32_t, id)
- IPC_STRUCT_MEMBER(gfx::GpuMemoryBufferHandle, gpu_memory_buffer)
- IPC_STRUCT_MEMBER(gfx::Size, size)
- IPC_STRUCT_MEMBER(gfx::BufferFormat, format)
- IPC_STRUCT_MEMBER(uint32_t, internal_format)
- IPC_STRUCT_MEMBER(uint64_t, image_release_count)
-IPC_STRUCT_END()
-
-IPC_STRUCT_TRAITS_BEGIN(gpu::DxDiagNode)
- IPC_STRUCT_TRAITS_MEMBER(values)
- IPC_STRUCT_TRAITS_MEMBER(children)
-IPC_STRUCT_TRAITS_END()
-
-IPC_STRUCT_TRAITS_BEGIN(gpu::GPUInfo::GPUDevice)
- IPC_STRUCT_TRAITS_MEMBER(vendor_id)
- IPC_STRUCT_TRAITS_MEMBER(device_id)
- IPC_STRUCT_TRAITS_MEMBER(active)
- IPC_STRUCT_TRAITS_MEMBER(vendor_string)
- IPC_STRUCT_TRAITS_MEMBER(device_string)
-IPC_STRUCT_TRAITS_END()
-
-IPC_STRUCT_TRAITS_BEGIN(gpu::GPUInfo)
- IPC_STRUCT_TRAITS_MEMBER(initialization_time)
- IPC_STRUCT_TRAITS_MEMBER(optimus)
- IPC_STRUCT_TRAITS_MEMBER(amd_switchable)
- IPC_STRUCT_TRAITS_MEMBER(lenovo_dcute)
- IPC_STRUCT_TRAITS_MEMBER(gpu)
- IPC_STRUCT_TRAITS_MEMBER(secondary_gpus)
- IPC_STRUCT_TRAITS_MEMBER(adapter_luid)
- IPC_STRUCT_TRAITS_MEMBER(driver_vendor)
- IPC_STRUCT_TRAITS_MEMBER(driver_version)
- IPC_STRUCT_TRAITS_MEMBER(driver_date)
- IPC_STRUCT_TRAITS_MEMBER(pixel_shader_version)
- IPC_STRUCT_TRAITS_MEMBER(vertex_shader_version)
- IPC_STRUCT_TRAITS_MEMBER(max_msaa_samples)
- IPC_STRUCT_TRAITS_MEMBER(machine_model_name)
- IPC_STRUCT_TRAITS_MEMBER(machine_model_version)
- IPC_STRUCT_TRAITS_MEMBER(gl_version)
- IPC_STRUCT_TRAITS_MEMBER(gl_vendor)
- IPC_STRUCT_TRAITS_MEMBER(gl_renderer)
- IPC_STRUCT_TRAITS_MEMBER(gl_extensions)
- IPC_STRUCT_TRAITS_MEMBER(gl_ws_vendor)
- IPC_STRUCT_TRAITS_MEMBER(gl_ws_version)
- IPC_STRUCT_TRAITS_MEMBER(gl_ws_extensions)
- IPC_STRUCT_TRAITS_MEMBER(gl_reset_notification_strategy)
- IPC_STRUCT_TRAITS_MEMBER(can_lose_context)
- IPC_STRUCT_TRAITS_MEMBER(software_rendering)
- IPC_STRUCT_TRAITS_MEMBER(direct_rendering)
- IPC_STRUCT_TRAITS_MEMBER(sandboxed)
- IPC_STRUCT_TRAITS_MEMBER(process_crash_count)
- IPC_STRUCT_TRAITS_MEMBER(in_process_gpu)
- IPC_STRUCT_TRAITS_MEMBER(basic_info_state)
- IPC_STRUCT_TRAITS_MEMBER(context_info_state)
-#if defined(OS_WIN)
- IPC_STRUCT_TRAITS_MEMBER(dx_diagnostics_info_state)
- IPC_STRUCT_TRAITS_MEMBER(dx_diagnostics)
-#endif
- IPC_STRUCT_TRAITS_MEMBER(video_decode_accelerator_capabilities)
- IPC_STRUCT_TRAITS_MEMBER(video_encode_accelerator_supported_profiles)
- IPC_STRUCT_TRAITS_MEMBER(jpeg_decode_accelerator_supported)
-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)
-IPC_STRUCT_TRAITS_END()
-
//------------------------------------------------------------------------------
// GPU Channel Messages
// These are messages from a renderer process to the GPU process.
diff --git a/content/common/gpu/gpu_param_traits.cc b/content/common/gpu/gpu_param_traits.cc
new file mode 100644
index 0000000..2b1580a
--- /dev/null
+++ b/content/common/gpu/gpu_param_traits.cc
@@ -0,0 +1,27 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Get basic type definitions.
+#include "content/common/gpu/gpu_param_traits.h"
+
+// Generate param traits write methods.
+#include "ipc/param_traits_write_macros.h"
+namespace IPC {
+#undef CONTENT_COMMON_GPU_GPU_PARAM_TRAITS_MACROS_H_
+#include "content/common/gpu/gpu_param_traits_macros.h"
+} // namespace IPC
+
+// Generate param traits read methods.
+#include "ipc/param_traits_read_macros.h"
+namespace IPC {
+#undef CONTENT_COMMON_GPU_GPU_PARAM_TRAITS_MACROS_H_
+#include "content/common/gpu/gpu_param_traits_macros.h"
+} // namespace IPC
+
+// Generate param traits log methods.
+#include "ipc/param_traits_log_macros.h"
+namespace IPC {
+#undef CONTENT_COMMON_GPU_GPU_PARAM_TRAITS_MACROS_H_
+#include "content/common/gpu/gpu_param_traits_macros.h"
+} // namespace IPC
diff --git a/content/common/gpu/gpu_param_traits.h b/content/common/gpu/gpu_param_traits.h
new file mode 100644
index 0000000..1e114bc
--- /dev/null
+++ b/content/common/gpu/gpu_param_traits.h
@@ -0,0 +1,10 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_COMMON_GPU_GPU_PARAM_TRAITS_H_
+#define CONTENT_COMMON_GPU_GPU_PARAM_TRAITS_H_
+
+#include "content/common/gpu/gpu_param_traits_macros.h"
+
+#endif // CONTENT_COMMON_GPU_GPU_PARAM_TRAITS_H_
diff --git a/content/common/gpu/gpu_param_traits_macros.h b/content/common/gpu/gpu_param_traits_macros.h
new file mode 100644
index 0000000..d14b79d
--- /dev/null
+++ b/content/common/gpu/gpu_param_traits_macros.h
@@ -0,0 +1,140 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_COMMON_GPU_GPU_PARAM_TRAITS_MACROS_H_
+#define CONTENT_COMMON_GPU_GPU_PARAM_TRAITS_MACROS_H_
+
+#include "content/common/content_export.h"
+#include "content/common/gpu/gpu_stream_constants.h"
+#include "gpu/command_buffer/common/constants.h"
+#include "gpu/command_buffer/common/gpu_memory_allocation.h"
+#include "gpu/config/gpu_info.h"
+#include "ipc/ipc_message_macros.h"
+#include "media/base/video_codecs.h"
+#include "ui/gfx/gpu_memory_buffer.h"
+#include "ui/gfx/ipc/gfx_param_traits.h"
+#include "ui/gfx/swap_result.h"
+#include "ui/gl/gpu_preference.h"
+#include "url/ipc/url_param_traits.h"
+
+#undef IPC_MESSAGE_EXPORT
+#define IPC_MESSAGE_EXPORT CONTENT_EXPORT
+
+IPC_ENUM_TRAITS_MIN_MAX_VALUE(media::VideoCodecProfile,
+ media::VIDEO_CODEC_PROFILE_MIN,
+ media::VIDEO_CODEC_PROFILE_MAX)
+
+IPC_STRUCT_TRAITS_BEGIN(gpu::VideoDecodeAcceleratorSupportedProfile)
+ IPC_STRUCT_TRAITS_MEMBER(profile)
+ IPC_STRUCT_TRAITS_MEMBER(max_resolution)
+ IPC_STRUCT_TRAITS_MEMBER(min_resolution)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(gpu::VideoDecodeAcceleratorCapabilities)
+ IPC_STRUCT_TRAITS_MEMBER(supported_profiles)
+ IPC_STRUCT_TRAITS_MEMBER(flags)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(gpu::VideoEncodeAcceleratorSupportedProfile)
+ IPC_STRUCT_TRAITS_MEMBER(profile)
+ IPC_STRUCT_TRAITS_MEMBER(max_resolution)
+ IPC_STRUCT_TRAITS_MEMBER(max_framerate_numerator)
+ IPC_STRUCT_TRAITS_MEMBER(max_framerate_denominator)
+IPC_STRUCT_TRAITS_END()
+
+IPC_ENUM_TRAITS_MAX_VALUE(gfx::GpuMemoryBufferType,
+ gfx::GPU_MEMORY_BUFFER_TYPE_LAST)
+
+IPC_STRUCT_TRAITS_BEGIN(gfx::GpuMemoryBufferHandle)
+ IPC_STRUCT_TRAITS_MEMBER(id)
+ IPC_STRUCT_TRAITS_MEMBER(type)
+ IPC_STRUCT_TRAITS_MEMBER(handle)
+ IPC_STRUCT_TRAITS_MEMBER(offset)
+ IPC_STRUCT_TRAITS_MEMBER(stride)
+#if defined(USE_OZONE)
+ IPC_STRUCT_TRAITS_MEMBER(native_pixmap_handle)
+#elif defined(OS_MACOSX)
+ IPC_STRUCT_TRAITS_MEMBER(mach_port)
+#endif
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(gfx::GpuMemoryBufferId)
+ IPC_STRUCT_TRAITS_MEMBER(id)
+IPC_STRUCT_TRAITS_END()
+
+IPC_ENUM_TRAITS_MAX_VALUE(gfx::GpuPreference, gfx::GpuPreferenceLast)
+IPC_ENUM_TRAITS_MAX_VALUE(content::GpuStreamPriority,
+ content::GpuStreamPriority::LAST)
+IPC_ENUM_TRAITS_MAX_VALUE(gfx::SwapResult, gfx::SwapResult::SWAP_RESULT_LAST)
+IPC_ENUM_TRAITS_MAX_VALUE(gpu::MemoryAllocation::PriorityCutoff,
+ gpu::MemoryAllocation::CUTOFF_LAST)
+IPC_ENUM_TRAITS_MAX_VALUE(gpu::error::ContextLostReason,
+ gpu::error::kContextLostReasonLast)
+IPC_ENUM_TRAITS_MIN_MAX_VALUE(gpu::CollectInfoResult,
+ gpu::kCollectInfoNone,
+ gpu::kCollectInfoFatalFailure)
+IPC_ENUM_TRAITS_MIN_MAX_VALUE(gpu::VideoCodecProfile,
+ gpu::VIDEO_CODEC_PROFILE_MIN,
+ gpu::VIDEO_CODEC_PROFILE_MAX)
+
+IPC_STRUCT_TRAITS_BEGIN(gpu::DxDiagNode)
+ IPC_STRUCT_TRAITS_MEMBER(values)
+ IPC_STRUCT_TRAITS_MEMBER(children)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(gpu::GPUInfo::GPUDevice)
+ IPC_STRUCT_TRAITS_MEMBER(vendor_id)
+ IPC_STRUCT_TRAITS_MEMBER(device_id)
+ IPC_STRUCT_TRAITS_MEMBER(active)
+ IPC_STRUCT_TRAITS_MEMBER(vendor_string)
+ IPC_STRUCT_TRAITS_MEMBER(device_string)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(gpu::GPUInfo)
+ IPC_STRUCT_TRAITS_MEMBER(initialization_time)
+ IPC_STRUCT_TRAITS_MEMBER(optimus)
+ IPC_STRUCT_TRAITS_MEMBER(amd_switchable)
+ IPC_STRUCT_TRAITS_MEMBER(lenovo_dcute)
+ IPC_STRUCT_TRAITS_MEMBER(gpu)
+ IPC_STRUCT_TRAITS_MEMBER(secondary_gpus)
+ IPC_STRUCT_TRAITS_MEMBER(adapter_luid)
+ IPC_STRUCT_TRAITS_MEMBER(driver_vendor)
+ IPC_STRUCT_TRAITS_MEMBER(driver_version)
+ IPC_STRUCT_TRAITS_MEMBER(driver_date)
+ IPC_STRUCT_TRAITS_MEMBER(pixel_shader_version)
+ IPC_STRUCT_TRAITS_MEMBER(vertex_shader_version)
+ IPC_STRUCT_TRAITS_MEMBER(max_msaa_samples)
+ IPC_STRUCT_TRAITS_MEMBER(machine_model_name)
+ IPC_STRUCT_TRAITS_MEMBER(machine_model_version)
+ IPC_STRUCT_TRAITS_MEMBER(gl_version)
+ IPC_STRUCT_TRAITS_MEMBER(gl_vendor)
+ IPC_STRUCT_TRAITS_MEMBER(gl_renderer)
+ IPC_STRUCT_TRAITS_MEMBER(gl_extensions)
+ IPC_STRUCT_TRAITS_MEMBER(gl_ws_vendor)
+ IPC_STRUCT_TRAITS_MEMBER(gl_ws_version)
+ IPC_STRUCT_TRAITS_MEMBER(gl_ws_extensions)
+ IPC_STRUCT_TRAITS_MEMBER(gl_reset_notification_strategy)
+ IPC_STRUCT_TRAITS_MEMBER(can_lose_context)
+ IPC_STRUCT_TRAITS_MEMBER(software_rendering)
+ IPC_STRUCT_TRAITS_MEMBER(direct_rendering)
+ IPC_STRUCT_TRAITS_MEMBER(sandboxed)
+ IPC_STRUCT_TRAITS_MEMBER(process_crash_count)
+ IPC_STRUCT_TRAITS_MEMBER(in_process_gpu)
+ IPC_STRUCT_TRAITS_MEMBER(basic_info_state)
+ IPC_STRUCT_TRAITS_MEMBER(context_info_state)
+#if defined(OS_WIN)
+ IPC_STRUCT_TRAITS_MEMBER(dx_diagnostics_info_state)
+ IPC_STRUCT_TRAITS_MEMBER(dx_diagnostics)
+#endif
+ IPC_STRUCT_TRAITS_MEMBER(video_decode_accelerator_capabilities)
+ IPC_STRUCT_TRAITS_MEMBER(video_encode_accelerator_supported_profiles)
+ IPC_STRUCT_TRAITS_MEMBER(jpeg_decode_accelerator_supported)
+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)
+IPC_STRUCT_TRAITS_END()
+
+#endif // CONTENT_COMMON_GPU_GPU_PARAM_TRAITS_MACROS_H_
diff --git a/content/common/gpu/media/media_messages.h b/content/common/gpu/media/media_messages.h
index 554fb15..7643672 100644
--- a/content/common/gpu/media/media_messages.h
+++ b/content/common/gpu/media/media_messages.h
@@ -44,10 +44,6 @@ IPC_ENUM_TRAITS_MAX_VALUE(media::JpegDecodeAccelerator::Error,
media::JpegDecodeAccelerator::LARGEST_ERROR_ENUM)
IPC_ENUM_TRAITS_MAX_VALUE(media::VideoEncodeAccelerator::Error,
media::VideoEncodeAccelerator::kErrorMax)
-IPC_ENUM_TRAITS_MIN_MAX_VALUE(media::VideoCodecProfile,
- media::VIDEO_CODEC_PROFILE_MIN,
- media::VIDEO_CODEC_PROFILE_MAX)
-
IPC_STRUCT_BEGIN(AcceleratedJpegDecoderMsg_Decode_Params)
IPC_STRUCT_MEMBER(media::BitstreamBuffer, input_buffer)
IPC_STRUCT_MEMBER(gfx::Size, coded_size)
@@ -79,24 +75,6 @@ IPC_STRUCT_TRAITS_BEGIN(media::VideoDecodeAccelerator::Config)
IPC_STRUCT_TRAITS_MEMBER(surface_id)
IPC_STRUCT_TRAITS_END()
-IPC_STRUCT_TRAITS_BEGIN(gpu::VideoDecodeAcceleratorSupportedProfile)
- IPC_STRUCT_TRAITS_MEMBER(profile)
- IPC_STRUCT_TRAITS_MEMBER(max_resolution)
- IPC_STRUCT_TRAITS_MEMBER(min_resolution)
-IPC_STRUCT_TRAITS_END()
-
-IPC_STRUCT_TRAITS_BEGIN(gpu::VideoDecodeAcceleratorCapabilities)
- IPC_STRUCT_TRAITS_MEMBER(supported_profiles)
- IPC_STRUCT_TRAITS_MEMBER(flags)
-IPC_STRUCT_TRAITS_END()
-
-IPC_STRUCT_TRAITS_BEGIN(gpu::VideoEncodeAcceleratorSupportedProfile)
- IPC_STRUCT_TRAITS_MEMBER(profile)
- IPC_STRUCT_TRAITS_MEMBER(max_resolution)
- IPC_STRUCT_TRAITS_MEMBER(max_framerate_numerator)
- IPC_STRUCT_TRAITS_MEMBER(max_framerate_denominator)
-IPC_STRUCT_TRAITS_END()
-
IPC_STRUCT_TRAITS_BEGIN(media::SubsampleEntry)
IPC_STRUCT_TRAITS_MEMBER(clear_bytes)
IPC_STRUCT_TRAITS_MEMBER(cypher_bytes)