| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_PRIVATE_H_ | 5 #ifndef CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_PRIVATE_H_ |
| 6 #define CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_PRIVATE_H_ | 6 #define CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_PRIVATE_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 bool IsDriverBugWorkaroundActive(int feature) const; | 35 bool IsDriverBugWorkaroundActive(int feature) const; |
| 36 gpu::GPUInfo GetGPUInfo() const; | 36 gpu::GPUInfo GetGPUInfo() const; |
| 37 void GetGpuProcessHandles( | 37 void GetGpuProcessHandles( |
| 38 const GpuDataManager::GetGpuProcessHandlesCallback& callback) const; | 38 const GpuDataManager::GetGpuProcessHandlesCallback& callback) const; |
| 39 bool GpuAccessAllowed(std::string* reason) const; | 39 bool GpuAccessAllowed(std::string* reason) const; |
| 40 void RequestCompleteGpuInfoIfNeeded(); | 40 void RequestCompleteGpuInfoIfNeeded(); |
| 41 bool IsCompleteGpuInfoAvailable() const; | 41 bool IsCompleteGpuInfoAvailable() const; |
| 42 void RequestVideoMemoryUsageStatsUpdate() const; | 42 void RequestVideoMemoryUsageStatsUpdate() const; |
| 43 bool ShouldUseSwiftShader() const; | 43 bool ShouldUseSwiftShader() const; |
| 44 void RegisterSwiftShaderPath(const base::FilePath& path); | 44 void RegisterSwiftShaderPath(const base::FilePath& path); |
| 45 bool ShouldUseWarp() const; |
| 45 void AddObserver(GpuDataManagerObserver* observer); | 46 void AddObserver(GpuDataManagerObserver* observer); |
| 46 void RemoveObserver(GpuDataManagerObserver* observer); | 47 void RemoveObserver(GpuDataManagerObserver* observer); |
| 47 void UnblockDomainFrom3DAPIs(const GURL& url); | 48 void UnblockDomainFrom3DAPIs(const GURL& url); |
| 48 void DisableGpuWatchdog(); | 49 void DisableGpuWatchdog(); |
| 49 void SetGLStrings(const std::string& gl_vendor, | 50 void SetGLStrings(const std::string& gl_vendor, |
| 50 const std::string& gl_renderer, | 51 const std::string& gl_renderer, |
| 51 const std::string& gl_version); | 52 const std::string& gl_version); |
| 52 void GetGLStrings(std::string* gl_vendor, | 53 void GetGLStrings(std::string* gl_vendor, |
| 53 std::string* gl_renderer, | 54 std::string* gl_renderer, |
| 54 std::string* gl_version); | 55 std::string* gl_version); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 // Update the GPU switching status. | 195 // Update the GPU switching status. |
| 195 // This should only be called once at initialization time. | 196 // This should only be called once at initialization time. |
| 196 void UpdateGpuSwitchingManager(const gpu::GPUInfo& gpu_info); | 197 void UpdateGpuSwitchingManager(const gpu::GPUInfo& gpu_info); |
| 197 | 198 |
| 198 // Notify all observers whenever there is a GPU info update. | 199 // Notify all observers whenever there is a GPU info update. |
| 199 void NotifyGpuInfoUpdate(); | 200 void NotifyGpuInfoUpdate(); |
| 200 | 201 |
| 201 // Try to switch to SwiftShader rendering, if possible and necessary. | 202 // Try to switch to SwiftShader rendering, if possible and necessary. |
| 202 void EnableSwiftShaderIfNecessary(); | 203 void EnableSwiftShaderIfNecessary(); |
| 203 | 204 |
| 205 // Try to switch to WARP rendering if the GPU hardware is not supported or |
| 206 // absent, and if we are trying to run in Windows Metro mode. |
| 207 void EnableWarpIfNecessary(); |
| 208 |
| 204 // Helper to extract the domain from a given URL. | 209 // Helper to extract the domain from a given URL. |
| 205 std::string GetDomainFromURL(const GURL& url) const; | 210 std::string GetDomainFromURL(const GURL& url) const; |
| 206 | 211 |
| 207 // Implementation functions for blocking of 3D graphics APIs, used | 212 // Implementation functions for blocking of 3D graphics APIs, used |
| 208 // for unit testing. | 213 // for unit testing. |
| 209 void BlockDomainFrom3DAPIsAtTime(const GURL& url, | 214 void BlockDomainFrom3DAPIsAtTime(const GURL& url, |
| 210 GpuDataManagerImpl::DomainGuilt guilt, | 215 GpuDataManagerImpl::DomainGuilt guilt, |
| 211 base::Time at_time); | 216 base::Time at_time); |
| 212 GpuDataManagerImpl::DomainBlockStatus Are3DAPIsBlockedAtTime( | 217 GpuDataManagerImpl::DomainBlockStatus Are3DAPIsBlockedAtTime( |
| 213 const GURL& url, base::Time at_time) const; | 218 const GURL& url, base::Time at_time) const; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 224 | 229 |
| 225 scoped_ptr<gpu::GpuBlacklist> gpu_blacklist_; | 230 scoped_ptr<gpu::GpuBlacklist> gpu_blacklist_; |
| 226 scoped_ptr<gpu::GpuDriverBugList> gpu_driver_bug_list_; | 231 scoped_ptr<gpu::GpuDriverBugList> gpu_driver_bug_list_; |
| 227 | 232 |
| 228 const scoped_refptr<GpuDataManagerObserverList> observer_list_; | 233 const scoped_refptr<GpuDataManagerObserverList> observer_list_; |
| 229 | 234 |
| 230 std::vector<LogMessage> log_messages_; | 235 std::vector<LogMessage> log_messages_; |
| 231 | 236 |
| 232 bool use_swiftshader_; | 237 bool use_swiftshader_; |
| 233 | 238 |
| 239 bool use_warp_; |
| 240 |
| 234 base::FilePath swiftshader_path_; | 241 base::FilePath swiftshader_path_; |
| 235 | 242 |
| 236 // Current card force-blacklisted due to GPU crashes, or disabled through | 243 // Current card force-blacklisted due to GPU crashes, or disabled through |
| 237 // the --disable-gpu commandline switch. | 244 // the --disable-gpu commandline switch. |
| 238 bool card_blacklisted_; | 245 bool card_blacklisted_; |
| 239 | 246 |
| 240 // We disable histogram stuff in testing, especially in unit tests because | 247 // We disable histogram stuff in testing, especially in unit tests because |
| 241 // they cause random failures. | 248 // they cause random failures. |
| 242 bool update_histograms_; | 249 bool update_histograms_; |
| 243 | 250 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 257 // True if all future Initialize calls should be ignored. | 264 // True if all future Initialize calls should be ignored. |
| 258 bool finalized_; | 265 bool finalized_; |
| 259 | 266 |
| 260 DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImplPrivate); | 267 DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImplPrivate); |
| 261 }; | 268 }; |
| 262 | 269 |
| 263 } // namespace content | 270 } // namespace content |
| 264 | 271 |
| 265 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_PRIVATE_H_ | 272 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_PRIVATE_H_ |
| 266 | 273 |
| OLD | NEW |