| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 namespace IPC { | 49 namespace IPC { |
| 50 struct ChannelHandle; | 50 struct ChannelHandle; |
| 51 class SyncChannel; | 51 class SyncChannel; |
| 52 } | 52 } |
| 53 | 53 |
| 54 struct GPUCreateCommandBufferConfig; | 54 struct GPUCreateCommandBufferConfig; |
| 55 struct GpuMsg_EstablishChannel_Params; | 55 struct GpuMsg_EstablishChannel_Params; |
| 56 | 56 |
| 57 namespace content { | 57 namespace content { |
| 58 class GpuArcVideoService; |
| 58 class GpuChannel; | 59 class GpuChannel; |
| 59 class GpuMemoryBufferFactory; | 60 class GpuMemoryBufferFactory; |
| 60 class GpuWatchdog; | 61 class GpuWatchdog; |
| 61 | 62 |
| 62 // A GpuChannelManager is a thread responsible for issuing rendering commands | 63 // A GpuChannelManager is a thread responsible for issuing rendering commands |
| 63 // managing the lifetimes of GPU channels and forwarding IPC requests from the | 64 // managing the lifetimes of GPU channels and forwarding IPC requests from the |
| 64 // browser process to them based on the corresponding renderer ID. | 65 // browser process to them based on the corresponding renderer ID. |
| 65 class CONTENT_EXPORT GpuChannelManager : public IPC::Listener, | 66 class CONTENT_EXPORT GpuChannelManager : public IPC::Listener, |
| 66 public IPC::Sender { | 67 public IPC::Sender { |
| 67 public: | 68 public: |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 const gfx::GLSurfaceHandle& window, | 153 const gfx::GLSurfaceHandle& window, |
| 153 int32 client_id, | 154 int32 client_id, |
| 154 const GPUCreateCommandBufferConfig& init_params, | 155 const GPUCreateCommandBufferConfig& init_params, |
| 155 int32 route_id); | 156 int32 route_id); |
| 156 void OnLoadedShader(const std::string& shader); | 157 void OnLoadedShader(const std::string& shader); |
| 157 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, int client_id); | 158 void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, int client_id); |
| 158 void DestroyGpuMemoryBufferOnIO(gfx::GpuMemoryBufferId id, int client_id); | 159 void DestroyGpuMemoryBufferOnIO(gfx::GpuMemoryBufferId id, int client_id); |
| 159 void OnDestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, | 160 void OnDestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, |
| 160 int client_id, | 161 int client_id, |
| 161 const gpu::SyncToken& sync_token); | 162 const gpu::SyncToken& sync_token); |
| 163 void OnCreateArcVideoAcceleratorChannel(); |
| 164 void OnShutdownArcVideoService(); |
| 162 | 165 |
| 163 void OnUpdateValueState(int client_id, | 166 void OnUpdateValueState(int client_id, |
| 164 unsigned int target, | 167 unsigned int target, |
| 165 const gpu::ValueState& state); | 168 const gpu::ValueState& state); |
| 166 #if defined(OS_ANDROID) | 169 #if defined(OS_ANDROID) |
| 167 void OnWakeUpGpu(); | 170 void OnWakeUpGpu(); |
| 168 void ScheduleWakeUpGpu(); | 171 void ScheduleWakeUpGpu(); |
| 169 void DoWakeUpGpu(); | 172 void DoWakeUpGpu(); |
| 170 #endif | 173 #endif |
| 171 void OnLoseAllContexts(); | 174 void OnLoseAllContexts(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 183 scoped_refptr<gpu::PreemptionFlag> preemption_flag_; | 186 scoped_refptr<gpu::PreemptionFlag> preemption_flag_; |
| 184 GpuMemoryManager gpu_memory_manager_; | 187 GpuMemoryManager gpu_memory_manager_; |
| 185 // SyncPointManager guaranteed to outlive running MessageLoop. | 188 // SyncPointManager guaranteed to outlive running MessageLoop. |
| 186 gpu::SyncPointManager* sync_point_manager_; | 189 gpu::SyncPointManager* sync_point_manager_; |
| 187 scoped_ptr<gpu::SyncPointClientWaiter> sync_point_client_waiter_; | 190 scoped_ptr<gpu::SyncPointClientWaiter> sync_point_client_waiter_; |
| 188 scoped_ptr<gpu::gles2::ProgramCache> program_cache_; | 191 scoped_ptr<gpu::gles2::ProgramCache> program_cache_; |
| 189 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; | 192 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; |
| 190 scoped_refptr<gpu::gles2::FramebufferCompletenessCache> | 193 scoped_refptr<gpu::gles2::FramebufferCompletenessCache> |
| 191 framebuffer_completeness_cache_; | 194 framebuffer_completeness_cache_; |
| 192 scoped_refptr<gfx::GLSurface> default_offscreen_surface_; | 195 scoped_refptr<gfx::GLSurface> default_offscreen_surface_; |
| 196 scoped_ptr<GpuArcVideoService> arc_video_service_; |
| 193 GpuMemoryBufferFactory* const gpu_memory_buffer_factory_; | 197 GpuMemoryBufferFactory* const gpu_memory_buffer_factory_; |
| 194 #if defined(OS_ANDROID) | 198 #if defined(OS_ANDROID) |
| 195 // Last time we know the GPU was powered on. Global for tracking across all | 199 // Last time we know the GPU was powered on. Global for tracking across all |
| 196 // transport surfaces. | 200 // transport surfaces. |
| 197 base::TimeTicks last_gpu_access_time_; | 201 base::TimeTicks last_gpu_access_time_; |
| 198 base::TimeTicks begin_wake_up_time_; | 202 base::TimeTicks begin_wake_up_time_; |
| 199 #endif | 203 #endif |
| 200 | 204 |
| 201 // Member variables should appear before the WeakPtrFactory, to ensure | 205 // Member variables should appear before the WeakPtrFactory, to ensure |
| 202 // that any WeakPtrs to Controller are invalidated before its members | 206 // that any WeakPtrs to Controller are invalidated before its members |
| 203 // variable's destructors are executed, rendering them invalid. | 207 // variable's destructors are executed, rendering them invalid. |
| 204 base::WeakPtrFactory<GpuChannelManager> weak_factory_; | 208 base::WeakPtrFactory<GpuChannelManager> weak_factory_; |
| 205 | 209 |
| 206 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); | 210 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); |
| 207 }; | 211 }; |
| 208 | 212 |
| 209 } // namespace content | 213 } // namespace content |
| 210 | 214 |
| 211 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ | 215 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ |
| OLD | NEW |