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