| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "content/public/browser/gpu_data_manager.h" | 27 #include "content/public/browser/gpu_data_manager.h" |
| 28 #include "gpu/command_buffer/common/constants.h" | 28 #include "gpu/command_buffer/common/constants.h" |
| 29 #include "gpu/config/gpu_info.h" | 29 #include "gpu/config/gpu_info.h" |
| 30 #include "ipc/ipc_sender.h" | 30 #include "ipc/ipc_sender.h" |
| 31 #include "ipc/message_filter.h" | 31 #include "ipc/message_filter.h" |
| 32 #include "ui/gfx/geometry/size.h" | 32 #include "ui/gfx/geometry/size.h" |
| 33 #include "ui/gfx/gpu_memory_buffer.h" | 33 #include "ui/gfx/gpu_memory_buffer.h" |
| 34 #include "ui/gfx/native_widget_types.h" | 34 #include "ui/gfx/native_widget_types.h" |
| 35 #include "url/gurl.h" | 35 #include "url/gurl.h" |
| 36 | 36 |
| 37 struct GPUCreateCommandBufferConfig; | |
| 38 | |
| 39 namespace IPC { | 37 namespace IPC { |
| 40 struct ChannelHandle; | 38 struct ChannelHandle; |
| 41 } | 39 } |
| 42 | 40 |
| 43 namespace gpu { | 41 namespace gpu { |
| 44 struct SyncToken; | 42 struct SyncToken; |
| 45 } | 43 } |
| 46 | 44 |
| 47 namespace content { | 45 namespace content { |
| 48 class BrowserChildProcessHostImpl; | 46 class BrowserChildProcessHostImpl; |
| 49 class GpuMainThread; | 47 class GpuMainThread; |
| 50 class InProcessChildThreadParams; | 48 class InProcessChildThreadParams; |
| 51 class MojoApplicationHost; | 49 class MojoApplicationHost; |
| 52 class RenderWidgetHostViewFrameSubscriber; | 50 class RenderWidgetHostViewFrameSubscriber; |
| 53 class ShaderDiskCache; | 51 class ShaderDiskCache; |
| 52 struct GpuCreateCommandBufferConfig; |
| 54 | 53 |
| 55 typedef base::Thread* (*GpuMainThreadFactoryFunction)( | 54 typedef base::Thread* (*GpuMainThreadFactoryFunction)( |
| 56 const InProcessChildThreadParams&); | 55 const InProcessChildThreadParams&); |
| 57 | 56 |
| 58 class GpuProcessHost : public BrowserChildProcessHostDelegate, | 57 class GpuProcessHost : public BrowserChildProcessHostDelegate, |
| 59 public IPC::Sender, | 58 public IPC::Sender, |
| 60 public base::NonThreadSafe { | 59 public base::NonThreadSafe { |
| 61 public: | 60 public: |
| 62 enum GpuProcessKind { | 61 enum GpuProcessKind { |
| 63 GPU_PROCESS_KIND_UNSANDBOXED, | 62 GPU_PROCESS_KIND_UNSANDBOXED, |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // and GPUInfo, we call the callback. | 114 // and GPUInfo, we call the callback. |
| 116 void EstablishGpuChannel(int client_id, | 115 void EstablishGpuChannel(int client_id, |
| 117 uint64_t client_tracing_id, | 116 uint64_t client_tracing_id, |
| 118 bool preempts, | 117 bool preempts, |
| 119 bool preempted, | 118 bool preempted, |
| 120 bool allow_real_time_streams, | 119 bool allow_real_time_streams, |
| 121 const EstablishChannelCallback& callback); | 120 const EstablishChannelCallback& callback); |
| 122 | 121 |
| 123 // Tells the GPU process to create a new command buffer that draws into the | 122 // Tells the GPU process to create a new command buffer that draws into the |
| 124 // given surface. | 123 // given surface. |
| 125 void CreateViewCommandBuffer( | 124 void CreateViewCommandBuffer(const gfx::GLSurfaceHandle& compositing_surface, |
| 126 const gfx::GLSurfaceHandle& compositing_surface, | 125 int client_id, |
| 127 int client_id, | 126 const GpuCreateCommandBufferConfig& init_params, |
| 128 const GPUCreateCommandBufferConfig& init_params, | 127 int route_id, |
| 129 int route_id, | 128 const CreateCommandBufferCallback& callback); |
| 130 const CreateCommandBufferCallback& callback); | |
| 131 | 129 |
| 132 // Tells the GPU process to create a new GPU memory buffer. | 130 // Tells the GPU process to create a new GPU memory buffer. |
| 133 void CreateGpuMemoryBuffer(gfx::GpuMemoryBufferId id, | 131 void CreateGpuMemoryBuffer(gfx::GpuMemoryBufferId id, |
| 134 const gfx::Size& size, | 132 const gfx::Size& size, |
| 135 gfx::BufferFormat format, | 133 gfx::BufferFormat format, |
| 136 gfx::BufferUsage usage, | 134 gfx::BufferUsage usage, |
| 137 int client_id, | 135 int client_id, |
| 138 int32_t surface_id, | 136 int32_t surface_id, |
| 139 const CreateGpuMemoryBufferCallback& callback); | 137 const CreateGpuMemoryBufferCallback& callback); |
| 140 | 138 |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 // Browser-side Mojo endpoint which sets up a Mojo channel with the child | 297 // Browser-side Mojo endpoint which sets up a Mojo channel with the child |
| 300 // process and contains the browser's ServiceRegistry. | 298 // process and contains the browser's ServiceRegistry. |
| 301 scoped_ptr<MojoApplicationHost> mojo_application_host_; | 299 scoped_ptr<MojoApplicationHost> mojo_application_host_; |
| 302 | 300 |
| 303 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); | 301 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); |
| 304 }; | 302 }; |
| 305 | 303 |
| 306 } // namespace content | 304 } // namespace content |
| 307 | 305 |
| 308 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ | 306 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_H_ |
| OLD | NEW |