| 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_MANAGER_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ |
| 6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ | 6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 namespace base { | 27 namespace base { |
| 28 class WaitableEvent; | 28 class WaitableEvent; |
| 29 } | 29 } |
| 30 | 30 |
| 31 namespace gfx { | 31 namespace gfx { |
| 32 class GLShareGroup; | 32 class GLShareGroup; |
| 33 } | 33 } |
| 34 | 34 |
| 35 namespace gpu { | 35 namespace gpu { |
| 36 class PreemptionFlag; | 36 class PreemptionFlag; |
| 37 class SyncPointClientWaiter; |
| 37 class SyncPointManager; | 38 class SyncPointManager; |
| 39 struct SyncToken; |
| 38 union ValueState; | 40 union ValueState; |
| 39 namespace gles2 { | 41 namespace gles2 { |
| 40 class FramebufferCompletenessCache; | 42 class FramebufferCompletenessCache; |
| 41 class MailboxManager; | 43 class MailboxManager; |
| 42 class ProgramCache; | 44 class ProgramCache; |
| 43 class ShaderTranslatorCache; | 45 class ShaderTranslatorCache; |
| 44 } | 46 } |
| 45 } | 47 } |
| 46 | 48 |
| 47 namespace IPC { | 49 namespace IPC { |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 void OnCreateViewCommandBuffer( | 151 void OnCreateViewCommandBuffer( |
| 150 const gfx::GLSurfaceHandle& window, | 152 const gfx::GLSurfaceHandle& window, |
| 151 int32 client_id, | 153 int32 client_id, |
| 152 const GPUCreateCommandBufferConfig& init_params, | 154 const GPUCreateCommandBufferConfig& init_params, |
| 153 int32 route_id); | 155 int32 route_id); |
| 154 void OnLoadedShader(const std::string& shader); | 156 void OnLoadedShader(const std::string& shader); |
| 155 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, int client_id); | 157 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, int client_id); |
| 156 void DestroyGpuMemoryBufferOnIO(gfx::GpuMemoryBufferId id, int client_id); | 158 void DestroyGpuMemoryBufferOnIO(gfx::GpuMemoryBufferId id, int client_id); |
| 157 void OnDestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, | 159 void OnDestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, |
| 158 int client_id, | 160 int client_id, |
| 159 int32 sync_point); | 161 const gpu::SyncToken& sync_token); |
| 160 | 162 |
| 161 void OnUpdateValueState(int client_id, | 163 void OnUpdateValueState(int client_id, |
| 162 unsigned int target, | 164 unsigned int target, |
| 163 const gpu::ValueState& state); | 165 const gpu::ValueState& state); |
| 164 #if defined(OS_ANDROID) | 166 #if defined(OS_ANDROID) |
| 165 void OnWakeUpGpu(); | 167 void OnWakeUpGpu(); |
| 166 void ScheduleWakeUpGpu(); | 168 void ScheduleWakeUpGpu(); |
| 167 void DoWakeUpGpu(); | 169 void DoWakeUpGpu(); |
| 168 #endif | 170 #endif |
| 169 void OnLoseAllContexts(); | 171 void OnLoseAllContexts(); |
| 170 | 172 |
| 171 // Used to send and receive IPC messages from the browser process. | 173 // Used to send and receive IPC messages from the browser process. |
| 172 IPC::SyncChannel* const channel_; | 174 IPC::SyncChannel* const channel_; |
| 173 MessageRouter router_; | 175 MessageRouter router_; |
| 174 | 176 |
| 175 GpuWatchdog* watchdog_; | 177 GpuWatchdog* watchdog_; |
| 176 | 178 |
| 177 base::WaitableEvent* shutdown_event_; | 179 base::WaitableEvent* shutdown_event_; |
| 178 | 180 |
| 179 scoped_refptr<gfx::GLShareGroup> share_group_; | 181 scoped_refptr<gfx::GLShareGroup> share_group_; |
| 180 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; | 182 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; |
| 181 scoped_refptr<gpu::PreemptionFlag> preemption_flag_; | 183 scoped_refptr<gpu::PreemptionFlag> preemption_flag_; |
| 182 GpuMemoryManager gpu_memory_manager_; | 184 GpuMemoryManager gpu_memory_manager_; |
| 183 // SyncPointManager guaranteed to outlive running MessageLoop. | 185 // SyncPointManager guaranteed to outlive running MessageLoop. |
| 184 gpu::SyncPointManager* sync_point_manager_; | 186 gpu::SyncPointManager* sync_point_manager_; |
| 187 scoped_ptr<gpu::SyncPointClientWaiter> sync_point_client_waiter_; |
| 185 scoped_ptr<gpu::gles2::ProgramCache> program_cache_; | 188 scoped_ptr<gpu::gles2::ProgramCache> program_cache_; |
| 186 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; | 189 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; |
| 187 scoped_refptr<gpu::gles2::FramebufferCompletenessCache> | 190 scoped_refptr<gpu::gles2::FramebufferCompletenessCache> |
| 188 framebuffer_completeness_cache_; | 191 framebuffer_completeness_cache_; |
| 189 scoped_refptr<gfx::GLSurface> default_offscreen_surface_; | 192 scoped_refptr<gfx::GLSurface> default_offscreen_surface_; |
| 190 GpuMemoryBufferFactory* const gpu_memory_buffer_factory_; | 193 GpuMemoryBufferFactory* const gpu_memory_buffer_factory_; |
| 191 #if defined(OS_ANDROID) | 194 #if defined(OS_ANDROID) |
| 192 // Last time we know the GPU was powered on. Global for tracking across all | 195 // Last time we know the GPU was powered on. Global for tracking across all |
| 193 // transport surfaces. | 196 // transport surfaces. |
| 194 base::TimeTicks last_gpu_access_time_; | 197 base::TimeTicks last_gpu_access_time_; |
| 195 base::TimeTicks begin_wake_up_time_; | 198 base::TimeTicks begin_wake_up_time_; |
| 196 #endif | 199 #endif |
| 197 | 200 |
| 198 // Member variables should appear before the WeakPtrFactory, to ensure | 201 // Member variables should appear before the WeakPtrFactory, to ensure |
| 199 // that any WeakPtrs to Controller are invalidated before its members | 202 // that any WeakPtrs to Controller are invalidated before its members |
| 200 // variable's destructors are executed, rendering them invalid. | 203 // variable's destructors are executed, rendering them invalid. |
| 201 base::WeakPtrFactory<GpuChannelManager> weak_factory_; | 204 base::WeakPtrFactory<GpuChannelManager> weak_factory_; |
| 202 | 205 |
| 203 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); | 206 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); |
| 204 }; | 207 }; |
| 205 | 208 |
| 206 } // namespace content | 209 } // namespace content |
| 207 | 210 |
| 208 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ | 211 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ |
| OLD | NEW |