Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Side by Side Diff: content/common/gpu/gpu_channel_manager.h

Issue 1716813002: Use GpuPreferences to avoid directly accessing switches in gpu related code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 18 matching lines...) Expand all
29 29
30 namespace base { 30 namespace base {
31 class WaitableEvent; 31 class WaitableEvent;
32 } 32 }
33 33
34 namespace gfx { 34 namespace gfx {
35 class GLShareGroup; 35 class GLShareGroup;
36 } 36 }
37 37
38 namespace gpu { 38 namespace gpu {
39 struct GpuPreferences;
39 class PreemptionFlag; 40 class PreemptionFlag;
40 class SyncPointClient; 41 class SyncPointClient;
41 class SyncPointManager; 42 class SyncPointManager;
42 struct SyncToken; 43 struct SyncToken;
43 union ValueState; 44 union ValueState;
44 namespace gles2 { 45 namespace gles2 {
45 class FramebufferCompletenessCache; 46 class FramebufferCompletenessCache;
46 class MailboxManager; 47 class MailboxManager;
47 class ProgramCache; 48 class ProgramCache;
48 class ShaderTranslatorCache; 49 class ShaderTranslatorCache;
(...skipping 13 matching lines...) Expand all
62 struct EstablishChannelParams; 63 struct EstablishChannelParams;
63 #if defined(OS_MACOSX) 64 #if defined(OS_MACOSX)
64 struct BufferPresentedParams; 65 struct BufferPresentedParams;
65 #endif 66 #endif
66 67
67 // A GpuChannelManager is a thread responsible for issuing rendering commands 68 // A GpuChannelManager is a thread responsible for issuing rendering commands
68 // 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
69 // browser process to them based on the corresponding renderer ID. 70 // browser process to them based on the corresponding renderer ID.
70 class CONTENT_EXPORT GpuChannelManager { 71 class CONTENT_EXPORT GpuChannelManager {
71 public: 72 public:
72 GpuChannelManager(GpuChannelManagerDelegate* delegate, 73 GpuChannelManager(const gpu::GpuPreferences& gpu_preferences,
74 GpuChannelManagerDelegate* delegate,
73 GpuWatchdog* watchdog, 75 GpuWatchdog* watchdog,
74 base::SingleThreadTaskRunner* task_runner, 76 base::SingleThreadTaskRunner* task_runner,
75 base::SingleThreadTaskRunner* io_task_runner, 77 base::SingleThreadTaskRunner* io_task_runner,
76 base::WaitableEvent* shutdown_event, 78 base::WaitableEvent* shutdown_event,
77 gpu::SyncPointManager* sync_point_manager, 79 gpu::SyncPointManager* sync_point_manager,
78 GpuMemoryBufferFactory* gpu_memory_buffer_factory); 80 GpuMemoryBufferFactory* gpu_memory_buffer_factory);
79 virtual ~GpuChannelManager(); 81 virtual ~GpuChannelManager();
80 82
81 GpuChannelManagerDelegate* delegate() const { return delegate_; } 83 GpuChannelManagerDelegate* delegate() const { return delegate_; }
82 84
(...skipping 16 matching lines...) Expand all
99 101
100 void LoseAllContexts(); 102 void LoseAllContexts();
101 103
102 #if defined(OS_MACOSX) 104 #if defined(OS_MACOSX)
103 void AddImageTransportSurface(int32_t routing_id, 105 void AddImageTransportSurface(int32_t routing_id,
104 ImageTransportHelper* image_transport_helper); 106 ImageTransportHelper* image_transport_helper);
105 void RemoveImageTransportSurface(int32_t routing_id); 107 void RemoveImageTransportSurface(int32_t routing_id);
106 void BufferPresented(const BufferPresentedParams& params); 108 void BufferPresented(const BufferPresentedParams& params);
107 #endif 109 #endif
108 110
111 const gpu::GpuPreferences& gpu_preferences() const {
112 return gpu_preferences_;
113 }
109 gpu::gles2::ProgramCache* program_cache(); 114 gpu::gles2::ProgramCache* program_cache();
110 gpu::gles2::ShaderTranslatorCache* shader_translator_cache(); 115 gpu::gles2::ShaderTranslatorCache* shader_translator_cache();
111 gpu::gles2::FramebufferCompletenessCache* framebuffer_completeness_cache(); 116 gpu::gles2::FramebufferCompletenessCache* framebuffer_completeness_cache();
112 117
113 GpuMemoryManager* gpu_memory_manager() { return &gpu_memory_manager_; } 118 GpuMemoryManager* gpu_memory_manager() { return &gpu_memory_manager_; }
114 119
115 GpuChannel* LookupChannel(int32_t client_id) const; 120 GpuChannel* LookupChannel(int32_t client_id) const;
116 121
117 gfx::GLSurface* GetDefaultOffscreenSurface(); 122 gfx::GLSurface* GetDefaultOffscreenSurface();
118 123
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 167
163 private: 168 private:
164 void InternalDestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, int client_id); 169 void InternalDestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, int client_id);
165 void InternalDestroyGpuMemoryBufferOnIO(gfx::GpuMemoryBufferId id, 170 void InternalDestroyGpuMemoryBufferOnIO(gfx::GpuMemoryBufferId id,
166 int client_id); 171 int client_id);
167 #if defined(OS_ANDROID) 172 #if defined(OS_ANDROID)
168 void ScheduleWakeUpGpu(); 173 void ScheduleWakeUpGpu();
169 void DoWakeUpGpu(); 174 void DoWakeUpGpu();
170 #endif 175 #endif
171 176
177 const gpu::GpuPreferences& gpu_preferences_;
178
172 GpuChannelManagerDelegate* const delegate_; 179 GpuChannelManagerDelegate* const delegate_;
173 #if defined(OS_MACOSX) 180 #if defined(OS_MACOSX)
174 IDMap<ImageTransportHelper> image_transport_map_; 181 IDMap<ImageTransportHelper> image_transport_map_;
175 #endif 182 #endif
176 183
177 GpuWatchdog* watchdog_; 184 GpuWatchdog* watchdog_;
178 185
179 base::WaitableEvent* shutdown_event_; 186 base::WaitableEvent* shutdown_event_;
180 187
181 scoped_refptr<gfx::GLShareGroup> share_group_; 188 scoped_refptr<gfx::GLShareGroup> share_group_;
(...skipping 20 matching lines...) Expand all
202 // that any WeakPtrs to Controller are invalidated before its members 209 // that any WeakPtrs to Controller are invalidated before its members
203 // variable's destructors are executed, rendering them invalid. 210 // variable's destructors are executed, rendering them invalid.
204 base::WeakPtrFactory<GpuChannelManager> weak_factory_; 211 base::WeakPtrFactory<GpuChannelManager> weak_factory_;
205 212
206 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); 213 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager);
207 }; 214 };
208 215
209 } // namespace content 216 } // namespace content
210 217
211 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ 218 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_
OLDNEW
« no previous file with comments | « content/browser/android/synchronous_compositor_base.cc ('k') | content/common/gpu/gpu_channel_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698