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

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

Issue 1871613002: Compute GpuDriverBugWorkarounds only one time in the GPU process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 22 matching lines...) Expand all
33 namespace base { 33 namespace base {
34 class WaitableEvent; 34 class WaitableEvent;
35 } 35 }
36 36
37 namespace gfx { 37 namespace gfx {
38 class GLShareGroup; 38 class GLShareGroup;
39 } 39 }
40 40
41 namespace gpu { 41 namespace gpu {
42 struct GpuPreferences; 42 struct GpuPreferences;
43 class GpuDriverBugWorkarounds;
43 class PreemptionFlag; 44 class PreemptionFlag;
44 class SyncPointClient; 45 class SyncPointClient;
45 class SyncPointManager; 46 class SyncPointManager;
46 struct SyncToken; 47 struct SyncToken;
47 union ValueState; 48 union ValueState;
48 namespace gles2 { 49 namespace gles2 {
49 class FramebufferCompletenessCache; 50 class FramebufferCompletenessCache;
50 class MailboxManager; 51 class MailboxManager;
51 class ProgramCache; 52 class ProgramCache;
52 class ShaderTranslatorCache; 53 class ShaderTranslatorCache;
(...skipping 13 matching lines...) Expand all
66 // A GpuChannelManager is a thread responsible for issuing rendering commands 67 // A GpuChannelManager is a thread responsible for issuing rendering commands
67 // managing the lifetimes of GPU channels and forwarding IPC requests from the 68 // managing the lifetimes of GPU channels and forwarding IPC requests from the
68 // browser process to them based on the corresponding renderer ID. 69 // browser process to them based on the corresponding renderer ID.
69 class CONTENT_EXPORT GpuChannelManager { 70 class CONTENT_EXPORT GpuChannelManager {
70 public: 71 public:
71 #if defined(OS_MACOSX) 72 #if defined(OS_MACOSX)
72 typedef base::Callback< 73 typedef base::Callback<
73 void(int32_t, const base::TimeTicks&, const base::TimeDelta&)> 74 void(int32_t, const base::TimeTicks&, const base::TimeDelta&)>
74 BufferPresentedCallback; 75 BufferPresentedCallback;
75 #endif 76 #endif
76 GpuChannelManager(const gpu::GpuPreferences& gpu_preferences, 77 GpuChannelManager(
77 GpuChannelManagerDelegate* delegate, 78 const gpu::GpuPreferences& gpu_preferences,
78 GpuWatchdog* watchdog, 79 const gpu::GpuDriverBugWorkarounds& gpu_driver_bug_workarounds,
79 base::SingleThreadTaskRunner* task_runner, 80 GpuChannelManagerDelegate* delegate,
80 base::SingleThreadTaskRunner* io_task_runner, 81 GpuWatchdog* watchdog,
81 base::WaitableEvent* shutdown_event, 82 base::SingleThreadTaskRunner* task_runner,
82 gpu::SyncPointManager* sync_point_manager, 83 base::SingleThreadTaskRunner* io_task_runner,
83 GpuMemoryBufferFactory* gpu_memory_buffer_factory); 84 base::WaitableEvent* shutdown_event,
85 gpu::SyncPointManager* sync_point_manager,
86 GpuMemoryBufferFactory* gpu_memory_buffer_factory);
84 virtual ~GpuChannelManager(); 87 virtual ~GpuChannelManager();
85 88
86 GpuChannelManagerDelegate* delegate() const { return delegate_; } 89 GpuChannelManagerDelegate* delegate() const { return delegate_; }
87 90
88 IPC::ChannelHandle EstablishChannel(int client_id, 91 IPC::ChannelHandle EstablishChannel(int client_id,
89 uint64_t client_tracing_id, 92 uint64_t client_tracing_id,
90 bool preempts, 93 bool preempts,
91 bool allow_view_command_buffers, 94 bool allow_view_command_buffers,
92 bool allow_real_time_streams); 95 bool allow_real_time_streams);
93 96
(...skipping 19 matching lines...) Expand all
113 const BufferPresentedCallback& callback); 116 const BufferPresentedCallback& callback);
114 void RemoveBufferPresentedCallback(int32_t routing_id); 117 void RemoveBufferPresentedCallback(int32_t routing_id);
115 void BufferPresented(int32_t surface_id, 118 void BufferPresented(int32_t surface_id,
116 const base::TimeTicks& vsync_timebase, 119 const base::TimeTicks& vsync_timebase,
117 const base::TimeDelta& vsync_interval); 120 const base::TimeDelta& vsync_interval);
118 #endif 121 #endif
119 122
120 const gpu::GpuPreferences& gpu_preferences() const { 123 const gpu::GpuPreferences& gpu_preferences() const {
121 return gpu_preferences_; 124 return gpu_preferences_;
122 } 125 }
126 const gpu::GpuDriverBugWorkarounds& gpu_driver_bug_workarounds() const {
127 return gpu_driver_bug_workarounds_;
128 }
123 gpu::gles2::ProgramCache* program_cache(); 129 gpu::gles2::ProgramCache* program_cache();
124 gpu::gles2::ShaderTranslatorCache* shader_translator_cache(); 130 gpu::gles2::ShaderTranslatorCache* shader_translator_cache();
125 gpu::gles2::FramebufferCompletenessCache* framebuffer_completeness_cache(); 131 gpu::gles2::FramebufferCompletenessCache* framebuffer_completeness_cache();
126 132
127 GpuMemoryManager* gpu_memory_manager() { return &gpu_memory_manager_; } 133 GpuMemoryManager* gpu_memory_manager() { return &gpu_memory_manager_; }
128 134
129 GpuChannel* LookupChannel(int32_t client_id) const; 135 GpuChannel* LookupChannel(int32_t client_id) const;
130 136
131 gfx::GLSurface* GetDefaultOffscreenSurface(); 137 gfx::GLSurface* GetDefaultOffscreenSurface();
132 138
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 void InternalDestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, int client_id); 184 void InternalDestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, int client_id);
179 void InternalDestroyGpuMemoryBufferOnIO(gfx::GpuMemoryBufferId id, 185 void InternalDestroyGpuMemoryBufferOnIO(gfx::GpuMemoryBufferId id,
180 int client_id); 186 int client_id);
181 #if defined(OS_ANDROID) 187 #if defined(OS_ANDROID)
182 void ScheduleWakeUpGpu(); 188 void ScheduleWakeUpGpu();
183 void DoWakeUpGpu(); 189 void DoWakeUpGpu();
184 #endif 190 #endif
185 191
186 const gpu::GpuPreferences& gpu_preferences_; 192 const gpu::GpuPreferences& gpu_preferences_;
187 193
194 const gpu::GpuDriverBugWorkarounds& gpu_driver_bug_workarounds_;
195
188 GpuChannelManagerDelegate* const delegate_; 196 GpuChannelManagerDelegate* const delegate_;
189 #if defined(OS_MACOSX) 197 #if defined(OS_MACOSX)
190 base::hash_map<int32_t, BufferPresentedCallback> 198 base::hash_map<int32_t, BufferPresentedCallback>
191 buffer_presented_callback_map_; 199 buffer_presented_callback_map_;
192 #endif 200 #endif
193 201
194 GpuWatchdog* watchdog_; 202 GpuWatchdog* watchdog_;
195 203
196 base::WaitableEvent* shutdown_event_; 204 base::WaitableEvent* shutdown_event_;
197 205
(...skipping 21 matching lines...) Expand all
219 // that any WeakPtrs to Controller are invalidated before its members 227 // that any WeakPtrs to Controller are invalidated before its members
220 // variable's destructors are executed, rendering them invalid. 228 // variable's destructors are executed, rendering them invalid.
221 base::WeakPtrFactory<GpuChannelManager> weak_factory_; 229 base::WeakPtrFactory<GpuChannelManager> weak_factory_;
222 230
223 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); 231 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager);
224 }; 232 };
225 233
226 } // namespace content 234 } // namespace content
227 235
228 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ 236 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698