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