| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 GpuSideBlacklisting); | 121 GpuSideBlacklisting); |
| 121 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplPrivateTest, | 122 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplPrivateTest, |
| 122 GpuSideExceptions); | 123 GpuSideExceptions); |
| 123 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplPrivateTest, | 124 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplPrivateTest, |
| 124 DisableHardwareAcceleration); | 125 DisableHardwareAcceleration); |
| 125 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplPrivateTest, | 126 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplPrivateTest, |
| 126 SwiftShaderRendering); | 127 SwiftShaderRendering); |
| 127 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplPrivateTest, | 128 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplPrivateTest, |
| 128 SwiftShaderRendering2); | 129 SwiftShaderRendering2); |
| 129 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplPrivateTest, | 130 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplPrivateTest, |
| 131 WarpEnabledOverridesSwiftShader); |
| 132 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplPrivateTest, |
| 130 GpuInfoUpdate); | 133 GpuInfoUpdate); |
| 131 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplPrivateTest, | 134 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplPrivateTest, |
| 132 NoGpuInfoUpdateWithSwiftShader); | 135 NoGpuInfoUpdateWithSwiftShader); |
| 133 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplPrivateTest, | 136 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplPrivateTest, |
| 134 GPUVideoMemoryUsageStatsUpdate); | 137 GPUVideoMemoryUsageStatsUpdate); |
| 135 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplPrivateTest, | 138 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplPrivateTest, |
| 136 BlockAllDomainsFrom3DAPIs); | 139 BlockAllDomainsFrom3DAPIs); |
| 137 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplPrivateTest, | 140 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplPrivateTest, |
| 138 UnblockGuiltyDomainFrom3DAPIs); | 141 UnblockGuiltyDomainFrom3DAPIs); |
| 139 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplPrivateTest, | 142 FRIEND_TEST_ALL_PREFIXES(GpuDataManagerImplPrivateTest, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 // Update the GPU switching status. | 197 // Update the GPU switching status. |
| 195 // This should only be called once at initialization time. | 198 // This should only be called once at initialization time. |
| 196 void UpdateGpuSwitchingManager(const gpu::GPUInfo& gpu_info); | 199 void UpdateGpuSwitchingManager(const gpu::GPUInfo& gpu_info); |
| 197 | 200 |
| 198 // Notify all observers whenever there is a GPU info update. | 201 // Notify all observers whenever there is a GPU info update. |
| 199 void NotifyGpuInfoUpdate(); | 202 void NotifyGpuInfoUpdate(); |
| 200 | 203 |
| 201 // Try to switch to SwiftShader rendering, if possible and necessary. | 204 // Try to switch to SwiftShader rendering, if possible and necessary. |
| 202 void EnableSwiftShaderIfNecessary(); | 205 void EnableSwiftShaderIfNecessary(); |
| 203 | 206 |
| 207 // Try to switch to WARP rendering if the GPU hardware is not supported or |
| 208 // absent, and if we are trying to run in Windows Metro mode. |
| 209 void EnableWarpIfNecessary(); |
| 210 |
| 211 // Use only for testing, forces |use_warp_| to true. |
| 212 void ForceWarpModeForTesting(); |
| 213 |
| 204 // Helper to extract the domain from a given URL. | 214 // Helper to extract the domain from a given URL. |
| 205 std::string GetDomainFromURL(const GURL& url) const; | 215 std::string GetDomainFromURL(const GURL& url) const; |
| 206 | 216 |
| 207 // Implementation functions for blocking of 3D graphics APIs, used | 217 // Implementation functions for blocking of 3D graphics APIs, used |
| 208 // for unit testing. | 218 // for unit testing. |
| 209 void BlockDomainFrom3DAPIsAtTime(const GURL& url, | 219 void BlockDomainFrom3DAPIsAtTime(const GURL& url, |
| 210 GpuDataManagerImpl::DomainGuilt guilt, | 220 GpuDataManagerImpl::DomainGuilt guilt, |
| 211 base::Time at_time); | 221 base::Time at_time); |
| 212 GpuDataManagerImpl::DomainBlockStatus Are3DAPIsBlockedAtTime( | 222 GpuDataManagerImpl::DomainBlockStatus Are3DAPIsBlockedAtTime( |
| 213 const GURL& url, base::Time at_time) const; | 223 const GURL& url, base::Time at_time) const; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 224 | 234 |
| 225 scoped_ptr<gpu::GpuBlacklist> gpu_blacklist_; | 235 scoped_ptr<gpu::GpuBlacklist> gpu_blacklist_; |
| 226 scoped_ptr<gpu::GpuDriverBugList> gpu_driver_bug_list_; | 236 scoped_ptr<gpu::GpuDriverBugList> gpu_driver_bug_list_; |
| 227 | 237 |
| 228 const scoped_refptr<GpuDataManagerObserverList> observer_list_; | 238 const scoped_refptr<GpuDataManagerObserverList> observer_list_; |
| 229 | 239 |
| 230 std::vector<LogMessage> log_messages_; | 240 std::vector<LogMessage> log_messages_; |
| 231 | 241 |
| 232 bool use_swiftshader_; | 242 bool use_swiftshader_; |
| 233 | 243 |
| 244 bool use_warp_; |
| 245 |
| 234 base::FilePath swiftshader_path_; | 246 base::FilePath swiftshader_path_; |
| 235 | 247 |
| 236 // Current card force-blacklisted due to GPU crashes, or disabled through | 248 // Current card force-blacklisted due to GPU crashes, or disabled through |
| 237 // the --disable-gpu commandline switch. | 249 // the --disable-gpu commandline switch. |
| 238 bool card_blacklisted_; | 250 bool card_blacklisted_; |
| 239 | 251 |
| 240 // We disable histogram stuff in testing, especially in unit tests because | 252 // We disable histogram stuff in testing, especially in unit tests because |
| 241 // they cause random failures. | 253 // they cause random failures. |
| 242 bool update_histograms_; | 254 bool update_histograms_; |
| 243 | 255 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 257 // True if all future Initialize calls should be ignored. | 269 // True if all future Initialize calls should be ignored. |
| 258 bool finalized_; | 270 bool finalized_; |
| 259 | 271 |
| 260 DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImplPrivate); | 272 DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImplPrivate); |
| 261 }; | 273 }; |
| 262 | 274 |
| 263 } // namespace content | 275 } // namespace content |
| 264 | 276 |
| 265 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_PRIVATE_H_ | 277 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_PRIVATE_H_ |
| 266 | 278 |
| OLD | NEW |