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 CONTENT_BROWSER_GPU_GPU_UTIL_H_ | 5 #ifndef CONTENT_BROWSER_GPU_GPU_UTIL_H_ |
6 #define CONTENT_BROWSER_GPU_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" | 10 #include "base/basictypes.h" |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 #include "content/public/common/gpu_feature_type.h" | 13 #include "content/public/common/gpu_feature_type.h" |
| 14 #include "content/public/common/gpu_switching_option.h" |
14 | 15 |
15 class GpuBlacklist; | 16 class GpuBlacklist; |
16 | 17 |
17 namespace gpu_util { | 18 namespace gpu_util { |
18 | 19 |
19 // Maps string to GpuFeatureType; returns GPU_FEATURE_TYPE_UNKNOWN if an | 20 // Maps string to GpuFeatureType; returns GPU_FEATURE_TYPE_UNKNOWN if an |
20 // unknown name is input (case-sensitive). | 21 // unknown name is input (case-sensitive). |
21 CONTENT_EXPORT content::GpuFeatureType StringToGpuFeatureType( | 22 CONTENT_EXPORT content::GpuFeatureType StringToGpuFeatureType( |
22 const std::string& feature_string); | 23 const std::string& feature_string); |
23 | 24 |
24 // Gets a string version of a feature type for use in about:gpu. Will yield | 25 // Gets a string version of a feature type for use in about:gpu. Will yield |
25 // strings from StringToGpuFeatureType, e.g. | 26 // strings from StringToGpuFeatureType, e.g. |
26 // GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS becomes "accelerated_2d_canvas" | 27 // GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS becomes "accelerated_2d_canvas" |
27 CONTENT_EXPORT std::string GpuFeatureTypeToString( | 28 CONTENT_EXPORT std::string GpuFeatureTypeToString( |
28 content::GpuFeatureType feature); | 29 content::GpuFeatureType feature); |
29 | 30 |
30 // Maps string to GpuSwitchingOption; returns GPU_SWITCHING_UNKNOWN if an | 31 // Maps string to GpuSwitchingOption; returns GPU_SWITCHING_UNKNOWN if an |
31 // unknown name is input (case-sensitive). | 32 // unknown name is input (case-sensitive). |
32 CONTENT_EXPORT content::GpuSwitchingOption StringToGpuSwitchingOption( | 33 CONTENT_EXPORT content::GpuSwitchingOption StringToGpuSwitchingOption( |
33 const std::string& switching_string); | 34 const std::string& switching_string); |
34 | 35 |
| 36 // Gets a string version of a GpuSwitchingOption. |
| 37 CONTENT_EXPORT std::string GpuSwitchingOptionToString( |
| 38 content::GpuSwitchingOption option); |
| 39 |
35 // Send UMA histograms about the enabled features. | 40 // Send UMA histograms about the enabled features. |
36 CONTENT_EXPORT void UpdateStats( | 41 CONTENT_EXPORT void UpdateStats( |
37 const GpuBlacklist* blacklist, uint32 blacklisted_features); | 42 const GpuBlacklist* blacklist, uint32 blacklisted_features); |
38 | 43 |
39 } // namespace gpu_util | 44 } // namespace gpu_util |
40 | 45 |
41 #endif // CONTENT_BROWSER_GPU_GPU_UTIL_H_ | 46 #endif // CONTENT_BROWSER_GPU_GPU_UTIL_H_ |
42 | 47 |
OLD | NEW |