| 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 GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_H_ | 5 #ifndef GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_H_ |
| 6 #define GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_H_ | 6 #define GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 const ValueState& state); | 100 const ValueState& state); |
| 101 #if defined(OS_ANDROID) | 101 #if defined(OS_ANDROID) |
| 102 void WakeUpGpu(); | 102 void WakeUpGpu(); |
| 103 #endif | 103 #endif |
| 104 void DestroyAllChannels(); | 104 void DestroyAllChannels(); |
| 105 | 105 |
| 106 // Remove the channel for a particular renderer. | 106 // Remove the channel for a particular renderer. |
| 107 void RemoveChannel(int client_id); | 107 void RemoveChannel(int client_id); |
| 108 | 108 |
| 109 void LoseAllContexts(); | 109 void LoseAllContexts(); |
| 110 void MaybeExitOnContextLost(); |
| 110 | 111 |
| 111 #if defined(OS_MACOSX) | 112 #if defined(OS_MACOSX) |
| 112 void AddBufferPresentedCallback(int32_t routing_id, | 113 void AddBufferPresentedCallback(int32_t routing_id, |
| 113 const BufferPresentedCallback& callback); | 114 const BufferPresentedCallback& callback); |
| 114 void RemoveBufferPresentedCallback(int32_t routing_id); | 115 void RemoveBufferPresentedCallback(int32_t routing_id); |
| 115 void BufferPresented(int32_t surface_id, | 116 void BufferPresented(int32_t surface_id, |
| 116 const base::TimeTicks& vsync_timebase, | 117 const base::TimeTicks& vsync_timebase, |
| 117 const base::TimeDelta& vsync_interval); | 118 const base::TimeDelta& vsync_interval); |
| 118 #endif | 119 #endif |
| 119 | 120 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 139 uint32_t GetUnprocessedOrderNum() const; | 140 uint32_t GetUnprocessedOrderNum() const; |
| 140 | 141 |
| 141 // Returns the maximum order number for processed IPC messages across all | 142 // Returns the maximum order number for processed IPC messages across all |
| 142 // channels. | 143 // channels. |
| 143 uint32_t GetProcessedOrderNum() const; | 144 uint32_t GetProcessedOrderNum() const; |
| 144 | 145 |
| 145 #if defined(OS_ANDROID) | 146 #if defined(OS_ANDROID) |
| 146 void DidAccessGpu(); | 147 void DidAccessGpu(); |
| 147 #endif | 148 #endif |
| 148 | 149 |
| 150 bool is_exiting_for_lost_context() { |
| 151 return exiting_for_lost_context_; |
| 152 } |
| 153 |
| 149 protected: | 154 protected: |
| 150 virtual scoped_ptr<GpuChannel> CreateGpuChannel( | 155 virtual scoped_ptr<GpuChannel> CreateGpuChannel( |
| 151 int client_id, | 156 int client_id, |
| 152 uint64_t client_tracing_id, | 157 uint64_t client_tracing_id, |
| 153 bool preempts, | 158 bool preempts, |
| 154 bool allow_view_command_buffers, | 159 bool allow_view_command_buffers, |
| 155 bool allow_real_time_streams); | 160 bool allow_real_time_streams); |
| 156 | 161 |
| 157 SyncPointManager* sync_point_manager() const { | 162 SyncPointManager* sync_point_manager() const { |
| 158 return sync_point_manager_; | 163 return sync_point_manager_; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 framebuffer_completeness_cache_; | 213 framebuffer_completeness_cache_; |
| 209 scoped_refptr<gfx::GLSurface> default_offscreen_surface_; | 214 scoped_refptr<gfx::GLSurface> default_offscreen_surface_; |
| 210 GpuMemoryBufferFactory* const gpu_memory_buffer_factory_; | 215 GpuMemoryBufferFactory* const gpu_memory_buffer_factory_; |
| 211 #if defined(OS_ANDROID) | 216 #if defined(OS_ANDROID) |
| 212 // Last time we know the GPU was powered on. Global for tracking across all | 217 // Last time we know the GPU was powered on. Global for tracking across all |
| 213 // transport surfaces. | 218 // transport surfaces. |
| 214 base::TimeTicks last_gpu_access_time_; | 219 base::TimeTicks last_gpu_access_time_; |
| 215 base::TimeTicks begin_wake_up_time_; | 220 base::TimeTicks begin_wake_up_time_; |
| 216 #endif | 221 #endif |
| 217 | 222 |
| 223 // Set during intentional GPU process shutdown. |
| 224 bool exiting_for_lost_context_; |
| 225 |
| 218 // Member variables should appear before the WeakPtrFactory, to ensure | 226 // Member variables should appear before the WeakPtrFactory, to ensure |
| 219 // that any WeakPtrs to Controller are invalidated before its members | 227 // that any WeakPtrs to Controller are invalidated before its members |
| 220 // variable's destructors are executed, rendering them invalid. | 228 // variable's destructors are executed, rendering them invalid. |
| 221 base::WeakPtrFactory<GpuChannelManager> weak_factory_; | 229 base::WeakPtrFactory<GpuChannelManager> weak_factory_; |
| 222 | 230 |
| 223 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); | 231 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); |
| 224 }; | 232 }; |
| 225 | 233 |
| 226 } // namespace gpu | 234 } // namespace gpu |
| 227 | 235 |
| 228 #endif // GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_H_ | 236 #endif // GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_H_ |
| OLD | NEW |