| 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 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 struct GPUCreateCommandBufferConfig; | 28 struct GPUCreateCommandBufferConfig; |
| 29 | 29 |
| 30 namespace base { | 30 namespace base { |
| 31 class MessageLoopProxy; | 31 class MessageLoopProxy; |
| 32 class WaitableEvent; | 32 class WaitableEvent; |
| 33 } | 33 } |
| 34 | 34 |
| 35 namespace gpu { | 35 namespace gpu { |
| 36 class PreemptionFlag; | 36 class PreemptionFlag; |
| 37 namespace gles2 { | |
| 38 class ImageManager; | |
| 39 } | |
| 40 } | 37 } |
| 41 | 38 |
| 42 namespace IPC { | 39 namespace IPC { |
| 43 class MessageFilter; | 40 class MessageFilter; |
| 44 } | 41 } |
| 45 | 42 |
| 46 namespace content { | 43 namespace content { |
| 47 class DevToolsGpuAgent; | 44 class DevToolsGpuAgent; |
| 48 class GpuChannelManager; | 45 class GpuChannelManager; |
| 49 class GpuChannelMessageFilter; | 46 class GpuChannelMessageFilter; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 // descheduled states. When any stub is descheduled, we stop preempting | 105 // descheduled states. When any stub is descheduled, we stop preempting |
| 109 // other channels. | 106 // other channels. |
| 110 void StubSchedulingChanged(bool scheduled); | 107 void StubSchedulingChanged(bool scheduled); |
| 111 | 108 |
| 112 CreateCommandBufferResult CreateViewCommandBuffer( | 109 CreateCommandBufferResult CreateViewCommandBuffer( |
| 113 const gfx::GLSurfaceHandle& window, | 110 const gfx::GLSurfaceHandle& window, |
| 114 int32 surface_id, | 111 int32 surface_id, |
| 115 const GPUCreateCommandBufferConfig& init_params, | 112 const GPUCreateCommandBufferConfig& init_params, |
| 116 int32 route_id); | 113 int32 route_id); |
| 117 | 114 |
| 118 void CreateImage( | |
| 119 gfx::PluginWindowHandle window, | |
| 120 int32 image_id, | |
| 121 gfx::Size* size); | |
| 122 void DeleteImage(int32 image_id); | |
| 123 | |
| 124 gfx::GLShareGroup* share_group() const { return share_group_.get(); } | 115 gfx::GLShareGroup* share_group() const { return share_group_.get(); } |
| 125 | 116 |
| 126 GpuCommandBufferStub* LookupCommandBuffer(int32 route_id); | 117 GpuCommandBufferStub* LookupCommandBuffer(int32 route_id); |
| 127 | 118 |
| 128 void LoseAllContexts(); | 119 void LoseAllContexts(); |
| 129 void MarkAllContextsLost(); | 120 void MarkAllContextsLost(); |
| 130 | 121 |
| 131 // Called to add a listener for a particular message routing ID. | 122 // Called to add a listener for a particular message routing ID. |
| 132 // Returns true if succeeded. | 123 // Returns true if succeeded. |
| 133 bool AddRoute(int32 route_id, IPC::Listener* listener); | 124 bool AddRoute(int32 route_id, IPC::Listener* listener); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 std::string channel_id_; | 193 std::string channel_id_; |
| 203 | 194 |
| 204 // Used to implement message routing functionality to CommandBuffer objects | 195 // Used to implement message routing functionality to CommandBuffer objects |
| 205 MessageRouter router_; | 196 MessageRouter router_; |
| 206 | 197 |
| 207 // The share group that all contexts associated with a particular renderer | 198 // The share group that all contexts associated with a particular renderer |
| 208 // process use. | 199 // process use. |
| 209 scoped_refptr<gfx::GLShareGroup> share_group_; | 200 scoped_refptr<gfx::GLShareGroup> share_group_; |
| 210 | 201 |
| 211 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; | 202 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; |
| 212 scoped_refptr<gpu::gles2::ImageManager> image_manager_; | |
| 213 | 203 |
| 214 typedef IDMap<GpuCommandBufferStub, IDMapOwnPointer> StubMap; | 204 typedef IDMap<GpuCommandBufferStub, IDMapOwnPointer> StubMap; |
| 215 StubMap stubs_; | 205 StubMap stubs_; |
| 216 | 206 |
| 217 bool log_messages_; // True if we should log sent and received messages. | 207 bool log_messages_; // True if we should log sent and received messages. |
| 218 gpu::gles2::DisallowedFeatures disallowed_features_; | 208 gpu::gles2::DisallowedFeatures disallowed_features_; |
| 219 GpuWatchdog* watchdog_; | 209 GpuWatchdog* watchdog_; |
| 220 bool software_; | 210 bool software_; |
| 221 bool handle_messages_scheduled_; | 211 bool handle_messages_scheduled_; |
| 222 IPC::Message* currently_processing_message_; | 212 IPC::Message* currently_processing_message_; |
| 223 | 213 |
| 224 base::WeakPtrFactory<GpuChannel> weak_factory_; | 214 base::WeakPtrFactory<GpuChannel> weak_factory_; |
| 225 | 215 |
| 226 scoped_refptr<GpuChannelMessageFilter> filter_; | 216 scoped_refptr<GpuChannelMessageFilter> filter_; |
| 227 scoped_refptr<base::MessageLoopProxy> io_message_loop_; | 217 scoped_refptr<base::MessageLoopProxy> io_message_loop_; |
| 228 scoped_ptr<DevToolsGpuAgent> devtools_gpu_agent_; | 218 scoped_ptr<DevToolsGpuAgent> devtools_gpu_agent_; |
| 229 | 219 |
| 230 size_t num_stubs_descheduled_; | 220 size_t num_stubs_descheduled_; |
| 231 | 221 |
| 232 bool allow_future_sync_points_; | 222 bool allow_future_sync_points_; |
| 233 | 223 |
| 234 DISALLOW_COPY_AND_ASSIGN(GpuChannel); | 224 DISALLOW_COPY_AND_ASSIGN(GpuChannel); |
| 235 }; | 225 }; |
| 236 | 226 |
| 237 } // namespace content | 227 } // namespace content |
| 238 | 228 |
| 239 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_H_ | 229 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_H_ |
| OLD | NEW |