OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_GPU_UTIL_H_ | 5 #ifndef CONTENT_BROWSER_GPU_GPU_UTIL_H_ |
6 #define CHROME_BROWSER_GPU_UTIL_H_ | 6 #define CONTENT_BROWSER_GPU_GPU_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "build/build_config.h" |
| 12 #include "content/common/content_export.h" |
10 #include "content/public/common/gpu_feature_type.h" | 13 #include "content/public/common/gpu_feature_type.h" |
11 | 14 |
12 namespace base { | 15 class GpuBlacklist; |
13 class DictionaryValue; | |
14 class Value; | |
15 } | |
16 | 16 |
17 namespace gpu_util { | 17 namespace gpu_util { |
18 | 18 |
19 // Maps string to GpuFeatureType; returns GPU_FEATURE_TYPE_UNKNOWN if none of | 19 // Maps string to GpuFeatureType; returns GPU_FEATURE_TYPE_UNKNOWN if none of |
20 // the following is input (case-sensitive): | 20 // the following is input (case-sensitive): |
21 // "accelerated_2d_canvas" | 21 // "accelerated_2d_canvas" |
22 // "accelerated_compositing" | 22 // "accelerated_compositing" |
23 // "webgl" | 23 // "webgl" |
24 // "multisampling" | 24 // "multisampling" |
25 content::GpuFeatureType StringToGpuFeatureType( | 25 CONTENT_EXPORT content::GpuFeatureType StringToGpuFeatureType( |
26 const std::string& feature_string); | 26 const std::string& feature_string); |
27 | 27 |
28 // Gets a string version of a feature type for use in about:gpu. Will yield | 28 // Gets a string version of a feature type for use in about:gpu. Will yield |
29 // strings from StringToGpuFeatureType, e.g. | 29 // strings from StringToGpuFeatureType, e.g. |
30 // GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS becomes "accelerated_2d_canvas" | 30 // GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS becomes "accelerated_2d_canvas" |
31 std::string GpuFeatureTypeToString(content::GpuFeatureType feature); | 31 CONTENT_EXPORT std::string GpuFeatureTypeToString( |
32 | 32 content::GpuFeatureType feature); |
33 // Returns status of various GPU features. This is two parted: | |
34 // { | |
35 // featureStatus: [] | |
36 // problems: [] | |
37 // } | |
38 // | |
39 // Each entry in feature_status has: | |
40 // { | |
41 // name: "name of feature" | |
42 // status: "enabled" | "unavailable_software" | "unavailable_off" | | |
43 // "software" | "disabled_off" | "disabled_softare"; | |
44 // } | |
45 // | |
46 // The features reported are not 1:1 with GpuFeatureType. Rather, they are: | |
47 // '2d_canvas' | |
48 // '3d_css' | |
49 // 'composting', | |
50 // 'webgl', | |
51 // 'multisampling', | |
52 // 'flash_3d', | |
53 // 'flash_stage3d', | |
54 // 'texture_sharing' | |
55 // 'video_decode' | |
56 // | |
57 // Each problems has: | |
58 // { | |
59 // "description": "Your GPU is too old", | |
60 // "crBugs": [1234], | |
61 // "webkitBugs": [] | |
62 // } | |
63 // | |
64 // Caller is responsible for deleting the returned value. | |
65 base::Value* GetFeatureStatus(); | |
66 | |
67 // Returns the GpuInfo as a DictionaryValue. | |
68 base::DictionaryValue* GpuInfoAsDictionaryValue(); | |
69 | 33 |
70 // Send UMA histograms about the enabled features. | 34 // Send UMA histograms about the enabled features. |
71 void UpdateStats(); | 35 CONTENT_EXPORT void UpdateStats( |
72 | 36 const GpuBlacklist* blacklist, uint32 blacklisted_features); |
73 // Sets up force-compositing-mode and threaded compositing field trials. | |
74 void InitializeCompositingFieldTrial(); | |
75 | 37 |
76 } // namespace gpu_util | 38 } // namespace gpu_util |
77 | 39 |
78 #endif // CHROME_BROWSER_GPU_UTIL_H_ | 40 #endif // CONTENT_BROWSER_GPU_GPU_UTIL_H_ |
| 41 |
OLD | NEW |