Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Side by Side Diff: content/common/gpu/gpu_messages.h

Issue 19762004: Add multi-process GpuMemoryBuffer framework. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/memory/shared_memory.h" 11 #include "base/memory/shared_memory.h"
12 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
13 #include "content/common/gpu/gpu_memory_allocation.h" 13 #include "content/common/gpu/gpu_memory_allocation.h"
14 #include "content/common/gpu/gpu_memory_uma_stats.h" 14 #include "content/common/gpu/gpu_memory_uma_stats.h"
15 #include "content/common/gpu/gpu_process_launch_causes.h" 15 #include "content/common/gpu/gpu_process_launch_causes.h"
16 #include "content/common/gpu/gpu_rendering_stats.h" 16 #include "content/common/gpu/gpu_rendering_stats.h"
17 #include "content/public/common/common_param_traits.h" 17 #include "content/public/common/common_param_traits.h"
18 #include "content/public/common/gpu_memory_stats.h" 18 #include "content/public/common/gpu_memory_stats.h"
19 #include "gpu/command_buffer/common/command_buffer.h" 19 #include "gpu/command_buffer/common/command_buffer.h"
20 #include "gpu/command_buffer/common/constants.h" 20 #include "gpu/command_buffer/common/constants.h"
21 #include "gpu/command_buffer/common/mailbox.h" 21 #include "gpu/command_buffer/common/mailbox.h"
22 #include "gpu/config/gpu_info.h" 22 #include "gpu/config/gpu_info.h"
23 #include "gpu/ipc/gpu_command_buffer_traits.h" 23 #include "gpu/ipc/gpu_command_buffer_traits.h"
24 #include "ipc/ipc_channel_handle.h" 24 #include "ipc/ipc_channel_handle.h"
25 #include "ipc/ipc_message_macros.h" 25 #include "ipc/ipc_message_macros.h"
26 #include "media/base/video_frame.h" 26 #include "media/base/video_frame.h"
27 #include "media/video/video_decode_accelerator.h" 27 #include "media/video/video_decode_accelerator.h"
28 #include "media/video/video_encode_accelerator.h" 28 #include "media/video/video_encode_accelerator.h"
29 #include "ui/events/latency_info.h" 29 #include "ui/events/latency_info.h"
30 #include "ui/gfx/gpu_memory_buffer.h"
30 #include "ui/gfx/native_widget_types.h" 31 #include "ui/gfx/native_widget_types.h"
31 #include "ui/gfx/size.h" 32 #include "ui/gfx/size.h"
32 #include "ui/gl/gpu_preference.h" 33 #include "ui/gl/gpu_preference.h"
33 34
34 #if defined(OS_ANDROID) 35 #if defined(OS_ANDROID)
35 #include "content/common/android/surface_texture_peer.h" 36 #include "content/common/android/surface_texture_peer.h"
36 #endif 37 #endif
37 38
38 #define IPC_MESSAGE_START GpuMsgStart 39 #define IPC_MESSAGE_START GpuMsgStart
39 40
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 IPC_STRUCT_TRAITS_MEMBER(texture_upload_count) 219 IPC_STRUCT_TRAITS_MEMBER(texture_upload_count)
219 IPC_STRUCT_TRAITS_MEMBER(total_texture_upload_time) 220 IPC_STRUCT_TRAITS_MEMBER(total_texture_upload_time)
220 IPC_STRUCT_TRAITS_MEMBER(global_total_processing_commands_time) 221 IPC_STRUCT_TRAITS_MEMBER(global_total_processing_commands_time)
221 IPC_STRUCT_TRAITS_MEMBER(total_processing_commands_time) 222 IPC_STRUCT_TRAITS_MEMBER(total_processing_commands_time)
222 IPC_STRUCT_TRAITS_END() 223 IPC_STRUCT_TRAITS_END()
223 224
224 IPC_ENUM_TRAITS(media::VideoFrame::Format) 225 IPC_ENUM_TRAITS(media::VideoFrame::Format)
225 226
226 IPC_ENUM_TRAITS(media::VideoEncodeAccelerator::Error) 227 IPC_ENUM_TRAITS(media::VideoEncodeAccelerator::Error)
227 228
229 IPC_ENUM_TRAITS(gfx::GpuMemoryBufferType)
230
231 IPC_STRUCT_TRAITS_BEGIN(gfx::GpuMemoryBufferHandle)
232 IPC_STRUCT_TRAITS_MEMBER(type)
233 IPC_STRUCT_TRAITS_MEMBER(handle)
234 IPC_STRUCT_TRAITS_END()
235
228 //------------------------------------------------------------------------------ 236 //------------------------------------------------------------------------------
229 // GPU Messages 237 // GPU Messages
230 // These are messages from the browser to the GPU process. 238 // These are messages from the browser to the GPU process.
231 239
232 // Tells the GPU process to initialize itself. The browser explicitly 240 // Tells the GPU process to initialize itself. The browser explicitly
233 // requests this be done so that we are guaranteed that the channel is set 241 // requests this be done so that we are guaranteed that the channel is set
234 // up between the browser and GPU process before doing any work that might 242 // up between the browser and GPU process before doing any work that might
235 // potentially crash the GPU process. Detection of the child process 243 // potentially crash the GPU process. Detection of the child process
236 // exiting abruptly is predicated on having the IPC channel set up. 244 // exiting abruptly is predicated on having the IPC channel set up.
237 IPC_MESSAGE_CONTROL0(GpuMsg_Initialize) 245 IPC_MESSAGE_CONTROL0(GpuMsg_Initialize)
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_SignalSyncPointAck, 638 IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_SignalSyncPointAck,
631 uint32 /* signal_id */) 639 uint32 /* signal_id */)
632 640
633 // Makes this command buffer signal when a query is reached, by sending 641 // Makes this command buffer signal when a query is reached, by sending
634 // back a GpuCommandBufferMsg_SignalSyncPointAck message with the same 642 // back a GpuCommandBufferMsg_SignalSyncPointAck message with the same
635 // signal_id. 643 // signal_id.
636 IPC_MESSAGE_ROUTED2(GpuCommandBufferMsg_SignalQuery, 644 IPC_MESSAGE_ROUTED2(GpuCommandBufferMsg_SignalQuery,
637 uint32 /* query */, 645 uint32 /* query */,
638 uint32 /* signal_id */) 646 uint32 /* signal_id */)
639 647
648 // Register an existing gpu memory buffer. Returns an id that can be
649 // used to identify the gpu memory buffer from a command buffer.
piman 2013/10/21 21:57:00 nit: this doesn't return an id. fix doc?
reveman 2013/10/22 16:26:11 Done. Fixed the description of GpuCommandBufferMsg
650 IPC_MESSAGE_ROUTED5(GpuCommandBufferMsg_RegisterGpuMemoryBuffer,
651 int32 /* id */,
652 gfx::GpuMemoryBufferHandle /* gpu_memory_buffer */,
653 uint32 /* width */,
654 uint32 /* height */,
655 uint32 /* internalformat */)
656
657 // Destroy a previously created gpu memory buffer.
658 IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_DestroyGpuMemoryBuffer,
659 int32 /* id */)
660
640 //------------------------------------------------------------------------------ 661 //------------------------------------------------------------------------------
641 // Accelerated Video Decoder Messages 662 // Accelerated Video Decoder Messages
642 // These messages are sent from Renderer process to GPU process. 663 // These messages are sent from Renderer process to GPU process.
643 664
644 // Send input buffer for decoding. 665 // Send input buffer for decoding.
645 IPC_MESSAGE_ROUTED3(AcceleratedVideoDecoderMsg_Decode, 666 IPC_MESSAGE_ROUTED3(AcceleratedVideoDecoderMsg_Decode,
646 base::SharedMemoryHandle, /* input_buffer_handle */ 667 base::SharedMemoryHandle, /* input_buffer_handle */
647 int32, /* bitstream_buffer_id */ 668 int32, /* bitstream_buffer_id */
648 uint32) /* size */ 669 uint32) /* size */
649 670
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 778
758 // Notify the renderer that an output buffer has been filled with encoded data. 779 // Notify the renderer that an output buffer has been filled with encoded data.
759 IPC_MESSAGE_ROUTED3(AcceleratedVideoEncoderHostMsg_BitstreamBufferReady, 780 IPC_MESSAGE_ROUTED3(AcceleratedVideoEncoderHostMsg_BitstreamBufferReady,
760 int32 /* bitstream_buffer_id */, 781 int32 /* bitstream_buffer_id */,
761 uint32 /* payload_size */, 782 uint32 /* payload_size */,
762 bool /* key_frame */) 783 bool /* key_frame */)
763 784
764 // Report error condition. 785 // Report error condition.
765 IPC_MESSAGE_ROUTED1(AcceleratedVideoEncoderHostMsg_NotifyError, 786 IPC_MESSAGE_ROUTED1(AcceleratedVideoEncoderHostMsg_NotifyError,
766 media::VideoEncodeAccelerator::Error /* error */) 787 media::VideoEncodeAccelerator::Error /* error */)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698