OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/memory/shared_memory.h" | 13 #include "base/memory/shared_memory.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 #include "content/common/content_param_traits.h" | |
17 #include "content/common/gpu/gpu_memory_uma_stats.h" | 16 #include "content/common/gpu/gpu_memory_uma_stats.h" |
| 17 #include "content/common/gpu/gpu_param_traits.h" |
18 #include "content/common/gpu/gpu_process_launch_causes.h" | 18 #include "content/common/gpu/gpu_process_launch_causes.h" |
19 #include "content/common/gpu/gpu_stream_constants.h" | |
20 #include "gpu/command_buffer/common/capabilities.h" | 19 #include "gpu/command_buffer/common/capabilities.h" |
21 #include "gpu/command_buffer/common/command_buffer.h" | 20 #include "gpu/command_buffer/common/command_buffer.h" |
22 #include "gpu/command_buffer/common/constants.h" | 21 #include "gpu/command_buffer/common/constants.h" |
23 #include "gpu/command_buffer/common/gpu_memory_allocation.h" | 22 #include "gpu/command_buffer/common/gpu_memory_allocation.h" |
24 #include "gpu/command_buffer/common/mailbox.h" | 23 #include "gpu/command_buffer/common/mailbox.h" |
25 #include "gpu/command_buffer/common/sync_token.h" | 24 #include "gpu/command_buffer/common/sync_token.h" |
26 #include "gpu/command_buffer/common/value_state.h" | 25 #include "gpu/command_buffer/common/value_state.h" |
27 #include "gpu/config/gpu_info.h" | 26 #include "gpu/config/gpu_info.h" |
28 #include "gpu/ipc/common/gpu_command_buffer_traits.h" | 27 #include "gpu/ipc/common/gpu_command_buffer_traits.h" |
29 #include "gpu/ipc/common/surface_handle.h" | 28 #include "gpu/ipc/common/surface_handle.h" |
30 #include "ipc/ipc_channel_handle.h" | 29 #include "ipc/ipc_channel_handle.h" |
31 #include "ipc/ipc_message_macros.h" | 30 #include "ipc/ipc_message_macros.h" |
| 31 #include "ui/events/ipc/latency_info_param_traits.h" |
32 #include "ui/events/latency_info.h" | 32 #include "ui/events/latency_info.h" |
33 #include "ui/gfx/geometry/size.h" | 33 #include "ui/gfx/geometry/size.h" |
34 #include "ui/gfx/gpu_memory_buffer.h" | 34 #include "ui/gfx/gpu_memory_buffer.h" |
35 #include "ui/gfx/ipc/gfx_param_traits.h" | 35 #include "ui/gfx/ipc/gfx_param_traits.h" |
36 #include "ui/gfx/native_widget_types.h" | 36 #include "ui/gfx/native_widget_types.h" |
37 #include "ui/gfx/swap_result.h" | 37 #include "ui/gfx/swap_result.h" |
38 #include "ui/gl/gpu_preference.h" | |
39 #include "url/ipc/url_param_traits.h" | 38 #include "url/ipc/url_param_traits.h" |
40 | 39 |
41 #if defined(OS_ANDROID) | 40 #if defined(OS_ANDROID) |
42 #include "gpu/ipc/common/android/surface_texture_peer.h" | 41 #include "gpu/ipc/common/android/surface_texture_peer.h" |
43 #elif defined(OS_MACOSX) | 42 #elif defined(OS_MACOSX) |
44 #include "ui/base/cocoa/remote_layer_api.h" | 43 #include "ui/base/cocoa/remote_layer_api.h" |
45 #include "ui/gfx/mac/io_surface.h" | 44 #include "ui/gfx/mac/io_surface.h" |
46 #endif | 45 #endif |
47 | 46 |
48 #undef IPC_MESSAGE_EXPORT | 47 #undef IPC_MESSAGE_EXPORT |
49 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 48 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
50 | 49 |
51 #define IPC_MESSAGE_START GpuChannelMsgStart | 50 #define IPC_MESSAGE_START GpuChannelMsgStart |
52 | 51 |
53 IPC_ENUM_TRAITS_MAX_VALUE(gfx::GpuPreference, | 52 IPC_STRUCT_BEGIN(GPUCommandBufferConsoleMessage) |
54 gfx::GpuPreferenceLast) | 53 IPC_STRUCT_MEMBER(int32_t, id) |
55 IPC_ENUM_TRAITS_MAX_VALUE(content::GpuStreamPriority, | 54 IPC_STRUCT_MEMBER(std::string, message) |
56 content::GpuStreamPriority::LAST) | 55 IPC_STRUCT_END() |
57 IPC_ENUM_TRAITS_MAX_VALUE(gfx::SwapResult, gfx::SwapResult::SWAP_RESULT_LAST) | |
58 IPC_ENUM_TRAITS_MAX_VALUE(gpu::MemoryAllocation::PriorityCutoff, | |
59 gpu::MemoryAllocation::CUTOFF_LAST) | |
60 IPC_ENUM_TRAITS_MAX_VALUE(gpu::error::ContextLostReason, | |
61 gpu::error::kContextLostReasonLast) | |
62 IPC_ENUM_TRAITS_MIN_MAX_VALUE(gpu::CollectInfoResult, | |
63 gpu::kCollectInfoNone, | |
64 gpu::kCollectInfoFatalFailure) | |
65 IPC_ENUM_TRAITS_MIN_MAX_VALUE(gpu::VideoCodecProfile, | |
66 gpu::VIDEO_CODEC_PROFILE_MIN, | |
67 gpu::VIDEO_CODEC_PROFILE_MAX) | |
68 | 56 |
69 IPC_STRUCT_BEGIN(GPUCreateCommandBufferConfig) | 57 IPC_STRUCT_BEGIN(GPUCreateCommandBufferConfig) |
70 IPC_STRUCT_MEMBER(int32_t, share_group_id) | 58 IPC_STRUCT_MEMBER(int32_t, share_group_id) |
71 IPC_STRUCT_MEMBER(int32_t, stream_id) | 59 IPC_STRUCT_MEMBER(int32_t, stream_id) |
72 IPC_STRUCT_MEMBER(content::GpuStreamPriority, stream_priority) | 60 IPC_STRUCT_MEMBER(content::GpuStreamPriority, stream_priority) |
73 IPC_STRUCT_MEMBER(std::vector<int>, attribs) | 61 IPC_STRUCT_MEMBER(std::vector<int>, attribs) |
74 IPC_STRUCT_MEMBER(GURL, active_url) | 62 IPC_STRUCT_MEMBER(GURL, active_url) |
75 IPC_STRUCT_MEMBER(gfx::GpuPreference, gpu_preference) | 63 IPC_STRUCT_MEMBER(gfx::GpuPreference, gpu_preference) |
76 IPC_STRUCT_END() | 64 IPC_STRUCT_END() |
77 | 65 |
78 IPC_STRUCT_BEGIN(GPUCommandBufferConsoleMessage) | 66 IPC_STRUCT_BEGIN(GpuCommandBufferMsg_CreateImage_Params) |
79 IPC_STRUCT_MEMBER(int32_t, id) | 67 IPC_STRUCT_MEMBER(int32_t, id) |
80 IPC_STRUCT_MEMBER(std::string, message) | 68 IPC_STRUCT_MEMBER(gfx::GpuMemoryBufferHandle, gpu_memory_buffer) |
| 69 IPC_STRUCT_MEMBER(gfx::Size, size) |
| 70 IPC_STRUCT_MEMBER(gfx::BufferFormat, format) |
| 71 IPC_STRUCT_MEMBER(uint32_t, internal_format) |
| 72 IPC_STRUCT_MEMBER(uint64_t, image_release_count) |
81 IPC_STRUCT_END() | 73 IPC_STRUCT_END() |
82 | 74 |
83 #if defined(OS_ANDROID) | 75 #if defined(OS_ANDROID) |
84 IPC_STRUCT_BEGIN(GpuStreamTextureMsg_MatrixChanged_Params) | 76 IPC_STRUCT_BEGIN(GpuStreamTextureMsg_MatrixChanged_Params) |
85 IPC_STRUCT_MEMBER(float, m00) | 77 IPC_STRUCT_MEMBER(float, m00) |
86 IPC_STRUCT_MEMBER(float, m01) | 78 IPC_STRUCT_MEMBER(float, m01) |
87 IPC_STRUCT_MEMBER(float, m02) | 79 IPC_STRUCT_MEMBER(float, m02) |
88 IPC_STRUCT_MEMBER(float, m03) | 80 IPC_STRUCT_MEMBER(float, m03) |
89 IPC_STRUCT_MEMBER(float, m10) | 81 IPC_STRUCT_MEMBER(float, m10) |
90 IPC_STRUCT_MEMBER(float, m11) | 82 IPC_STRUCT_MEMBER(float, m11) |
91 IPC_STRUCT_MEMBER(float, m12) | 83 IPC_STRUCT_MEMBER(float, m12) |
92 IPC_STRUCT_MEMBER(float, m13) | 84 IPC_STRUCT_MEMBER(float, m13) |
93 IPC_STRUCT_MEMBER(float, m20) | 85 IPC_STRUCT_MEMBER(float, m20) |
94 IPC_STRUCT_MEMBER(float, m21) | 86 IPC_STRUCT_MEMBER(float, m21) |
95 IPC_STRUCT_MEMBER(float, m22) | 87 IPC_STRUCT_MEMBER(float, m22) |
96 IPC_STRUCT_MEMBER(float, m23) | 88 IPC_STRUCT_MEMBER(float, m23) |
97 IPC_STRUCT_MEMBER(float, m30) | 89 IPC_STRUCT_MEMBER(float, m30) |
98 IPC_STRUCT_MEMBER(float, m31) | 90 IPC_STRUCT_MEMBER(float, m31) |
99 IPC_STRUCT_MEMBER(float, m32) | 91 IPC_STRUCT_MEMBER(float, m32) |
100 IPC_STRUCT_MEMBER(float, m33) | 92 IPC_STRUCT_MEMBER(float, m33) |
101 IPC_STRUCT_END() | 93 IPC_STRUCT_END() |
102 #endif | 94 #endif |
103 | 95 |
104 IPC_STRUCT_BEGIN(GpuCommandBufferMsg_CreateImage_Params) | |
105 IPC_STRUCT_MEMBER(int32_t, id) | |
106 IPC_STRUCT_MEMBER(gfx::GpuMemoryBufferHandle, gpu_memory_buffer) | |
107 IPC_STRUCT_MEMBER(gfx::Size, size) | |
108 IPC_STRUCT_MEMBER(gfx::BufferFormat, format) | |
109 IPC_STRUCT_MEMBER(uint32_t, internal_format) | |
110 IPC_STRUCT_MEMBER(uint64_t, image_release_count) | |
111 IPC_STRUCT_END() | |
112 | |
113 IPC_STRUCT_TRAITS_BEGIN(gpu::DxDiagNode) | |
114 IPC_STRUCT_TRAITS_MEMBER(values) | |
115 IPC_STRUCT_TRAITS_MEMBER(children) | |
116 IPC_STRUCT_TRAITS_END() | |
117 | |
118 IPC_STRUCT_TRAITS_BEGIN(gpu::GPUInfo::GPUDevice) | |
119 IPC_STRUCT_TRAITS_MEMBER(vendor_id) | |
120 IPC_STRUCT_TRAITS_MEMBER(device_id) | |
121 IPC_STRUCT_TRAITS_MEMBER(active) | |
122 IPC_STRUCT_TRAITS_MEMBER(vendor_string) | |
123 IPC_STRUCT_TRAITS_MEMBER(device_string) | |
124 IPC_STRUCT_TRAITS_END() | |
125 | |
126 IPC_STRUCT_TRAITS_BEGIN(gpu::GPUInfo) | |
127 IPC_STRUCT_TRAITS_MEMBER(initialization_time) | |
128 IPC_STRUCT_TRAITS_MEMBER(optimus) | |
129 IPC_STRUCT_TRAITS_MEMBER(amd_switchable) | |
130 IPC_STRUCT_TRAITS_MEMBER(lenovo_dcute) | |
131 IPC_STRUCT_TRAITS_MEMBER(gpu) | |
132 IPC_STRUCT_TRAITS_MEMBER(secondary_gpus) | |
133 IPC_STRUCT_TRAITS_MEMBER(adapter_luid) | |
134 IPC_STRUCT_TRAITS_MEMBER(driver_vendor) | |
135 IPC_STRUCT_TRAITS_MEMBER(driver_version) | |
136 IPC_STRUCT_TRAITS_MEMBER(driver_date) | |
137 IPC_STRUCT_TRAITS_MEMBER(pixel_shader_version) | |
138 IPC_STRUCT_TRAITS_MEMBER(vertex_shader_version) | |
139 IPC_STRUCT_TRAITS_MEMBER(max_msaa_samples) | |
140 IPC_STRUCT_TRAITS_MEMBER(machine_model_name) | |
141 IPC_STRUCT_TRAITS_MEMBER(machine_model_version) | |
142 IPC_STRUCT_TRAITS_MEMBER(gl_version) | |
143 IPC_STRUCT_TRAITS_MEMBER(gl_vendor) | |
144 IPC_STRUCT_TRAITS_MEMBER(gl_renderer) | |
145 IPC_STRUCT_TRAITS_MEMBER(gl_extensions) | |
146 IPC_STRUCT_TRAITS_MEMBER(gl_ws_vendor) | |
147 IPC_STRUCT_TRAITS_MEMBER(gl_ws_version) | |
148 IPC_STRUCT_TRAITS_MEMBER(gl_ws_extensions) | |
149 IPC_STRUCT_TRAITS_MEMBER(gl_reset_notification_strategy) | |
150 IPC_STRUCT_TRAITS_MEMBER(can_lose_context) | |
151 IPC_STRUCT_TRAITS_MEMBER(software_rendering) | |
152 IPC_STRUCT_TRAITS_MEMBER(direct_rendering) | |
153 IPC_STRUCT_TRAITS_MEMBER(sandboxed) | |
154 IPC_STRUCT_TRAITS_MEMBER(process_crash_count) | |
155 IPC_STRUCT_TRAITS_MEMBER(in_process_gpu) | |
156 IPC_STRUCT_TRAITS_MEMBER(basic_info_state) | |
157 IPC_STRUCT_TRAITS_MEMBER(context_info_state) | |
158 #if defined(OS_WIN) | |
159 IPC_STRUCT_TRAITS_MEMBER(dx_diagnostics_info_state) | |
160 IPC_STRUCT_TRAITS_MEMBER(dx_diagnostics) | |
161 #endif | |
162 IPC_STRUCT_TRAITS_MEMBER(video_decode_accelerator_capabilities) | |
163 IPC_STRUCT_TRAITS_MEMBER(video_encode_accelerator_supported_profiles) | |
164 IPC_STRUCT_TRAITS_MEMBER(jpeg_decode_accelerator_supported) | |
165 IPC_STRUCT_TRAITS_END() | |
166 | |
167 IPC_STRUCT_TRAITS_BEGIN(gpu::MemoryAllocation) | |
168 IPC_STRUCT_TRAITS_MEMBER(bytes_limit_when_visible) | |
169 IPC_STRUCT_TRAITS_MEMBER(priority_cutoff_when_visible) | |
170 IPC_STRUCT_TRAITS_END() | |
171 | |
172 //------------------------------------------------------------------------------ | 96 //------------------------------------------------------------------------------ |
173 // GPU Channel Messages | 97 // GPU Channel Messages |
174 // These are messages from a renderer process to the GPU process. | 98 // These are messages from a renderer process to the GPU process. |
175 | 99 |
176 // Tells the GPU process to create a new command buffer. A corresponding | 100 // Tells the GPU process to create a new command buffer. A corresponding |
177 // GpuCommandBufferStub is created. if |surface_handle| is non-null, |size| is | 101 // GpuCommandBufferStub is created. if |surface_handle| is non-null, |size| is |
178 // ignored, and it will render directly to the native surface (only the browser | 102 // ignored, and it will render directly to the native surface (only the browser |
179 // process is allowed to create those). Otherwise it will create an offscreen | 103 // process is allowed to create those). Otherwise it will create an offscreen |
180 // backbuffer of dimensions |size|. | 104 // backbuffer of dimensions |size|. |
181 IPC_SYNC_MESSAGE_CONTROL4_1(GpuChannelMsg_CreateCommandBuffer, | 105 IPC_SYNC_MESSAGE_CONTROL4_1(GpuChannelMsg_CreateCommandBuffer, |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 GpuCommandBufferMsg_CreateImage_Params /* params */) | 237 GpuCommandBufferMsg_CreateImage_Params /* params */) |
314 | 238 |
315 // Destroy a previously created image. | 239 // Destroy a previously created image. |
316 IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_DestroyImage, int32_t /* id */) | 240 IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_DestroyImage, int32_t /* id */) |
317 | 241 |
318 // Attaches an external image stream to the client texture. | 242 // Attaches an external image stream to the client texture. |
319 IPC_SYNC_MESSAGE_ROUTED2_1(GpuCommandBufferMsg_CreateStreamTexture, | 243 IPC_SYNC_MESSAGE_ROUTED2_1(GpuCommandBufferMsg_CreateStreamTexture, |
320 uint32_t, /* client_texture_id */ | 244 uint32_t, /* client_texture_id */ |
321 int32_t, /* stream_id */ | 245 int32_t, /* stream_id */ |
322 bool /* succeeded */) | 246 bool /* succeeded */) |
OLD | NEW |