Chromium Code Reviews| 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 namespace gles2 { | |
| 39 class ValuebufferManager; | |
| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 138 | 142 |
| 139 void CacheShader(const std::string& key, const std::string& shader); | 143 void CacheShader(const std::string& key, const std::string& shader); |
| 140 | 144 |
| 141 void AddFilter(IPC::MessageFilter* filter); | 145 void AddFilter(IPC::MessageFilter* filter); |
| 142 void RemoveFilter(IPC::MessageFilter* filter); | 146 void RemoveFilter(IPC::MessageFilter* filter); |
| 143 | 147 |
| 144 uint64 GetMemoryUsage(); | 148 uint64 GetMemoryUsage(); |
| 145 | 149 |
| 146 bool allow_future_sync_points() const { return allow_future_sync_points_; } | 150 bool allow_future_sync_points() const { return allow_future_sync_points_; } |
| 147 | 151 |
| 152 void HandleUpdateValueState(unsigned int target, | |
| 153 const gpu::ValueState& state); | |
| 154 | |
| 155 // Visible for testing. | |
| 156 const gpu::gles2::ValuebufferManager* valuebuffer_manager() const { | |
| 157 return valuebuffer_manager_.get(); | |
| 158 } | |
| 159 | |
| 148 private: | 160 private: |
| 149 friend class GpuChannelMessageFilter; | 161 friend class GpuChannelMessageFilter; |
| 150 | 162 |
| 151 void OnDestroy(); | 163 void OnDestroy(); |
| 152 | 164 |
| 153 bool OnControlMessageReceived(const IPC::Message& msg); | 165 bool OnControlMessageReceived(const IPC::Message& msg); |
| 154 | 166 |
| 155 void HandleMessage(); | 167 void HandleMessage(); |
| 156 | 168 |
| 157 // Message handlers. | 169 // Message handlers. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 | 206 |
| 195 // Used to implement message routing functionality to CommandBuffer objects | 207 // Used to implement message routing functionality to CommandBuffer objects |
| 196 MessageRouter router_; | 208 MessageRouter router_; |
| 197 | 209 |
| 198 // The share group that all contexts associated with a particular renderer | 210 // The share group that all contexts associated with a particular renderer |
| 199 // process use. | 211 // process use. |
| 200 scoped_refptr<gfx::GLShareGroup> share_group_; | 212 scoped_refptr<gfx::GLShareGroup> share_group_; |
| 201 | 213 |
| 202 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; | 214 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; |
| 203 | 215 |
| 216 scoped_refptr<gpu::gles2::ValuebufferManager> valuebuffer_manager_; | |
|
piman
2014/11/26 20:47:09
I don't think you can share the whole ValuebufferM
orglofch
2014/12/01 01:54:29
Done.
| |
| 217 | |
| 204 typedef IDMap<GpuCommandBufferStub, IDMapOwnPointer> StubMap; | 218 typedef IDMap<GpuCommandBufferStub, IDMapOwnPointer> StubMap; |
| 205 StubMap stubs_; | 219 StubMap stubs_; |
| 206 | 220 |
| 207 bool log_messages_; // True if we should log sent and received messages. | 221 bool log_messages_; // True if we should log sent and received messages. |
| 208 gpu::gles2::DisallowedFeatures disallowed_features_; | 222 gpu::gles2::DisallowedFeatures disallowed_features_; |
| 209 GpuWatchdog* watchdog_; | 223 GpuWatchdog* watchdog_; |
| 210 bool software_; | 224 bool software_; |
| 211 bool handle_messages_scheduled_; | 225 bool handle_messages_scheduled_; |
| 212 IPC::Message* currently_processing_message_; | 226 IPC::Message* currently_processing_message_; |
| 213 | 227 |
| 214 scoped_refptr<GpuChannelMessageFilter> filter_; | 228 scoped_refptr<GpuChannelMessageFilter> filter_; |
| 215 scoped_refptr<base::MessageLoopProxy> io_message_loop_; | 229 scoped_refptr<base::MessageLoopProxy> io_message_loop_; |
| 216 scoped_ptr<DevToolsGpuAgent> devtools_gpu_agent_; | 230 scoped_ptr<DevToolsGpuAgent> devtools_gpu_agent_; |
| 217 | 231 |
| 218 size_t num_stubs_descheduled_; | 232 size_t num_stubs_descheduled_; |
| 219 | 233 |
| 220 bool allow_future_sync_points_; | 234 bool allow_future_sync_points_; |
| 221 | 235 |
| 222 // Member variables should appear before the WeakPtrFactory, to ensure | 236 // Member variables should appear before the WeakPtrFactory, to ensure |
| 223 // that any WeakPtrs to Controller are invalidated before its members | 237 // that any WeakPtrs to Controller are invalidated before its members |
| 224 // variable's destructors are executed, rendering them invalid. | 238 // variable's destructors are executed, rendering them invalid. |
| 225 base::WeakPtrFactory<GpuChannel> weak_factory_; | 239 base::WeakPtrFactory<GpuChannel> weak_factory_; |
| 226 | 240 |
| 227 DISALLOW_COPY_AND_ASSIGN(GpuChannel); | 241 DISALLOW_COPY_AND_ASSIGN(GpuChannel); |
| 228 }; | 242 }; |
| 229 | 243 |
| 230 } // namespace content | 244 } // namespace content |
| 231 | 245 |
| 232 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_H_ | 246 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_H_ |
| OLD | NEW |