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 GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_H_ | 5 #ifndef GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_H_ |
6 #define GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_H_ | 6 #define GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <deque> | 10 #include <deque> |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "gpu/ipc/service/gpu_memory_manager.h" | 23 #include "gpu/ipc/service/gpu_memory_manager.h" |
24 #include "ui/gfx/gpu_memory_buffer.h" | 24 #include "ui/gfx/gpu_memory_buffer.h" |
25 #include "ui/gfx/native_widget_types.h" | 25 #include "ui/gfx/native_widget_types.h" |
26 #include "ui/gl/gl_surface.h" | 26 #include "ui/gl/gl_surface.h" |
27 #include "url/gurl.h" | 27 #include "url/gurl.h" |
28 | 28 |
29 namespace base { | 29 namespace base { |
30 class WaitableEvent; | 30 class WaitableEvent; |
31 } | 31 } |
32 | 32 |
33 namespace gfx { | 33 namespace gl { |
34 class GLShareGroup; | 34 class GLShareGroup; |
35 } | 35 } |
36 | 36 |
37 namespace gpu { | 37 namespace gpu { |
38 struct GpuPreferences; | 38 struct GpuPreferences; |
39 class PreemptionFlag; | 39 class PreemptionFlag; |
40 class SyncPointClient; | 40 class SyncPointClient; |
41 class SyncPointManager; | 41 class SyncPointManager; |
42 struct SyncToken; | 42 struct SyncToken; |
43 namespace gles2 { | 43 namespace gles2 { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 return gpu_driver_bug_workarounds_; | 103 return gpu_driver_bug_workarounds_; |
104 } | 104 } |
105 gles2::ProgramCache* program_cache(); | 105 gles2::ProgramCache* program_cache(); |
106 gles2::ShaderTranslatorCache* shader_translator_cache(); | 106 gles2::ShaderTranslatorCache* shader_translator_cache(); |
107 gles2::FramebufferCompletenessCache* framebuffer_completeness_cache(); | 107 gles2::FramebufferCompletenessCache* framebuffer_completeness_cache(); |
108 | 108 |
109 GpuMemoryManager* gpu_memory_manager() { return &gpu_memory_manager_; } | 109 GpuMemoryManager* gpu_memory_manager() { return &gpu_memory_manager_; } |
110 | 110 |
111 GpuChannel* LookupChannel(int32_t client_id) const; | 111 GpuChannel* LookupChannel(int32_t client_id) const; |
112 | 112 |
113 gfx::GLSurface* GetDefaultOffscreenSurface(); | 113 gl::GLSurface* GetDefaultOffscreenSurface(); |
114 | 114 |
115 GpuMemoryBufferFactory* gpu_memory_buffer_factory() { | 115 GpuMemoryBufferFactory* gpu_memory_buffer_factory() { |
116 return gpu_memory_buffer_factory_; | 116 return gpu_memory_buffer_factory_; |
117 } | 117 } |
118 | 118 |
119 // Returns the maximum order number for unprocessed IPC messages across all | 119 // Returns the maximum order number for unprocessed IPC messages across all |
120 // channels. | 120 // channels. |
121 uint32_t GetUnprocessedOrderNum() const; | 121 uint32_t GetUnprocessedOrderNum() const; |
122 | 122 |
123 // Returns the maximum order number for processed IPC messages across all | 123 // Returns the maximum order number for processed IPC messages across all |
(...skipping 13 matching lines...) Expand all Loading... |
137 int client_id, | 137 int client_id, |
138 uint64_t client_tracing_id, | 138 uint64_t client_tracing_id, |
139 bool preempts, | 139 bool preempts, |
140 bool allow_view_command_buffers, | 140 bool allow_view_command_buffers, |
141 bool allow_real_time_streams); | 141 bool allow_real_time_streams); |
142 | 142 |
143 SyncPointManager* sync_point_manager() const { | 143 SyncPointManager* sync_point_manager() const { |
144 return sync_point_manager_; | 144 return sync_point_manager_; |
145 } | 145 } |
146 | 146 |
147 gfx::GLShareGroup* share_group() const { return share_group_.get(); } | 147 gl::GLShareGroup* share_group() const { return share_group_.get(); } |
148 gles2::MailboxManager* mailbox_manager() const { | 148 gles2::MailboxManager* mailbox_manager() const { |
149 return mailbox_manager_.get(); | 149 return mailbox_manager_.get(); |
150 } | 150 } |
151 PreemptionFlag* preemption_flag() const { | 151 PreemptionFlag* preemption_flag() const { |
152 return preemption_flag_.get(); | 152 return preemption_flag_.get(); |
153 } | 153 } |
154 | 154 |
155 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 155 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
156 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 156 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
157 | 157 |
(...skipping 13 matching lines...) Expand all Loading... |
171 | 171 |
172 const GpuPreferences& gpu_preferences_; | 172 const GpuPreferences& gpu_preferences_; |
173 GpuDriverBugWorkarounds gpu_driver_bug_workarounds_; | 173 GpuDriverBugWorkarounds gpu_driver_bug_workarounds_; |
174 | 174 |
175 GpuChannelManagerDelegate* const delegate_; | 175 GpuChannelManagerDelegate* const delegate_; |
176 | 176 |
177 GpuWatchdog* watchdog_; | 177 GpuWatchdog* watchdog_; |
178 | 178 |
179 base::WaitableEvent* shutdown_event_; | 179 base::WaitableEvent* shutdown_event_; |
180 | 180 |
181 scoped_refptr<gfx::GLShareGroup> share_group_; | 181 scoped_refptr<gl::GLShareGroup> share_group_; |
182 scoped_refptr<gles2::MailboxManager> mailbox_manager_; | 182 scoped_refptr<gles2::MailboxManager> mailbox_manager_; |
183 scoped_refptr<PreemptionFlag> preemption_flag_; | 183 scoped_refptr<PreemptionFlag> preemption_flag_; |
184 GpuMemoryManager gpu_memory_manager_; | 184 GpuMemoryManager gpu_memory_manager_; |
185 // SyncPointManager guaranteed to outlive running MessageLoop. | 185 // SyncPointManager guaranteed to outlive running MessageLoop. |
186 SyncPointManager* sync_point_manager_; | 186 SyncPointManager* sync_point_manager_; |
187 std::unique_ptr<SyncPointClient> sync_point_client_waiter_; | 187 std::unique_ptr<SyncPointClient> sync_point_client_waiter_; |
188 std::unique_ptr<gles2::ProgramCache> program_cache_; | 188 std::unique_ptr<gles2::ProgramCache> program_cache_; |
189 scoped_refptr<gles2::ShaderTranslatorCache> shader_translator_cache_; | 189 scoped_refptr<gles2::ShaderTranslatorCache> shader_translator_cache_; |
190 scoped_refptr<gles2::FramebufferCompletenessCache> | 190 scoped_refptr<gles2::FramebufferCompletenessCache> |
191 framebuffer_completeness_cache_; | 191 framebuffer_completeness_cache_; |
192 scoped_refptr<gfx::GLSurface> default_offscreen_surface_; | 192 scoped_refptr<gl::GLSurface> default_offscreen_surface_; |
193 GpuMemoryBufferFactory* const gpu_memory_buffer_factory_; | 193 GpuMemoryBufferFactory* const gpu_memory_buffer_factory_; |
194 #if defined(OS_ANDROID) | 194 #if defined(OS_ANDROID) |
195 // 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 |
196 // transport surfaces. | 196 // transport surfaces. |
197 base::TimeTicks last_gpu_access_time_; | 197 base::TimeTicks last_gpu_access_time_; |
198 base::TimeTicks begin_wake_up_time_; | 198 base::TimeTicks begin_wake_up_time_; |
199 #endif | 199 #endif |
200 | 200 |
201 // Set during intentional GPU process shutdown. | 201 // Set during intentional GPU process shutdown. |
202 bool exiting_for_lost_context_; | 202 bool exiting_for_lost_context_; |
203 | 203 |
204 // Member variables should appear before the WeakPtrFactory, to ensure | 204 // Member variables should appear before the WeakPtrFactory, to ensure |
205 // that any WeakPtrs to Controller are invalidated before its members | 205 // that any WeakPtrs to Controller are invalidated before its members |
206 // variable's destructors are executed, rendering them invalid. | 206 // variable's destructors are executed, rendering them invalid. |
207 base::WeakPtrFactory<GpuChannelManager> weak_factory_; | 207 base::WeakPtrFactory<GpuChannelManager> weak_factory_; |
208 | 208 |
209 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); | 209 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); |
210 }; | 210 }; |
211 | 211 |
212 } // namespace gpu | 212 } // namespace gpu |
213 | 213 |
214 #endif // GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_H_ | 214 #endif // GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_H_ |
OLD | NEW |