| 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 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
| 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/hash_tables.h" | 11 #include "base/hash_tables.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/process.h" | 15 #include "base/process.h" |
| 16 #include "base/process_util.h" | 16 #include "base/process_util.h" |
| 17 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
| 18 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
| 19 #include "content/common/gpu/client/gpu_video_decode_accelerator_host.h" | 19 #include "content/common/gpu/client/gpu_video_decode_accelerator_host.h" |
| 20 #include "content/common/gpu/gpu_process_launch_causes.h" | 20 #include "content/common/gpu/gpu_process_launch_causes.h" |
| 21 #include "content/common/message_router.h" | 21 #include "content/common/message_router.h" |
| 22 #include "content/public/common/gpu_info.h" | 22 #include "content/public/common/gpu_info.h" |
| 23 #include "ipc/ipc_channel_handle.h" | 23 #include "ipc/ipc_channel_handle.h" |
| 24 #include "ipc/ipc_channel_proxy.h" | 24 #include "ipc/ipc_channel_proxy.h" |
| 25 #include "ipc/ipc_sync_channel.h" | 25 #include "ipc/ipc_sync_channel.h" |
| 26 #include "ui/gfx/native_widget_types.h" | 26 #include "ui/gfx/native_widget_types.h" |
| 27 #include "ui/gfx/size.h" | 27 #include "ui/gfx/size.h" |
| 28 #include "ui/gl/gpu_preference.h" | 28 #include "ui/gl/gpu_preference.h" |
| 29 | 29 |
| 30 class CommandBufferProxy; | |
| 31 class GURL; | 30 class GURL; |
| 32 class MessageLoop; | 31 class MessageLoop; |
| 33 class TransportTextureService; | 32 class TransportTextureService; |
| 34 struct GPUCreateCommandBufferConfig; | 33 struct GPUCreateCommandBufferConfig; |
| 35 | 34 |
| 36 namespace base { | 35 namespace base { |
| 37 class MessageLoopProxy; | 36 class MessageLoopProxy; |
| 38 } | 37 } |
| 39 | 38 |
| 40 namespace IPC { | 39 namespace IPC { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 // The GPU stats reported by the GPU process. | 105 // The GPU stats reported by the GPU process. |
| 107 void set_gpu_info(const GPUInfo& gpu_info); | 106 void set_gpu_info(const GPUInfo& gpu_info); |
| 108 const GPUInfo& gpu_info() const; | 107 const GPUInfo& gpu_info() const; |
| 109 | 108 |
| 110 void OnChannelError(); | 109 void OnChannelError(); |
| 111 | 110 |
| 112 // IPC::Sender implementation: | 111 // IPC::Sender implementation: |
| 113 virtual bool Send(IPC::Message* msg) OVERRIDE; | 112 virtual bool Send(IPC::Message* msg) OVERRIDE; |
| 114 | 113 |
| 115 // Create and connect to a command buffer in the GPU process. | 114 // Create and connect to a command buffer in the GPU process. |
| 116 CommandBufferProxy* CreateViewCommandBuffer( | 115 CommandBufferProxyImpl* CreateViewCommandBuffer( |
| 117 int32 surface_id, | 116 int32 surface_id, |
| 118 CommandBufferProxy* share_group, | 117 CommandBufferProxyImpl* share_group, |
| 119 const std::string& allowed_extensions, | 118 const std::string& allowed_extensions, |
| 120 const std::vector<int32>& attribs, | 119 const std::vector<int32>& attribs, |
| 121 const GURL& active_url, | 120 const GURL& active_url, |
| 122 gfx::GpuPreference gpu_preference); | 121 gfx::GpuPreference gpu_preference); |
| 123 | 122 |
| 124 // Create and connect to a command buffer in the GPU process. | 123 // Create and connect to a command buffer in the GPU process. |
| 125 CommandBufferProxy* CreateOffscreenCommandBuffer( | 124 CommandBufferProxyImpl* CreateOffscreenCommandBuffer( |
| 126 const gfx::Size& size, | 125 const gfx::Size& size, |
| 127 CommandBufferProxy* share_group, | 126 CommandBufferProxyImpl* share_group, |
| 128 const std::string& allowed_extensions, | 127 const std::string& allowed_extensions, |
| 129 const std::vector<int32>& attribs, | 128 const std::vector<int32>& attribs, |
| 130 const GURL& active_url, | 129 const GURL& active_url, |
| 131 gfx::GpuPreference gpu_preference); | 130 gfx::GpuPreference gpu_preference); |
| 132 | 131 |
| 133 // Creates a video decoder in the GPU process. | 132 // Creates a video decoder in the GPU process. |
| 134 // Returned pointer is owned by the CommandBufferProxy for |route_id|. | 133 // Returned pointer is owned by the CommandBufferProxy for |route_id|. |
| 135 GpuVideoDecodeAcceleratorHost* CreateVideoDecoder( | 134 GpuVideoDecodeAcceleratorHost* CreateVideoDecoder( |
| 136 int command_buffer_route_id, | 135 int command_buffer_route_id, |
| 137 media::VideoCodecProfile profile, | 136 media::VideoCodecProfile profile, |
| 138 media::VideoDecodeAccelerator::Client* client); | 137 media::VideoDecodeAccelerator::Client* client); |
| 139 | 138 |
| 140 // Destroy a command buffer created by this channel. | 139 // Destroy a command buffer created by this channel. |
| 141 void DestroyCommandBuffer(CommandBufferProxy* command_buffer); | 140 void DestroyCommandBuffer(CommandBufferProxyImpl* command_buffer); |
| 142 | 141 |
| 143 // Collect rendering stats from GPU process. | 142 // Collect rendering stats from GPU process. |
| 144 bool CollectRenderingStatsForSurface( | 143 bool CollectRenderingStatsForSurface( |
| 145 int surface_id, GpuRenderingStats* stats); | 144 int surface_id, GpuRenderingStats* stats); |
| 146 | 145 |
| 147 // Add a route for the current message loop. | 146 // Add a route for the current message loop. |
| 148 void AddRoute(int route_id, base::WeakPtr<IPC::Listener> listener); | 147 void AddRoute(int route_id, base::WeakPtr<IPC::Listener> listener); |
| 149 void RemoveRoute(int route_id); | 148 void RemoveRoute(int route_id); |
| 150 | 149 |
| 151 GpuChannelHostFactory* factory() const { return factory_; } | 150 GpuChannelHostFactory* factory() const { return factory_; } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 | 201 |
| 203 // A filter for sending messages from thread other than the main thread. | 202 // A filter for sending messages from thread other than the main thread. |
| 204 scoped_refptr<IPC::SyncMessageFilter> sync_filter_; | 203 scoped_refptr<IPC::SyncMessageFilter> sync_filter_; |
| 205 | 204 |
| 206 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); | 205 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); |
| 207 }; | 206 }; |
| 208 | 207 |
| 209 } // namespace content | 208 } // namespace content |
| 210 | 209 |
| 211 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 210 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
| OLD | NEW |