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 30 matching lines...) Expand all Loading... |
41 } | 41 } |
42 } | 42 } |
43 | 43 |
44 namespace IPC { | 44 namespace IPC { |
45 class MessageFilter; | 45 class MessageFilter; |
46 } | 46 } |
47 | 47 |
48 namespace content { | 48 namespace content { |
49 class GpuChannelManager; | 49 class GpuChannelManager; |
50 class GpuChannelMessageFilter; | 50 class GpuChannelMessageFilter; |
| 51 class GpuJpegDecodeAccelerator; |
51 class GpuWatchdog; | 52 class GpuWatchdog; |
52 | 53 |
53 // Encapsulates an IPC channel between the GPU process and one renderer | 54 // Encapsulates an IPC channel between the GPU process and one renderer |
54 // process. On the renderer side there's a corresponding GpuChannelHost. | 55 // process. On the renderer side there's a corresponding GpuChannelHost. |
55 class GpuChannel : public IPC::Listener, public IPC::Sender, | 56 class GpuChannel : public IPC::Listener, public IPC::Sender, |
56 public gpu::gles2::SubscriptionRefSet::Observer { | 57 public gpu::gles2::SubscriptionRefSet::Observer { |
57 public: | 58 public: |
58 // Takes ownership of the renderer process handle. | 59 // Takes ownership of the renderer process handle. |
59 GpuChannel(GpuChannelManager* gpu_channel_manager, | 60 GpuChannel(GpuChannelManager* gpu_channel_manager, |
60 GpuWatchdog* watchdog, | 61 GpuWatchdog* watchdog, |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 178 |
178 void HandleMessage(); | 179 void HandleMessage(); |
179 | 180 |
180 // Message handlers. | 181 // Message handlers. |
181 void OnCreateOffscreenCommandBuffer( | 182 void OnCreateOffscreenCommandBuffer( |
182 const gfx::Size& size, | 183 const gfx::Size& size, |
183 const GPUCreateCommandBufferConfig& init_params, | 184 const GPUCreateCommandBufferConfig& init_params, |
184 int32 route_id, | 185 int32 route_id, |
185 bool* succeeded); | 186 bool* succeeded); |
186 void OnDestroyCommandBuffer(int32 route_id); | 187 void OnDestroyCommandBuffer(int32 route_id); |
| 188 void OnCreateJpegDecoder(int32 route_id, IPC::Message* reply_msg); |
187 | 189 |
188 // Decrement the count of unhandled IPC messages and defer preemption. | 190 // Decrement the count of unhandled IPC messages and defer preemption. |
189 void MessageProcessed(); | 191 void MessageProcessed(); |
190 | 192 |
191 // The lifetime of objects of this class is managed by a GpuChannelManager. | 193 // The lifetime of objects of this class is managed by a GpuChannelManager. |
192 // The GpuChannelManager destroy all the GpuChannels that they own when they | 194 // The GpuChannelManager destroy all the GpuChannels that they own when they |
193 // are destroyed. So a raw pointer is safe. | 195 // are destroyed. So a raw pointer is safe. |
194 GpuChannelManager* gpu_channel_manager_; | 196 GpuChannelManager* gpu_channel_manager_; |
195 | 197 |
196 scoped_ptr<IPC::SyncChannel> channel_; | 198 scoped_ptr<IPC::SyncChannel> channel_; |
(...skipping 25 matching lines...) Expand all Loading... |
222 | 224 |
223 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; | 225 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; |
224 | 226 |
225 scoped_refptr<gpu::gles2::SubscriptionRefSet> subscription_ref_set_; | 227 scoped_refptr<gpu::gles2::SubscriptionRefSet> subscription_ref_set_; |
226 | 228 |
227 scoped_refptr<gpu::ValueStateMap> pending_valuebuffer_state_; | 229 scoped_refptr<gpu::ValueStateMap> pending_valuebuffer_state_; |
228 | 230 |
229 typedef IDMap<GpuCommandBufferStub, IDMapOwnPointer> StubMap; | 231 typedef IDMap<GpuCommandBufferStub, IDMapOwnPointer> StubMap; |
230 StubMap stubs_; | 232 StubMap stubs_; |
231 | 233 |
| 234 scoped_ptr<GpuJpegDecodeAccelerator> jpeg_decoder_; |
| 235 |
232 bool log_messages_; // True if we should log sent and received messages. | 236 bool log_messages_; // True if we should log sent and received messages. |
233 gpu::gles2::DisallowedFeatures disallowed_features_; | 237 gpu::gles2::DisallowedFeatures disallowed_features_; |
234 GpuWatchdog* watchdog_; | 238 GpuWatchdog* watchdog_; |
235 bool software_; | 239 bool software_; |
236 bool handle_messages_scheduled_; | 240 bool handle_messages_scheduled_; |
237 IPC::Message* currently_processing_message_; | 241 IPC::Message* currently_processing_message_; |
238 | 242 |
239 scoped_refptr<GpuChannelMessageFilter> filter_; | 243 scoped_refptr<GpuChannelMessageFilter> filter_; |
240 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 244 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
241 | 245 |
242 size_t num_stubs_descheduled_; | 246 size_t num_stubs_descheduled_; |
243 | 247 |
244 bool allow_future_sync_points_; | 248 bool allow_future_sync_points_; |
245 | 249 |
246 // Member variables should appear before the WeakPtrFactory, to ensure | 250 // Member variables should appear before the WeakPtrFactory, to ensure |
247 // that any WeakPtrs to Controller are invalidated before its members | 251 // that any WeakPtrs to Controller are invalidated before its members |
248 // variable's destructors are executed, rendering them invalid. | 252 // variable's destructors are executed, rendering them invalid. |
249 base::WeakPtrFactory<GpuChannel> weak_factory_; | 253 base::WeakPtrFactory<GpuChannel> weak_factory_; |
250 | 254 |
251 DISALLOW_COPY_AND_ASSIGN(GpuChannel); | 255 DISALLOW_COPY_AND_ASSIGN(GpuChannel); |
252 }; | 256 }; |
253 | 257 |
254 } // namespace content | 258 } // namespace content |
255 | 259 |
256 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_H_ | 260 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_H_ |
OLD | NEW |