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_H_ | 5 #ifndef CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ |
6 #define CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ | 6 #define CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 // GpuDataManager implementation. | 68 // GpuDataManager implementation. |
69 void BlacklistWebGLForTesting() override; | 69 void BlacklistWebGLForTesting() override; |
70 bool IsFeatureBlacklisted(int feature) const override; | 70 bool IsFeatureBlacklisted(int feature) const override; |
71 bool IsFeatureEnabled(int feature) const override; | 71 bool IsFeatureEnabled(int feature) const override; |
72 bool IsWebGLEnabled() const override; | 72 bool IsWebGLEnabled() const override; |
73 gpu::GPUInfo GetGPUInfo() const override; | 73 gpu::GPUInfo GetGPUInfo() const override; |
74 bool GpuAccessAllowed(std::string* reason) const override; | 74 bool GpuAccessAllowed(std::string* reason) const override; |
75 void RequestCompleteGpuInfoIfNeeded() override; | 75 void RequestCompleteGpuInfoIfNeeded() override; |
76 bool IsEssentialGpuInfoAvailable() const override; | 76 bool IsEssentialGpuInfoAvailable() const override; |
77 bool IsCompleteGpuInfoAvailable() const override; | 77 bool IsCompleteGpuInfoAvailable() const override; |
78 void RequestVideoMemoryUsageStatsUpdate() const override; | 78 void RequestVideoMemoryUsageStatsUpdate( |
| 79 const base::Callback<void(const gpu::VideoMemoryUsageStats& stats)>& |
| 80 callback) const override; |
79 bool ShouldUseSwiftShader() const override; | 81 bool ShouldUseSwiftShader() const override; |
80 // TODO(kbr): the threading model for the GpuDataManagerObservers is | 82 // TODO(kbr): the threading model for the GpuDataManagerObservers is |
81 // not well defined, and it's impossible for callers to correctly | 83 // not well defined, and it's impossible for callers to correctly |
82 // delete observers from anywhere except in one of the observer's | 84 // delete observers from anywhere except in one of the observer's |
83 // notification methods. Observer addition and removal, and their | 85 // notification methods. Observer addition and removal, and their |
84 // callbacks, should probably be required to occur on the UI thread. | 86 // callbacks, should probably be required to occur on the UI thread. |
85 void AddObserver(GpuDataManagerObserver* observer) override; | 87 void AddObserver(GpuDataManagerObserver* observer) override; |
86 void RemoveObserver(GpuDataManagerObserver* observer) override; | 88 void RemoveObserver(GpuDataManagerObserver* observer) override; |
87 void UnblockDomainFrom3DAPIs(const GURL& url) override; | 89 void UnblockDomainFrom3DAPIs(const GURL& url) override; |
88 void SetGLStrings(const std::string& gl_vendor, | 90 void SetGLStrings(const std::string& gl_vendor, |
(...skipping 17 matching lines...) Expand all Loading... |
106 const gpu::GPUInfo& gpu_info); | 108 const gpu::GPUInfo& gpu_info); |
107 | 109 |
108 // Only update if the current GPUInfo is not finalized. If blacklist is | 110 // Only update if the current GPUInfo is not finalized. If blacklist is |
109 // loaded, run through blacklist and update blacklisted features. | 111 // loaded, run through blacklist and update blacklisted features. |
110 void UpdateGpuInfo(const gpu::GPUInfo& gpu_info); | 112 void UpdateGpuInfo(const gpu::GPUInfo& gpu_info); |
111 | 113 |
112 // Update the GPU feature info. This updates the blacklist and enabled status | 114 // Update the GPU feature info. This updates the blacklist and enabled status |
113 // of GPU rasterization. In the future this will be used for more features. | 115 // of GPU rasterization. In the future this will be used for more features. |
114 void UpdateGpuFeatureInfo(const gpu::GpuFeatureInfo& gpu_feature_info); | 116 void UpdateGpuFeatureInfo(const gpu::GpuFeatureInfo& gpu_feature_info); |
115 | 117 |
116 void UpdateVideoMemoryUsageStats( | |
117 const gpu::VideoMemoryUsageStats& video_memory_usage_stats); | |
118 | |
119 // Insert disable-feature switches corresponding to preliminary gpu feature | 118 // Insert disable-feature switches corresponding to preliminary gpu feature |
120 // flags into the renderer process command line. | 119 // flags into the renderer process command line. |
121 void AppendRendererCommandLine(base::CommandLine* command_line) const; | 120 void AppendRendererCommandLine(base::CommandLine* command_line) const; |
122 | 121 |
123 // Insert switches into gpu process command line: kUseGL, etc. | 122 // Insert switches into gpu process command line: kUseGL, etc. |
124 // If the gpu_preferences isn't a nullptr, the gpu_preferences will be set | 123 // If the gpu_preferences isn't a nullptr, the gpu_preferences will be set |
125 // for some GPU switches which have been replaced by GpuPreferences, and those | 124 // for some GPU switches which have been replaced by GpuPreferences, and those |
126 // switches will not be append to the command_line anymore. | 125 // switches will not be append to the command_line anymore. |
127 void AppendGpuCommandLine(base::CommandLine* command_line, | 126 void AppendGpuCommandLine(base::CommandLine* command_line, |
128 gpu::GpuPreferences* gpu_preferences) const; | 127 gpu::GpuPreferences* gpu_preferences) const; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 225 |
227 mutable base::Lock lock_; | 226 mutable base::Lock lock_; |
228 std::unique_ptr<GpuDataManagerImplPrivate> private_; | 227 std::unique_ptr<GpuDataManagerImplPrivate> private_; |
229 | 228 |
230 DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImpl); | 229 DISALLOW_COPY_AND_ASSIGN(GpuDataManagerImpl); |
231 }; | 230 }; |
232 | 231 |
233 } // namespace content | 232 } // namespace content |
234 | 233 |
235 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ | 234 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_IMPL_H_ |
OLD | NEW |