| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/shared_memory.h" | 11 #include "base/shared_memory.h" |
| 12 #include "cc/debug/latency_info.h" | |
| 13 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 14 #include "content/common/gpu/gpu_memory_allocation.h" | 13 #include "content/common/gpu/gpu_memory_allocation.h" |
| 15 #include "content/common/gpu/gpu_memory_uma_stats.h" | 14 #include "content/common/gpu/gpu_memory_uma_stats.h" |
| 16 #include "content/common/gpu/gpu_process_launch_causes.h" | 15 #include "content/common/gpu/gpu_process_launch_causes.h" |
| 17 #include "content/common/gpu/gpu_rendering_stats.h" | 16 #include "content/common/gpu/gpu_rendering_stats.h" |
| 18 #include "content/public/common/common_param_traits.h" | 17 #include "content/public/common/common_param_traits.h" |
| 19 #include "content/public/common/gpu_info.h" | 18 #include "content/public/common/gpu_info.h" |
| 20 #include "content/public/common/gpu_memory_stats.h" | 19 #include "content/public/common/gpu_memory_stats.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/ipc/gpu_command_buffer_traits.h" | 22 #include "gpu/ipc/gpu_command_buffer_traits.h" |
| 24 #include "ipc/ipc_channel_handle.h" | 23 #include "ipc/ipc_channel_handle.h" |
| 25 #include "ipc/ipc_message_macros.h" | 24 #include "ipc/ipc_message_macros.h" |
| 26 #include "media/video/video_decode_accelerator.h" | 25 #include "media/video/video_decode_accelerator.h" |
| 26 #include "ui/base/latency_info.h" |
| 27 #include "ui/gfx/native_widget_types.h" | 27 #include "ui/gfx/native_widget_types.h" |
| 28 #include "ui/gfx/size.h" | 28 #include "ui/gfx/size.h" |
| 29 #include "ui/gl/gpu_preference.h" | 29 #include "ui/gl/gpu_preference.h" |
| 30 #include "ui/surface/transport_dib.h" | 30 #include "ui/surface/transport_dib.h" |
| 31 | 31 |
| 32 #if defined(OS_ANDROID) | 32 #if defined(OS_ANDROID) |
| 33 #include "content/common/android/surface_texture_peer.h" | 33 #include "content/common/android/surface_texture_peer.h" |
| 34 #endif | 34 #endif |
| 35 | 35 |
| 36 #define IPC_MESSAGE_START GpuMsgStart | 36 #define IPC_MESSAGE_START GpuMsgStart |
| 37 | 37 |
| 38 IPC_STRUCT_BEGIN(GPUCreateCommandBufferConfig) | 38 IPC_STRUCT_BEGIN(GPUCreateCommandBufferConfig) |
| 39 IPC_STRUCT_MEMBER(int32, share_group_id) | 39 IPC_STRUCT_MEMBER(int32, share_group_id) |
| 40 IPC_STRUCT_MEMBER(std::string, allowed_extensions) | 40 IPC_STRUCT_MEMBER(std::string, allowed_extensions) |
| 41 IPC_STRUCT_MEMBER(std::vector<int>, attribs) | 41 IPC_STRUCT_MEMBER(std::vector<int>, attribs) |
| 42 IPC_STRUCT_MEMBER(GURL, active_url) | 42 IPC_STRUCT_MEMBER(GURL, active_url) |
| 43 IPC_STRUCT_MEMBER(gfx::GpuPreference, gpu_preference) | 43 IPC_STRUCT_MEMBER(gfx::GpuPreference, gpu_preference) |
| 44 IPC_STRUCT_END() | 44 IPC_STRUCT_END() |
| 45 | 45 |
| 46 #undef IPC_MESSAGE_EXPORT | 46 #undef IPC_MESSAGE_EXPORT |
| 47 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 47 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
| 48 IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params) | 48 IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params) |
| 49 IPC_STRUCT_MEMBER(int32, surface_id) | 49 IPC_STRUCT_MEMBER(int32, surface_id) |
| 50 IPC_STRUCT_MEMBER(uint64, surface_handle) | 50 IPC_STRUCT_MEMBER(uint64, surface_handle) |
| 51 IPC_STRUCT_MEMBER(int32, route_id) | 51 IPC_STRUCT_MEMBER(int32, route_id) |
| 52 IPC_STRUCT_MEMBER(std::string, mailbox_name) | 52 IPC_STRUCT_MEMBER(std::string, mailbox_name) |
| 53 IPC_STRUCT_MEMBER(gfx::Size, size) | 53 IPC_STRUCT_MEMBER(gfx::Size, size) |
| 54 IPC_STRUCT_MEMBER(cc::LatencyInfo, latency_info) | 54 IPC_STRUCT_MEMBER(ui::LatencyInfo, latency_info) |
| 55 IPC_STRUCT_END() | 55 IPC_STRUCT_END() |
| 56 #undef IPC_MESSAGE_EXPORT | 56 #undef IPC_MESSAGE_EXPORT |
| 57 #define IPC_MESSAGE_EXPORT | 57 #define IPC_MESSAGE_EXPORT |
| 58 | 58 |
| 59 IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params) | 59 IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params) |
| 60 IPC_STRUCT_MEMBER(int32, surface_id) | 60 IPC_STRUCT_MEMBER(int32, surface_id) |
| 61 IPC_STRUCT_MEMBER(uint64, surface_handle) | 61 IPC_STRUCT_MEMBER(uint64, surface_handle) |
| 62 IPC_STRUCT_MEMBER(int32, route_id) | 62 IPC_STRUCT_MEMBER(int32, route_id) |
| 63 IPC_STRUCT_MEMBER(int, x) | 63 IPC_STRUCT_MEMBER(int, x) |
| 64 IPC_STRUCT_MEMBER(int, y) | 64 IPC_STRUCT_MEMBER(int, y) |
| 65 IPC_STRUCT_MEMBER(int, width) | 65 IPC_STRUCT_MEMBER(int, width) |
| 66 IPC_STRUCT_MEMBER(int, height) | 66 IPC_STRUCT_MEMBER(int, height) |
| 67 IPC_STRUCT_MEMBER(std::string, mailbox_name) | 67 IPC_STRUCT_MEMBER(std::string, mailbox_name) |
| 68 IPC_STRUCT_MEMBER(gfx::Size, surface_size) | 68 IPC_STRUCT_MEMBER(gfx::Size, surface_size) |
| 69 IPC_STRUCT_MEMBER(cc::LatencyInfo, latency_info) | 69 IPC_STRUCT_MEMBER(ui::LatencyInfo, latency_info) |
| 70 IPC_STRUCT_END() | 70 IPC_STRUCT_END() |
| 71 | 71 |
| 72 IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceRelease_Params) | 72 IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceRelease_Params) |
| 73 IPC_STRUCT_MEMBER(int32, surface_id) | 73 IPC_STRUCT_MEMBER(int32, surface_id) |
| 74 IPC_STRUCT_MEMBER(int32, route_id) | 74 IPC_STRUCT_MEMBER(int32, route_id) |
| 75 IPC_STRUCT_END() | 75 IPC_STRUCT_END() |
| 76 | 76 |
| 77 IPC_STRUCT_BEGIN(AcceleratedSurfaceMsg_BufferPresented_Params) | 77 IPC_STRUCT_BEGIN(AcceleratedSurfaceMsg_BufferPresented_Params) |
| 78 IPC_STRUCT_MEMBER(std::string, mailbox_name) | 78 IPC_STRUCT_MEMBER(std::string, mailbox_name) |
| 79 IPC_STRUCT_MEMBER(uint32, sync_point) | 79 IPC_STRUCT_MEMBER(uint32, sync_point) |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 // Resize the window that is being drawn into. It's important that this | 360 // Resize the window that is being drawn into. It's important that this |
| 361 // resize be synchronized with the swapping of the front and back buffers. | 361 // resize be synchronized with the swapping of the front and back buffers. |
| 362 IPC_MESSAGE_CONTROL3(GpuHostMsg_ResizeView, | 362 IPC_MESSAGE_CONTROL3(GpuHostMsg_ResizeView, |
| 363 int32 /* surface_id */, | 363 int32 /* surface_id */, |
| 364 int32 /* route_id */, | 364 int32 /* route_id */, |
| 365 gfx::Size /* size */) | 365 gfx::Size /* size */) |
| 366 | 366 |
| 367 // Tells the browser that a frame with the specific latency info was drawn to | 367 // Tells the browser that a frame with the specific latency info was drawn to |
| 368 // the screen | 368 // the screen |
| 369 IPC_MESSAGE_CONTROL1(GpuHostMsg_FrameDrawn, | 369 IPC_MESSAGE_CONTROL1(GpuHostMsg_FrameDrawn, |
| 370 cc::LatencyInfo /* latency_info */) | 370 ui::LatencyInfo /* latency_info */) |
| 371 | 371 |
| 372 // Same as above with a rect of the part of the surface that changed. | 372 // Same as above with a rect of the part of the surface that changed. |
| 373 IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, | 373 IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, |
| 374 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params) | 374 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params) |
| 375 | 375 |
| 376 // This message notifies the browser process that the renderer | 376 // This message notifies the browser process that the renderer |
| 377 // swapped a portion of the buffers associated with the given "window", which | 377 // swapped a portion of the buffers associated with the given "window", which |
| 378 // should cause the browser to redraw the compositor's contents. | 378 // should cause the browser to redraw the compositor's contents. |
| 379 IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfacePostSubBuffer, | 379 IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfacePostSubBuffer, |
| 380 GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params) | 380 GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params) |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 // Asynchronously synchronize the put and get offsets of both processes. | 506 // Asynchronously synchronize the put and get offsets of both processes. |
| 507 // Caller passes its current put offset. Current state (including get offset) | 507 // Caller passes its current put offset. Current state (including get offset) |
| 508 // is returned in shared memory. | 508 // is returned in shared memory. |
| 509 IPC_MESSAGE_ROUTED2(GpuCommandBufferMsg_AsyncFlush, | 509 IPC_MESSAGE_ROUTED2(GpuCommandBufferMsg_AsyncFlush, |
| 510 int32 /* put_offset */, | 510 int32 /* put_offset */, |
| 511 uint32 /* flush_count */) | 511 uint32 /* flush_count */) |
| 512 | 512 |
| 513 // Sends information about the latency of the current frame to the GPU | 513 // Sends information about the latency of the current frame to the GPU |
| 514 // process. | 514 // process. |
| 515 IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_SetLatencyInfo, | 515 IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_SetLatencyInfo, |
| 516 cc::LatencyInfo /* latency_info */) | 516 ui::LatencyInfo /* latency_info */) |
| 517 | 517 |
| 518 // Asynchronously process any commands known to the GPU process. This is only | 518 // Asynchronously process any commands known to the GPU process. This is only |
| 519 // used in the event that a channel is unscheduled and needs to be flushed | 519 // used in the event that a channel is unscheduled and needs to be flushed |
| 520 // again to process any commands issued subsequent to unscheduling. The GPU | 520 // again to process any commands issued subsequent to unscheduling. The GPU |
| 521 // process actually sends it (deferred) to itself. | 521 // process actually sends it (deferred) to itself. |
| 522 IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_Rescheduled) | 522 IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_Rescheduled) |
| 523 | 523 |
| 524 // Sent by the GPU process to display messages in the console. | 524 // Sent by the GPU process to display messages in the console. |
| 525 IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_ConsoleMsg, | 525 IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_ConsoleMsg, |
| 526 GPUCommandBufferConsoleMessage /* msg */) | 526 GPUCommandBufferConsoleMessage /* msg */) |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 | 667 |
| 668 // Confirm decoder has been flushed. | 668 // Confirm decoder has been flushed. |
| 669 IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_FlushDone) | 669 IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_FlushDone) |
| 670 | 670 |
| 671 // Confirm decoder has been reset. | 671 // Confirm decoder has been reset. |
| 672 IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_ResetDone) | 672 IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_ResetDone) |
| 673 | 673 |
| 674 // Video decoder has encountered an error. | 674 // Video decoder has encountered an error. |
| 675 IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderHostMsg_ErrorNotification, | 675 IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderHostMsg_ErrorNotification, |
| 676 uint32) /* Error ID */ | 676 uint32) /* Error ID */ |
| OLD | NEW |