OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_H_ | 5 #ifndef CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_H_ |
6 #define CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_H_ | 6 #define CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 29 matching lines...) Expand all Loading... |
40 static GpuDataManager* GetInstance(); | 40 static GpuDataManager* GetInstance(); |
41 | 41 |
42 // Requests complete GPUinfo if it has not already been requested | 42 // Requests complete GPUinfo if it has not already been requested |
43 void RequestCompleteGpuInfoIfNeeded(); | 43 void RequestCompleteGpuInfoIfNeeded(); |
44 | 44 |
45 // Only update if the current GPUInfo is not finalized. | 45 // Only update if the current GPUInfo is not finalized. |
46 void UpdateGpuInfo(const content::GPUInfo& gpu_info); | 46 void UpdateGpuInfo(const content::GPUInfo& gpu_info); |
47 | 47 |
48 const content::GPUInfo& gpu_info() const; | 48 const content::GPUInfo& gpu_info() const; |
49 | 49 |
| 50 bool complete_gpu_info_available() const { |
| 51 return complete_gpu_info_available_; |
| 52 } |
| 53 |
50 // Returns status of various GPU features. This is two parted: | 54 // Returns status of various GPU features. This is two parted: |
51 // { | 55 // { |
52 // featureStatus: [] | 56 // featureStatus: [] |
53 // problems: [] | 57 // problems: [] |
54 // } | 58 // } |
55 // | 59 // |
56 // Each entry in feature_status has: | 60 // Each entry in feature_status has: |
57 // { | 61 // { |
58 // name: "name of feature" | 62 // name: "name of feature" |
59 // status: "enabled" | "unavailable_software" | "unavailable_off" | | 63 // status: "enabled" | "unavailable_software" | "unavailable_off" | |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 static bool Merge(content::GPUInfo* object, const content::GPUInfo& other); | 213 static bool Merge(content::GPUInfo* object, const content::GPUInfo& other); |
210 | 214 |
211 // Determin if accelerated-2d-canvas is supported, which depends on whether | 215 // Determin if accelerated-2d-canvas is supported, which depends on whether |
212 // lose_context could happen and whether skia is the backend. | 216 // lose_context could happen and whether skia is the backend. |
213 bool supportsAccelerated2dCanvas() const; | 217 bool supportsAccelerated2dCanvas() const; |
214 | 218 |
215 // Try to switch to software rendering, if possible and necessary. | 219 // Try to switch to software rendering, if possible and necessary. |
216 void EnableSoftwareRenderingIfNecessary(); | 220 void EnableSoftwareRenderingIfNecessary(); |
217 | 221 |
218 bool complete_gpu_info_already_requested_; | 222 bool complete_gpu_info_already_requested_; |
| 223 bool complete_gpu_info_available_; |
219 | 224 |
220 GpuFeatureFlags gpu_feature_flags_; | 225 GpuFeatureFlags gpu_feature_flags_; |
221 GpuFeatureFlags preliminary_gpu_feature_flags_; | 226 GpuFeatureFlags preliminary_gpu_feature_flags_; |
222 | 227 |
223 UserFlags user_flags_; | 228 UserFlags user_flags_; |
224 | 229 |
225 content::GPUInfo gpu_info_; | 230 content::GPUInfo gpu_info_; |
226 mutable base::Lock gpu_info_lock_; | 231 mutable base::Lock gpu_info_lock_; |
227 | 232 |
228 scoped_ptr<GpuBlacklist> gpu_blacklist_; | 233 scoped_ptr<GpuBlacklist> gpu_blacklist_; |
229 | 234 |
230 // Observers. | 235 // Observers. |
231 const scoped_refptr<GpuDataManagerObserverList> observer_list_; | 236 const scoped_refptr<GpuDataManagerObserverList> observer_list_; |
232 | 237 |
233 ListValue log_messages_; | 238 ListValue log_messages_; |
234 bool software_rendering_; | 239 bool software_rendering_; |
235 | 240 |
236 FilePath swiftshader_path_; | 241 FilePath swiftshader_path_; |
237 | 242 |
238 DISALLOW_COPY_AND_ASSIGN(GpuDataManager); | 243 DISALLOW_COPY_AND_ASSIGN(GpuDataManager); |
239 }; | 244 }; |
240 | 245 |
241 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_H_ | 246 #endif // CONTENT_BROWSER_GPU_GPU_DATA_MANAGER_H_ |
OLD | NEW |