| 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_GPU_CHANNEL_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_CHANNEL_H_ |
| 6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_H_ | 6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 struct GPUCreateCommandBufferConfig; | 32 struct GPUCreateCommandBufferConfig; |
| 33 class GpuWatchdog; | 33 class GpuWatchdog; |
| 34 | 34 |
| 35 namespace base { | 35 namespace base { |
| 36 class MessageLoopProxy; | 36 class MessageLoopProxy; |
| 37 class WaitableEvent; | 37 class WaitableEvent; |
| 38 } | 38 } |
| 39 | 39 |
| 40 namespace gpu { | 40 namespace gpu { |
| 41 struct RefCountedCounter; | 41 struct RefCountedCounter; |
| 42 namespace gles2 { |
| 43 class ImageManager; |
| 44 } |
| 42 } | 45 } |
| 43 | 46 |
| 44 #if defined(OS_ANDROID) | 47 #if defined(OS_ANDROID) |
| 45 namespace content { | 48 namespace content { |
| 46 class StreamTextureManagerAndroid; | 49 class StreamTextureManagerAndroid; |
| 47 } | 50 } |
| 48 #endif | 51 #endif |
| 49 | 52 |
| 50 // Encapsulates an IPC channel between the GPU process and one renderer | 53 // Encapsulates an IPC channel between the GPU process and one renderer |
| 51 // process. On the renderer side there's a corresponding GpuChannelHost. | 54 // process. On the renderer side there's a corresponding GpuChannelHost. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // transitions from the unscheduled to the scheduled state. When this occurs | 96 // transitions from the unscheduled to the scheduled state. When this occurs |
| 94 // deferred IPC messaged are handled. | 97 // deferred IPC messaged are handled. |
| 95 void OnScheduled(); | 98 void OnScheduled(); |
| 96 | 99 |
| 97 void CreateViewCommandBuffer( | 100 void CreateViewCommandBuffer( |
| 98 const gfx::GLSurfaceHandle& window, | 101 const gfx::GLSurfaceHandle& window, |
| 99 int32 surface_id, | 102 int32 surface_id, |
| 100 const GPUCreateCommandBufferConfig& init_params, | 103 const GPUCreateCommandBufferConfig& init_params, |
| 101 int32* route_id); | 104 int32* route_id); |
| 102 | 105 |
| 106 void CreateImage( |
| 107 gfx::PluginWindowHandle window, |
| 108 int32 image_id, |
| 109 gfx::Size* size); |
| 110 void DeleteImage(int32 image_id); |
| 111 |
| 103 gfx::GLShareGroup* share_group() const { return share_group_.get(); } | 112 gfx::GLShareGroup* share_group() const { return share_group_.get(); } |
| 104 | 113 |
| 105 GpuCommandBufferStub* LookupCommandBuffer(int32 route_id); | 114 GpuCommandBufferStub* LookupCommandBuffer(int32 route_id); |
| 106 | 115 |
| 107 void LoseAllContexts(); | 116 void LoseAllContexts(); |
| 108 | 117 |
| 109 // Destroy channel and all contained contexts. | 118 // Destroy channel and all contained contexts. |
| 110 void DestroySoon(); | 119 void DestroySoon(); |
| 111 | 120 |
| 112 // Generate a route ID guaranteed to be unique for this channel. | 121 // Generate a route ID guaranteed to be unique for this channel. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 std::string channel_id_; | 200 std::string channel_id_; |
| 192 | 201 |
| 193 // Used to implement message routing functionality to CommandBuffer objects | 202 // Used to implement message routing functionality to CommandBuffer objects |
| 194 MessageRouter router_; | 203 MessageRouter router_; |
| 195 | 204 |
| 196 // The share group that all contexts associated with a particular renderer | 205 // The share group that all contexts associated with a particular renderer |
| 197 // process use. | 206 // process use. |
| 198 scoped_refptr<gfx::GLShareGroup> share_group_; | 207 scoped_refptr<gfx::GLShareGroup> share_group_; |
| 199 | 208 |
| 200 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; | 209 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; |
| 210 scoped_refptr<gpu::gles2::ImageManager> image_manager_; |
| 201 | 211 |
| 202 #if defined(ENABLE_GPU) | 212 #if defined(ENABLE_GPU) |
| 203 typedef IDMap<GpuCommandBufferStub, IDMapOwnPointer> StubMap; | 213 typedef IDMap<GpuCommandBufferStub, IDMapOwnPointer> StubMap; |
| 204 StubMap stubs_; | 214 StubMap stubs_; |
| 205 #endif // defined (ENABLE_GPU) | 215 #endif // defined (ENABLE_GPU) |
| 206 | 216 |
| 207 bool log_messages_; // True if we should log sent and received messages. | 217 bool log_messages_; // True if we should log sent and received messages. |
| 208 gpu::gles2::DisallowedFeatures disallowed_features_; | 218 gpu::gles2::DisallowedFeatures disallowed_features_; |
| 209 GpuWatchdog* watchdog_; | 219 GpuWatchdog* watchdog_; |
| 210 bool software_; | 220 bool software_; |
| 211 bool handle_messages_scheduled_; | 221 bool handle_messages_scheduled_; |
| 212 bool processed_get_state_fast_; | 222 bool processed_get_state_fast_; |
| 213 | 223 |
| 214 #if defined(OS_ANDROID) | 224 #if defined(OS_ANDROID) |
| 215 scoped_ptr<content::StreamTextureManagerAndroid> stream_texture_manager_; | 225 scoped_ptr<content::StreamTextureManagerAndroid> stream_texture_manager_; |
| 216 #endif | 226 #endif |
| 217 | 227 |
| 218 base::WeakPtrFactory<GpuChannel> weak_factory_; | 228 base::WeakPtrFactory<GpuChannel> weak_factory_; |
| 219 | 229 |
| 220 DISALLOW_COPY_AND_ASSIGN(GpuChannel); | 230 DISALLOW_COPY_AND_ASSIGN(GpuChannel); |
| 221 }; | 231 }; |
| 222 | 232 |
| 223 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_H_ | 233 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_H_ |
| OLD | NEW |