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