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