| 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_BROWSER_GPU_GPU_PROCESS_HOST_H_ | 5 #ifndef CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ |
| 6 #define CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ | 6 #define CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <set> | 10 #include <set> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/containers/hash_tables.h" | 14 #include "base/containers/hash_tables.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/threading/non_thread_safe.h" | 16 #include "base/threading/non_thread_safe.h" |
| 17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "content/browser/gpu/gpu_surface_tracker.h" | 18 #include "content/browser/gpu/gpu_surface_tracker.h" |
| 19 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
| 20 #include "content/common/gpu/gpu_memory_uma_stats.h" | 20 #include "content/common/gpu/gpu_memory_uma_stats.h" |
| 21 #include "content/common/gpu/gpu_process_launch_causes.h" | 21 #include "content/common/gpu/gpu_process_launch_causes.h" |
| 22 #include "content/common/gpu/gpu_result_codes.h" | 22 #include "content/common/gpu/gpu_result_codes.h" |
| 23 #include "content/public/browser/browser_child_process_host_delegate.h" | 23 #include "content/public/browser/browser_child_process_host_delegate.h" |
| 24 #include "content/public/browser/gpu_data_manager.h" | 24 #include "content/public/browser/gpu_data_manager.h" |
| 25 #include "gpu/command_buffer/common/constants.h" | 25 #include "gpu/command_buffer/common/constants.h" |
| 26 #include "gpu/config/gpu_info.h" | 26 #include "gpu/config/gpu_info.h" |
| 27 #include "ipc/ipc_sender.h" | 27 #include "ipc/ipc_sender.h" |
| 28 #include "ipc/message_filter.h" | 28 #include "ipc/message_filter.h" |
| 29 #include "ui/gfx/gpu_memory_buffer.h" |
| 29 #include "ui/gfx/native_widget_types.h" | 30 #include "ui/gfx/native_widget_types.h" |
| 30 #include "ui/gfx/size.h" | 31 #include "ui/gfx/size.h" |
| 31 #include "url/gurl.h" | 32 #include "url/gurl.h" |
| 32 | 33 |
| 33 struct GPUCreateCommandBufferConfig; | 34 struct GPUCreateCommandBufferConfig; |
| 34 | 35 |
| 35 namespace gfx { | |
| 36 struct GpuMemoryBufferHandle; | |
| 37 } | |
| 38 | |
| 39 namespace IPC { | 36 namespace IPC { |
| 40 struct ChannelHandle; | 37 struct ChannelHandle; |
| 41 } | 38 } |
| 42 | 39 |
| 43 namespace content { | 40 namespace content { |
| 44 class BrowserChildProcessHostImpl; | 41 class BrowserChildProcessHostImpl; |
| 45 class GpuMainThread; | 42 class GpuMainThread; |
| 46 class RenderWidgetHostViewFrameSubscriber; | 43 class RenderWidgetHostViewFrameSubscriber; |
| 47 class ShaderDiskCache; | 44 class ShaderDiskCache; |
| 48 | 45 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 int surface_id, | 115 int surface_id, |
| 119 int client_id, | 116 int client_id, |
| 120 const GPUCreateCommandBufferConfig& init_params, | 117 const GPUCreateCommandBufferConfig& init_params, |
| 121 int route_id, | 118 int route_id, |
| 122 const CreateCommandBufferCallback& callback); | 119 const CreateCommandBufferCallback& callback); |
| 123 | 120 |
| 124 // Tells the GPU process to create a new GPU memory buffer using the given | 121 // Tells the GPU process to create a new GPU memory buffer using the given |
| 125 // handle. | 122 // handle. |
| 126 void CreateGpuMemoryBuffer(const gfx::GpuMemoryBufferHandle& handle, | 123 void CreateGpuMemoryBuffer(const gfx::GpuMemoryBufferHandle& handle, |
| 127 const gfx::Size& size, | 124 const gfx::Size& size, |
| 128 unsigned internalformat, | 125 gfx::GpuMemoryBuffer::Format format, |
| 129 unsigned usage, | 126 gfx::GpuMemoryBuffer::Usage usage, |
| 130 const CreateGpuMemoryBufferCallback& callback); | 127 const CreateGpuMemoryBufferCallback& callback); |
| 131 | 128 |
| 132 // Tells the GPU process to destroy GPU memory buffer. | 129 // Tells the GPU process to destroy GPU memory buffer. |
| 133 void DestroyGpuMemoryBuffer(const gfx::GpuMemoryBufferHandle& handle, | 130 void DestroyGpuMemoryBuffer(const gfx::GpuMemoryBufferHandle& handle, |
| 134 int sync_point); | 131 int sync_point); |
| 135 | 132 |
| 136 // What kind of GPU process, e.g. sandboxed or unsandboxed. | 133 // What kind of GPU process, e.g. sandboxed or unsandboxed. |
| 137 GpuProcessKind kind(); | 134 GpuProcessKind kind(); |
| 138 | 135 |
| 139 void ForceShutdown(); | 136 void ForceShutdown(); |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 typedef std::multimap<int, scoped_refptr<GpuSurfaceTracker::SurfaceRef> > | 274 typedef std::multimap<int, scoped_refptr<GpuSurfaceTracker::SurfaceRef> > |
| 278 SurfaceRefMap; | 275 SurfaceRefMap; |
| 279 SurfaceRefMap surface_refs_; | 276 SurfaceRefMap surface_refs_; |
| 280 | 277 |
| 281 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); | 278 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); |
| 282 }; | 279 }; |
| 283 | 280 |
| 284 } // namespace content | 281 } // namespace content |
| 285 | 282 |
| 286 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ | 283 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ |
| OLD | NEW |