OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_RENDERER_GPU_CHANNEL_HOST_H_ | 5 #ifndef CONTENT_RENDERER_GPU_CHANNEL_HOST_H_ |
6 #define CONTENT_RENDERER_GPU_CHANNEL_HOST_H_ | 6 #define CONTENT_RENDERER_GPU_CHANNEL_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/hash_tables.h" | 12 #include "base/hash_tables.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/process_util.h" | 14 #include "base/process_util.h" |
15 #include "content/common/gpu/gpu_info.h" | 15 #include "content/common/gpu/gpu_info.h" |
16 #include "content/common/message_router.h" | 16 #include "content/common/message_router.h" |
17 #include "ipc/ipc_channel_handle.h" | 17 #include "ipc/ipc_channel_handle.h" |
18 #include "ipc/ipc_sync_channel.h" | 18 #include "ipc/ipc_sync_channel.h" |
19 #include "ui/gfx/native_widget_types.h" | 19 #include "ui/gfx/native_widget_types.h" |
20 #include "ui/gfx/size.h" | 20 #include "ui/gfx/size.h" |
21 | 21 |
22 class CommandBufferProxy; | 22 class CommandBufferProxy; |
| 23 class GpuSurfaceProxy; |
23 class GURL; | 24 class GURL; |
24 class GpuVideoServiceHost; | 25 class GpuVideoServiceHost; |
25 class TransportTextureService; | 26 class TransportTextureService; |
26 | 27 |
27 // Encapsulates an IPC channel between the renderer and one plugin process. | 28 // Encapsulates an IPC channel between the renderer and one plugin process. |
28 // On the plugin side there's a corresponding GpuChannel. | 29 // On the plugin side there's a corresponding GpuChannel. |
29 class GpuChannelHost : public IPC::Channel::Listener, | 30 class GpuChannelHost : public IPC::Channel::Listener, |
30 public IPC::Message::Sender, | 31 public IPC::Message::Sender, |
31 public base::RefCountedThreadSafe<GpuChannelHost> { | 32 public base::RefCountedThreadSafe<GpuChannelHost> { |
32 public: | 33 public: |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 CommandBufferProxy* parent, | 79 CommandBufferProxy* parent, |
79 const gfx::Size& size, | 80 const gfx::Size& size, |
80 const std::string& allowed_extensions, | 81 const std::string& allowed_extensions, |
81 const std::vector<int32>& attribs, | 82 const std::vector<int32>& attribs, |
82 uint32 parent_texture_id, | 83 uint32 parent_texture_id, |
83 const GURL& active_url); | 84 const GURL& active_url); |
84 | 85 |
85 // Destroy a command buffer created by this channel. | 86 // Destroy a command buffer created by this channel. |
86 void DestroyCommandBuffer(CommandBufferProxy* command_buffer); | 87 void DestroyCommandBuffer(CommandBufferProxy* command_buffer); |
87 | 88 |
| 89 // Create a surface in the GPU process. Returns null on failure. |
| 90 GpuSurfaceProxy* CreateOffscreenSurface(const gfx::Size& size); |
| 91 |
| 92 // Destroy a surface in the GPU process. |
| 93 void DestroySurface(GpuSurfaceProxy* surface); |
| 94 |
88 GpuVideoServiceHost* gpu_video_service_host() { | 95 GpuVideoServiceHost* gpu_video_service_host() { |
89 return gpu_video_service_host_.get(); | 96 return gpu_video_service_host_.get(); |
90 } | 97 } |
91 | 98 |
92 TransportTextureService* transport_texture_service() { | 99 TransportTextureService* transport_texture_service() { |
93 return transport_texture_service_.get(); | 100 return transport_texture_service_.get(); |
94 } | 101 } |
95 | 102 |
96 private: | 103 private: |
97 State state_; | 104 State state_; |
(...skipping 16 matching lines...) Expand all Loading... |
114 scoped_refptr<GpuVideoServiceHost> gpu_video_service_host_; | 121 scoped_refptr<GpuVideoServiceHost> gpu_video_service_host_; |
115 | 122 |
116 // This is a MessageFilter to intercept IPC messages related to transport | 123 // This is a MessageFilter to intercept IPC messages related to transport |
117 // textures. These messages are routed to TransportTextureHost. | 124 // textures. These messages are routed to TransportTextureHost. |
118 scoped_refptr<TransportTextureService> transport_texture_service_; | 125 scoped_refptr<TransportTextureService> transport_texture_service_; |
119 | 126 |
120 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); | 127 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); |
121 }; | 128 }; |
122 | 129 |
123 #endif // CONTENT_RENDERER_GPU_CHANNEL_HOST_H_ | 130 #endif // CONTENT_RENDERER_GPU_CHANNEL_HOST_H_ |
OLD | NEW |