| 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_BLACKLIST_H_ | 5 #ifndef CONTENT_BROWSER_GPU_GPU_BLACKLIST_H_ |
| 6 #define CONTENT_BROWSER_GPU_GPU_BLACKLIST_H_ | 6 #define CONTENT_BROWSER_GPU_GPU_BLACKLIST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 OsFilter os_filter); | 52 OsFilter os_filter); |
| 53 | 53 |
| 54 // Collects system information and combines them with gpu_info and blacklist | 54 // Collects system information and combines them with gpu_info and blacklist |
| 55 // information to determine gpu feature flags. | 55 // information to determine gpu feature flags. |
| 56 // If os is kOsAny, use the current OS; if os_version is null, use the | 56 // If os is kOsAny, use the current OS; if os_version is null, use the |
| 57 // current OS version. | 57 // current OS version. |
| 58 GpuFeatureFlags DetermineGpuFeatureFlags(OsType os, | 58 GpuFeatureFlags DetermineGpuFeatureFlags(OsType os, |
| 59 Version* os_version, | 59 Version* os_version, |
| 60 const GPUInfo& gpu_info); | 60 const GPUInfo& gpu_info); |
| 61 | 61 |
| 62 // Collects the entries that set the "feature" flag from the last | 62 // Collects the active entries that set the "feature" flag from the last |
| 63 // DetermineGpuFeatureFlags() call. This tells which entries are responsible | 63 // DetermineGpuFeatureFlags() call. This tells which entries are responsible |
| 64 // for raising a certain flag, i.e, for blacklisting a certain feature. | 64 // for raising a certain flag, i.e, for blacklisting a certain feature. |
| 65 // Examples of "feature": | 65 // Examples of "feature": |
| 66 // kGpuFeatureAll - any of the supported features; | 66 // kGpuFeatureAll - any of the supported features; |
| 67 // kGpuFeatureWebgl - a single feature; | 67 // kGpuFeatureWebgl - a single feature; |
| 68 // kGpuFeatureWebgl | kGpuFeatureAcceleratedCompositing - two features. | 68 // kGpuFeatureWebgl | kGpuFeatureAcceleratedCompositing - two features. |
| 69 // If disabled set to true, return entries that are disabled; otherwise, |
| 70 // return enabled entries. |
| 69 void GetGpuFeatureFlagEntries(GpuFeatureFlags::GpuFeatureType feature, | 71 void GetGpuFeatureFlagEntries(GpuFeatureFlags::GpuFeatureType feature, |
| 70 std::vector<uint32>& entry_ids) const; | 72 std::vector<uint32>& entry_ids, |
| 73 bool disabled) const; |
| 71 | 74 |
| 72 // Returns status information on the blacklist. This is two parted: | 75 // Returns status information on the blacklist. This is two parted: |
| 73 // { | 76 // { |
| 74 // featureStatus: [] | 77 // featureStatus: [] |
| 75 // problems: [] | 78 // problems: [] |
| 76 // } | 79 // } |
| 77 // | 80 // |
| 78 // Each entry in feature_status has: | 81 // Each entry in feature_status has: |
| 79 // { | 82 // { |
| 80 // name: "name of feature" | 83 // name: "name of feature" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 const Version& os_version, | 234 const Version& os_version, |
| 232 BrowserChannel channel, | 235 BrowserChannel channel, |
| 233 const GPUInfo& gpu_info) const; | 236 const GPUInfo& gpu_info) const; |
| 234 | 237 |
| 235 // Returns the OsType. | 238 // Returns the OsType. |
| 236 OsType GetOsType() const; | 239 OsType GetOsType() const; |
| 237 | 240 |
| 238 // Returns the entry's unique id. 0 is reserved. | 241 // Returns the entry's unique id. 0 is reserved. |
| 239 uint32 id() const; | 242 uint32 id() const; |
| 240 | 243 |
| 244 // Returns whether the entry is disabled. |
| 245 bool disabled() const; |
| 246 |
| 241 // Returns the description of the entry | 247 // Returns the description of the entry |
| 242 const std::string& description() const { return description_; } | 248 const std::string& description() const { return description_; } |
| 243 | 249 |
| 244 // Returns a list of Chromium and Webkit bugs applicable to this entry | 250 // Returns a list of Chromium and Webkit bugs applicable to this entry |
| 245 const std::vector<int>& cr_bugs() const { return cr_bugs_; } | 251 const std::vector<int>& cr_bugs() const { return cr_bugs_; } |
| 246 const std::vector<int>& webkit_bugs() const { return webkit_bugs_; } | 252 const std::vector<int>& webkit_bugs() const { return webkit_bugs_; } |
| 247 | 253 |
| 248 // Returns the GpuFeatureFlags. | 254 // Returns the GpuFeatureFlags. |
| 249 GpuFeatureFlags GetGpuFeatureFlags() const; | 255 GpuFeatureFlags GetGpuFeatureFlags() const; |
| 250 | 256 |
| 251 // Returns true if an unknown field is encountered. | 257 // Returns true if an unknown field is encountered. |
| 252 bool contains_unknown_fields() const { | 258 bool contains_unknown_fields() const { |
| 253 return contains_unknown_fields_; | 259 return contains_unknown_fields_; |
| 254 } | 260 } |
| 255 // Returns true if an unknown blacklist feature is encountered. | 261 // Returns true if an unknown blacklist feature is encountered. |
| 256 bool contains_unknown_features() const { | 262 bool contains_unknown_features() const { |
| 257 return contains_unknown_features_; | 263 return contains_unknown_features_; |
| 258 } | 264 } |
| 259 | 265 |
| 260 private: | 266 private: |
| 261 friend class base::RefCounted<GpuBlacklistEntry>; | 267 friend class base::RefCounted<GpuBlacklistEntry>; |
| 262 | 268 |
| 263 GpuBlacklistEntry(); | 269 GpuBlacklistEntry(); |
| 264 ~GpuBlacklistEntry() { } | 270 ~GpuBlacklistEntry() { } |
| 265 | 271 |
| 266 bool SetId(uint32 id); | 272 bool SetId(uint32 id); |
| 267 | 273 |
| 274 void SetDisabled(bool disabled); |
| 275 |
| 268 bool SetOsInfo(const std::string& os, | 276 bool SetOsInfo(const std::string& os, |
| 269 const std::string& version_op, | 277 const std::string& version_op, |
| 270 const std::string& version_string, | 278 const std::string& version_string, |
| 271 const std::string& version_string2); | 279 const std::string& version_string2); |
| 272 | 280 |
| 273 bool SetVendorId(const std::string& vendor_id_string); | 281 bool SetVendorId(const std::string& vendor_id_string); |
| 274 | 282 |
| 275 bool AddDeviceId(const std::string& device_id_string); | 283 bool AddDeviceId(const std::string& device_id_string); |
| 276 | 284 |
| 277 bool SetDriverVendorInfo(const std::string& vendor_op, | 285 bool SetDriverVendorInfo(const std::string& vendor_op, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 292 const std::string& renderer_value); | 300 const std::string& renderer_value); |
| 293 | 301 |
| 294 bool SetBlacklistedFeatures( | 302 bool SetBlacklistedFeatures( |
| 295 const std::vector<std::string>& blacklisted_features); | 303 const std::vector<std::string>& blacklisted_features); |
| 296 | 304 |
| 297 void AddException(ScopedGpuBlacklistEntry exception); | 305 void AddException(ScopedGpuBlacklistEntry exception); |
| 298 | 306 |
| 299 void AddBrowserChannel(BrowserChannel channel); | 307 void AddBrowserChannel(BrowserChannel channel); |
| 300 | 308 |
| 301 uint32 id_; | 309 uint32 id_; |
| 310 bool disabled_; |
| 302 std::string description_; | 311 std::string description_; |
| 303 std::vector<int> cr_bugs_; | 312 std::vector<int> cr_bugs_; |
| 304 std::vector<int> webkit_bugs_; | 313 std::vector<int> webkit_bugs_; |
| 305 scoped_ptr<OsInfo> os_info_; | 314 scoped_ptr<OsInfo> os_info_; |
| 306 uint32 vendor_id_; | 315 uint32 vendor_id_; |
| 307 std::vector<uint32> device_id_list_; | 316 std::vector<uint32> device_id_list_; |
| 308 scoped_ptr<StringInfo> driver_vendor_info_; | 317 scoped_ptr<StringInfo> driver_vendor_info_; |
| 309 scoped_ptr<VersionInfo> driver_version_info_; | 318 scoped_ptr<VersionInfo> driver_version_info_; |
| 310 scoped_ptr<VersionInfo> driver_date_info_; | 319 scoped_ptr<VersionInfo> driver_date_info_; |
| 311 scoped_ptr<StringInfo> gl_vendor_info_; | 320 scoped_ptr<StringInfo> gl_vendor_info_; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 std::vector<ScopedGpuBlacklistEntry> active_entries_; | 363 std::vector<ScopedGpuBlacklistEntry> active_entries_; |
| 355 | 364 |
| 356 uint32 max_entry_id_; | 365 uint32 max_entry_id_; |
| 357 | 366 |
| 358 bool contains_unknown_fields_; | 367 bool contains_unknown_fields_; |
| 359 | 368 |
| 360 DISALLOW_COPY_AND_ASSIGN(GpuBlacklist); | 369 DISALLOW_COPY_AND_ASSIGN(GpuBlacklist); |
| 361 }; | 370 }; |
| 362 | 371 |
| 363 #endif // CONTENT_BROWSER_GPU_GPU_BLACKLIST_H_ | 372 #endif // CONTENT_BROWSER_GPU_GPU_BLACKLIST_H_ |
| OLD | NEW |