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> |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 #include <unordered_map> | 13 #include <unordered_map> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
19 #include "base/single_thread_task_runner.h" | 19 #include "base/single_thread_task_runner.h" |
20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
21 #include "gpu/command_buffer/common/activity_flags.h" | 21 #include "gpu/command_buffer/common/activity_flags.h" |
22 #include "gpu/command_buffer/common/constants.h" | 22 #include "gpu/command_buffer/common/constants.h" |
23 #include "gpu/command_buffer/service/gpu_preferences.h" | 23 #include "gpu/command_buffer/service/gpu_preferences.h" |
| 24 #include "gpu/command_buffer/service/service_discardable_manager.h" |
24 #include "gpu/config/gpu_driver_bug_workarounds.h" | 25 #include "gpu/config/gpu_driver_bug_workarounds.h" |
25 #include "gpu/config/gpu_feature_info.h" | 26 #include "gpu/config/gpu_feature_info.h" |
26 #include "gpu/gpu_export.h" | 27 #include "gpu/gpu_export.h" |
27 #include "gpu/ipc/service/gpu_memory_manager.h" | 28 #include "gpu/ipc/service/gpu_memory_manager.h" |
28 #include "ui/gfx/gpu_memory_buffer.h" | 29 #include "ui/gfx/gpu_memory_buffer.h" |
29 #include "ui/gfx/native_widget_types.h" | 30 #include "ui/gfx/native_widget_types.h" |
30 #include "ui/gl/gl_surface.h" | 31 #include "ui/gl/gl_surface.h" |
31 #include "url/gurl.h" | 32 #include "url/gurl.h" |
32 | 33 |
33 namespace gl { | 34 namespace gl { |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 Scheduler* scheduler_; | 161 Scheduler* scheduler_; |
161 // SyncPointManager guaranteed to outlive running MessageLoop. | 162 // SyncPointManager guaranteed to outlive running MessageLoop. |
162 SyncPointManager* sync_point_manager_; | 163 SyncPointManager* sync_point_manager_; |
163 std::unique_ptr<gles2::ProgramCache> program_cache_; | 164 std::unique_ptr<gles2::ProgramCache> program_cache_; |
164 scoped_refptr<gles2::ShaderTranslatorCache> shader_translator_cache_; | 165 scoped_refptr<gles2::ShaderTranslatorCache> shader_translator_cache_; |
165 scoped_refptr<gles2::FramebufferCompletenessCache> | 166 scoped_refptr<gles2::FramebufferCompletenessCache> |
166 framebuffer_completeness_cache_; | 167 framebuffer_completeness_cache_; |
167 scoped_refptr<gl::GLSurface> default_offscreen_surface_; | 168 scoped_refptr<gl::GLSurface> default_offscreen_surface_; |
168 GpuMemoryBufferFactory* const gpu_memory_buffer_factory_; | 169 GpuMemoryBufferFactory* const gpu_memory_buffer_factory_; |
169 GpuFeatureInfo gpu_feature_info_; | 170 GpuFeatureInfo gpu_feature_info_; |
| 171 ServiceDiscardableManager discardable_manager_; |
170 #if defined(OS_ANDROID) | 172 #if defined(OS_ANDROID) |
171 // Last time we know the GPU was powered on. Global for tracking across all | 173 // Last time we know the GPU was powered on. Global for tracking across all |
172 // transport surfaces. | 174 // transport surfaces. |
173 base::TimeTicks last_gpu_access_time_; | 175 base::TimeTicks last_gpu_access_time_; |
174 base::TimeTicks begin_wake_up_time_; | 176 base::TimeTicks begin_wake_up_time_; |
175 #endif | 177 #endif |
176 | 178 |
177 // Set during intentional GPU process shutdown. | 179 // Set during intentional GPU process shutdown. |
178 bool exiting_for_lost_context_; | 180 bool exiting_for_lost_context_; |
179 | 181 |
180 // Flags which indicate GPU process activity. Read by the browser process | 182 // Flags which indicate GPU process activity. Read by the browser process |
181 // on GPU process crash. | 183 // on GPU process crash. |
182 GpuProcessActivityFlags activity_flags_; | 184 GpuProcessActivityFlags activity_flags_; |
183 | 185 |
184 // Member variables should appear before the WeakPtrFactory, to ensure | 186 // Member variables should appear before the WeakPtrFactory, to ensure |
185 // that any WeakPtrs to Controller are invalidated before its members | 187 // that any WeakPtrs to Controller are invalidated before its members |
186 // variable's destructors are executed, rendering them invalid. | 188 // variable's destructors are executed, rendering them invalid. |
187 base::WeakPtrFactory<GpuChannelManager> weak_factory_; | 189 base::WeakPtrFactory<GpuChannelManager> weak_factory_; |
188 | 190 |
189 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); | 191 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); |
190 }; | 192 }; |
191 | 193 |
192 } // namespace gpu | 194 } // namespace gpu |
193 | 195 |
194 #endif // GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_H_ | 196 #endif // GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_H_ |
OLD | NEW |