| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // Collects the entries that set the "feature" flag from the last | 62 // Collects the 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 void GetGpuFeatureFlagEntries(GpuFeatureFlags::GpuFeatureType feature, | 69 void GetGpuFeatureFlagEntries(GpuFeatureFlags::GpuFeatureType feature, |
| 70 std::vector<uint32>& entry_ids) const; | 70 std::vector<uint32>& entry_ids) const; |
| 71 | 71 |
| 72 // Returns status information on the blacklist. This is two parted: | 72 // Returns the description and bugs from active entries from the last |
| 73 // { | 73 // DetermineGpuFeatureFlags() call. |
| 74 // featureStatus: [] | |
| 75 // problems: [] | |
| 76 // } | |
| 77 // | |
| 78 // Each entry in feature_status has: | |
| 79 // { | |
| 80 // name: "name of feature" | |
| 81 // status: "enabled" | "unavailable_software" | "unavailable_off" | | |
| 82 // "software" | "disabled_off" | "disabled_softare"; | |
| 83 // } | |
| 84 // | |
| 85 // The features reported are not 1:1 with GpuFeatureType. Rather, they are: | |
| 86 // '2d_canvas' | |
| 87 // '3d_css' | |
| 88 // 'composting', | |
| 89 // 'webgl', | |
| 90 // 'multisampling' | |
| 91 // | 74 // |
| 92 // Each problems has: | 75 // Each problems has: |
| 93 // { | 76 // { |
| 94 // "description": "Your GPU is too old", | 77 // "description": "Your GPU is too old", |
| 95 // "crBugs": [1234], | 78 // "crBugs": [1234], |
| 96 // "webkitBugs": [] | 79 // "webkitBugs": [] |
| 97 // } | 80 // } |
| 98 base::Value* GetFeatureStatus(bool gpu_access_allowed, | 81 void GetBlacklistReasons(ListValue* problem_list) const; |
| 99 bool disable_accelerated_compositing, | |
| 100 bool disable_accelerated_2D_canvas, | |
| 101 bool disable_experimental_webgl, | |
| 102 bool disable_multisampling) const; | |
| 103 | 82 |
| 104 // Return the largest entry id. This is used for histogramming. | 83 // Return the largest entry id. This is used for histogramming. |
| 105 uint32 max_entry_id() const; | 84 uint32 max_entry_id() const; |
| 106 | 85 |
| 107 // Collects the version of the current blacklist. Returns false and sets | 86 // Collects the version of the current blacklist. Returns false and sets |
| 108 // major and minor to 0 on failure. | 87 // major and minor to 0 on failure. |
| 109 bool GetVersion(uint16* major, uint16* monir) const; | 88 bool GetVersion(uint16* major, uint16* monir) const; |
| 110 | 89 |
| 111 // Collects the version of the current blacklist from a parsed json file. | 90 // Collects the version of the current blacklist from a parsed json file. |
| 112 // Returns false and sets major and minor to 0 on failure. | 91 // Returns false and sets major and minor to 0 on failure. |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 std::vector<BrowserChannel> browser_channels_; | 294 std::vector<BrowserChannel> browser_channels_; |
| 316 bool contains_unknown_fields_; | 295 bool contains_unknown_fields_; |
| 317 bool contains_unknown_features_; | 296 bool contains_unknown_features_; |
| 318 }; | 297 }; |
| 319 | 298 |
| 320 // Gets the current OS type. | 299 // Gets the current OS type. |
| 321 static OsType GetOsType(); | 300 static OsType GetOsType(); |
| 322 | 301 |
| 323 void Clear(); | 302 void Clear(); |
| 324 | 303 |
| 325 bool IsFeatureBlacklisted(GpuFeatureFlags::GpuFeatureType feature) const; | |
| 326 | |
| 327 // Check if the entry is supported by the current version of browser. | 304 // Check if the entry is supported by the current version of browser. |
| 328 // By default, if there is no browser version information in the entry, | 305 // By default, if there is no browser version information in the entry, |
| 329 // return kSupported; | 306 // return kSupported; |
| 330 BrowserVersionSupport IsEntrySupportedByCurrentBrowserVersion( | 307 BrowserVersionSupport IsEntrySupportedByCurrentBrowserVersion( |
| 331 base::DictionaryValue* value); | 308 base::DictionaryValue* value); |
| 332 | 309 |
| 333 // Returns the number of entries. This is only for tests. | 310 // Returns the number of entries. This is only for tests. |
| 334 size_t num_entries() const; | 311 size_t num_entries() const; |
| 335 | 312 |
| 336 // Check if any entries contain unknown fields. This is only for tests. | 313 // Check if any entries contain unknown fields. This is only for tests. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 354 std::vector<ScopedGpuBlacklistEntry> active_entries_; | 331 std::vector<ScopedGpuBlacklistEntry> active_entries_; |
| 355 | 332 |
| 356 uint32 max_entry_id_; | 333 uint32 max_entry_id_; |
| 357 | 334 |
| 358 bool contains_unknown_fields_; | 335 bool contains_unknown_fields_; |
| 359 | 336 |
| 360 DISALLOW_COPY_AND_ASSIGN(GpuBlacklist); | 337 DISALLOW_COPY_AND_ASSIGN(GpuBlacklist); |
| 361 }; | 338 }; |
| 362 | 339 |
| 363 #endif // CONTENT_BROWSER_GPU_GPU_BLACKLIST_H_ | 340 #endif // CONTENT_BROWSER_GPU_GPU_BLACKLIST_H_ |
| OLD | NEW |