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