| 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 union ValueState; |
| 38 class ValueStateMap; |
| 39 namespace gles2 { |
| 40 } |
| 37 } | 41 } |
| 38 | 42 |
| 39 namespace IPC { | 43 namespace IPC { |
| 40 class MessageFilter; | 44 class MessageFilter; |
| 41 } | 45 } |
| 42 | 46 |
| 43 namespace content { | 47 namespace content { |
| 44 class DevToolsGpuAgent; | 48 class DevToolsGpuAgent; |
| 45 class GpuChannelManager; | 49 class GpuChannelManager; |
| 46 class GpuChannelMessageFilter; | 50 class GpuChannelMessageFilter; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 uint64 GetMemoryUsage(); | 148 uint64 GetMemoryUsage(); |
| 145 | 149 |
| 146 scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer( | 150 scoped_refptr<gfx::GLImage> CreateImageForGpuMemoryBuffer( |
| 147 const gfx::GpuMemoryBufferHandle& handle, | 151 const gfx::GpuMemoryBufferHandle& handle, |
| 148 const gfx::Size& size, | 152 const gfx::Size& size, |
| 149 gfx::GpuMemoryBuffer::Format format, | 153 gfx::GpuMemoryBuffer::Format format, |
| 150 uint32 internalformat); | 154 uint32 internalformat); |
| 151 | 155 |
| 152 bool allow_future_sync_points() const { return allow_future_sync_points_; } | 156 bool allow_future_sync_points() const { return allow_future_sync_points_; } |
| 153 | 157 |
| 158 void HandleUpdateValueState(unsigned int target, |
| 159 const gpu::ValueState& state); |
| 160 |
| 161 // Visible for testing. |
| 162 const gpu::ValueStateMap* pending_valuebuffer_state() const { |
| 163 return pending_valuebuffer_state_.get(); |
| 164 } |
| 165 |
| 154 private: | 166 private: |
| 155 friend class GpuChannelMessageFilter; | 167 friend class GpuChannelMessageFilter; |
| 156 | 168 |
| 157 void OnDestroy(); | 169 void OnDestroy(); |
| 158 | 170 |
| 159 bool OnControlMessageReceived(const IPC::Message& msg); | 171 bool OnControlMessageReceived(const IPC::Message& msg); |
| 160 | 172 |
| 161 void HandleMessage(); | 173 void HandleMessage(); |
| 162 | 174 |
| 163 // Message handlers. | 175 // Message handlers. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 212 |
| 201 // Used to implement message routing functionality to CommandBuffer objects | 213 // Used to implement message routing functionality to CommandBuffer objects |
| 202 MessageRouter router_; | 214 MessageRouter router_; |
| 203 | 215 |
| 204 // The share group that all contexts associated with a particular renderer | 216 // The share group that all contexts associated with a particular renderer |
| 205 // process use. | 217 // process use. |
| 206 scoped_refptr<gfx::GLShareGroup> share_group_; | 218 scoped_refptr<gfx::GLShareGroup> share_group_; |
| 207 | 219 |
| 208 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; | 220 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; |
| 209 | 221 |
| 222 scoped_refptr<gpu::ValueStateMap> pending_valuebuffer_state_; |
| 223 |
| 210 typedef IDMap<GpuCommandBufferStub, IDMapOwnPointer> StubMap; | 224 typedef IDMap<GpuCommandBufferStub, IDMapOwnPointer> StubMap; |
| 211 StubMap stubs_; | 225 StubMap stubs_; |
| 212 | 226 |
| 213 bool log_messages_; // True if we should log sent and received messages. | 227 bool log_messages_; // True if we should log sent and received messages. |
| 214 gpu::gles2::DisallowedFeatures disallowed_features_; | 228 gpu::gles2::DisallowedFeatures disallowed_features_; |
| 215 GpuWatchdog* watchdog_; | 229 GpuWatchdog* watchdog_; |
| 216 bool software_; | 230 bool software_; |
| 217 bool handle_messages_scheduled_; | 231 bool handle_messages_scheduled_; |
| 218 IPC::Message* currently_processing_message_; | 232 IPC::Message* currently_processing_message_; |
| 219 | 233 |
| 220 scoped_refptr<GpuChannelMessageFilter> filter_; | 234 scoped_refptr<GpuChannelMessageFilter> filter_; |
| 221 scoped_refptr<base::MessageLoopProxy> io_message_loop_; | 235 scoped_refptr<base::MessageLoopProxy> io_message_loop_; |
| 222 scoped_ptr<DevToolsGpuAgent> devtools_gpu_agent_; | 236 scoped_ptr<DevToolsGpuAgent> devtools_gpu_agent_; |
| 223 | 237 |
| 224 size_t num_stubs_descheduled_; | 238 size_t num_stubs_descheduled_; |
| 225 | 239 |
| 226 bool allow_future_sync_points_; | 240 bool allow_future_sync_points_; |
| 227 | 241 |
| 228 // Member variables should appear before the WeakPtrFactory, to ensure | 242 // Member variables should appear before the WeakPtrFactory, to ensure |
| 229 // that any WeakPtrs to Controller are invalidated before its members | 243 // that any WeakPtrs to Controller are invalidated before its members |
| 230 // variable's destructors are executed, rendering them invalid. | 244 // variable's destructors are executed, rendering them invalid. |
| 231 base::WeakPtrFactory<GpuChannel> weak_factory_; | 245 base::WeakPtrFactory<GpuChannel> weak_factory_; |
| 232 | 246 |
| 233 DISALLOW_COPY_AND_ASSIGN(GpuChannel); | 247 DISALLOW_COPY_AND_ASSIGN(GpuChannel); |
| 234 }; | 248 }; |
| 235 | 249 |
| 236 } // namespace content | 250 } // namespace content |
| 237 | 251 |
| 238 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_H_ | 252 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_H_ |
| OLD | NEW |