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 #include "content/browser/gpu/gpu_util.h" | 5 #include "content/browser/gpu/gpu_util.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
12 #include "base/sys_info.h" | 12 #include "base/sys_info.h" |
13 #include "base/version.h" | 13 #include "base/version.h" |
14 #include "content/browser/gpu/gpu_blacklist.h" | 14 #include "content/browser/gpu/gpu_blacklist.h" |
15 #include "content/public/common/content_switches.h" | 15 #include "content/public/common/content_switches.h" |
16 #include "ui/gl/gl_switches.h" | 16 #include "ui/gl/gl_switches.h" |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 namespace { | 19 namespace { |
20 | 20 |
21 const char kGpuFeatureNameAccelerated2dCanvas[] = "accelerated_2d_canvas"; | 21 const char kGpuFeatureNameAccelerated2dCanvas[] = "accelerated_2d_canvas"; |
22 const char kGpuFeatureNameAcceleratedCompositing[] = "accelerated_compositing"; | 22 const char kGpuFeatureNameAcceleratedCompositing[] = "accelerated_compositing"; |
23 const char kGpuFeatureNameWebgl[] = "webgl"; | 23 const char kGpuFeatureNameWebgl[] = "webgl"; |
24 const char kGpuFeatureNameMultisampling[] = "multisampling"; | 24 const char kGpuFeatureNameMultisampling[] = "multisampling"; |
25 const char kGpuFeatureNameFlash3d[] = "flash_3d"; | 25 const char kGpuFeatureNameFlash3d[] = "flash_3d"; |
26 const char kGpuFeatureNameFlashStage3d[] = "flash_stage3d"; | 26 const char kGpuFeatureNameFlashStage3d[] = "flash_stage3d"; |
| 27 const char kGpuFeatureNameFlashStage3dBaseline[] = "flash_stage3d_baseline"; |
27 const char kGpuFeatureNameTextureSharing[] = "texture_sharing"; | 28 const char kGpuFeatureNameTextureSharing[] = "texture_sharing"; |
28 const char kGpuFeatureNameAcceleratedVideoDecode[] = "accelerated_video_decode"; | 29 const char kGpuFeatureNameAcceleratedVideoDecode[] = "accelerated_video_decode"; |
29 const char kGpuFeatureName3dCss[] = "3d_css"; | 30 const char kGpuFeatureName3dCss[] = "3d_css"; |
30 const char kGpuFeatureNameAcceleratedVideo[] = "accelerated_video"; | 31 const char kGpuFeatureNameAcceleratedVideo[] = "accelerated_video"; |
31 const char kGpuFeatureNamePanelFitting[] = "panel_fitting"; | 32 const char kGpuFeatureNamePanelFitting[] = "panel_fitting"; |
32 const char kGpuFeatureNameForceCompositingMode[] = "force_compositing_mode"; | 33 const char kGpuFeatureNameForceCompositingMode[] = "force_compositing_mode"; |
33 const char kGpuFeatureNameAll[] = "all"; | 34 const char kGpuFeatureNameAll[] = "all"; |
34 const char kGpuFeatureNameUnknown[] = "unknown"; | 35 const char kGpuFeatureNameUnknown[] = "unknown"; |
35 | 36 |
36 enum GpuFeatureStatus { | 37 enum GpuFeatureStatus { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 if (feature_string == kGpuFeatureNameAcceleratedCompositing) | 93 if (feature_string == kGpuFeatureNameAcceleratedCompositing) |
93 return GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING; | 94 return GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING; |
94 if (feature_string == kGpuFeatureNameWebgl) | 95 if (feature_string == kGpuFeatureNameWebgl) |
95 return GPU_FEATURE_TYPE_WEBGL; | 96 return GPU_FEATURE_TYPE_WEBGL; |
96 if (feature_string == kGpuFeatureNameMultisampling) | 97 if (feature_string == kGpuFeatureNameMultisampling) |
97 return GPU_FEATURE_TYPE_MULTISAMPLING; | 98 return GPU_FEATURE_TYPE_MULTISAMPLING; |
98 if (feature_string == kGpuFeatureNameFlash3d) | 99 if (feature_string == kGpuFeatureNameFlash3d) |
99 return GPU_FEATURE_TYPE_FLASH3D; | 100 return GPU_FEATURE_TYPE_FLASH3D; |
100 if (feature_string == kGpuFeatureNameFlashStage3d) | 101 if (feature_string == kGpuFeatureNameFlashStage3d) |
101 return GPU_FEATURE_TYPE_FLASH_STAGE3D; | 102 return GPU_FEATURE_TYPE_FLASH_STAGE3D; |
| 103 if (feature_string == kGpuFeatureNameFlashStage3dBaseline) |
| 104 return GPU_FEATURE_TYPE_FLASH_STAGE3D_BASELINE; |
102 if (feature_string == kGpuFeatureNameTextureSharing) | 105 if (feature_string == kGpuFeatureNameTextureSharing) |
103 return GPU_FEATURE_TYPE_TEXTURE_SHARING; | 106 return GPU_FEATURE_TYPE_TEXTURE_SHARING; |
104 if (feature_string == kGpuFeatureNameAcceleratedVideoDecode) | 107 if (feature_string == kGpuFeatureNameAcceleratedVideoDecode) |
105 return GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE; | 108 return GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE; |
106 if (feature_string == kGpuFeatureName3dCss) | 109 if (feature_string == kGpuFeatureName3dCss) |
107 return GPU_FEATURE_TYPE_3D_CSS; | 110 return GPU_FEATURE_TYPE_3D_CSS; |
108 if (feature_string == kGpuFeatureNameAcceleratedVideo) | 111 if (feature_string == kGpuFeatureNameAcceleratedVideo) |
109 return GPU_FEATURE_TYPE_ACCELERATED_VIDEO; | 112 return GPU_FEATURE_TYPE_ACCELERATED_VIDEO; |
110 if (feature_string == kGpuFeatureNamePanelFitting) | 113 if (feature_string == kGpuFeatureNamePanelFitting) |
111 return GPU_FEATURE_TYPE_PANEL_FITTING; | 114 return GPU_FEATURE_TYPE_PANEL_FITTING; |
(...skipping 14 matching lines...) Expand all Loading... |
126 if (type & GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING) | 129 if (type & GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING) |
127 matches.push_back(kGpuFeatureNameAcceleratedCompositing); | 130 matches.push_back(kGpuFeatureNameAcceleratedCompositing); |
128 if (type & GPU_FEATURE_TYPE_WEBGL) | 131 if (type & GPU_FEATURE_TYPE_WEBGL) |
129 matches.push_back(kGpuFeatureNameWebgl); | 132 matches.push_back(kGpuFeatureNameWebgl); |
130 if (type & GPU_FEATURE_TYPE_MULTISAMPLING) | 133 if (type & GPU_FEATURE_TYPE_MULTISAMPLING) |
131 matches.push_back(kGpuFeatureNameMultisampling); | 134 matches.push_back(kGpuFeatureNameMultisampling); |
132 if (type & GPU_FEATURE_TYPE_FLASH3D) | 135 if (type & GPU_FEATURE_TYPE_FLASH3D) |
133 matches.push_back(kGpuFeatureNameFlash3d); | 136 matches.push_back(kGpuFeatureNameFlash3d); |
134 if (type & GPU_FEATURE_TYPE_FLASH_STAGE3D) | 137 if (type & GPU_FEATURE_TYPE_FLASH_STAGE3D) |
135 matches.push_back(kGpuFeatureNameFlashStage3d); | 138 matches.push_back(kGpuFeatureNameFlashStage3d); |
| 139 if (type & GPU_FEATURE_TYPE_FLASH_STAGE3D_BASELINE) |
| 140 matches.push_back(kGpuFeatureNameFlashStage3dBaseline); |
136 if (type & GPU_FEATURE_TYPE_TEXTURE_SHARING) | 141 if (type & GPU_FEATURE_TYPE_TEXTURE_SHARING) |
137 matches.push_back(kGpuFeatureNameTextureSharing); | 142 matches.push_back(kGpuFeatureNameTextureSharing); |
138 if (type & GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE) | 143 if (type & GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE) |
139 matches.push_back(kGpuFeatureNameAcceleratedVideoDecode); | 144 matches.push_back(kGpuFeatureNameAcceleratedVideoDecode); |
140 if (type & GPU_FEATURE_TYPE_3D_CSS) | 145 if (type & GPU_FEATURE_TYPE_3D_CSS) |
141 matches.push_back(kGpuFeatureName3dCss); | 146 matches.push_back(kGpuFeatureName3dCss); |
142 if (type & GPU_FEATURE_TYPE_ACCELERATED_VIDEO) | 147 if (type & GPU_FEATURE_TYPE_ACCELERATED_VIDEO) |
143 matches.push_back(kGpuFeatureNameAcceleratedVideo); | 148 matches.push_back(kGpuFeatureNameAcceleratedVideo); |
144 if (type & GPU_FEATURE_TYPE_PANEL_FITTING) | 149 if (type & GPU_FEATURE_TYPE_PANEL_FITTING) |
145 matches.push_back(kGpuFeatureNamePanelFitting); | 150 matches.push_back(kGpuFeatureNamePanelFitting); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 kGpuBlacklistFeatureHistogramNamesWin[i], | 259 kGpuBlacklistFeatureHistogramNamesWin[i], |
255 1, kNumWinSubVersions * kGpuFeatureNumStatus, | 260 1, kNumWinSubVersions * kGpuFeatureNumStatus, |
256 kNumWinSubVersions * kGpuFeatureNumStatus + 1, | 261 kNumWinSubVersions * kGpuFeatureNumStatus + 1, |
257 base::HistogramBase::kUmaTargetedHistogramFlag); | 262 base::HistogramBase::kUmaTargetedHistogramFlag); |
258 histogram_pointer->Add(GetGpuBlacklistHistogramValueWin(value)); | 263 histogram_pointer->Add(GetGpuBlacklistHistogramValueWin(value)); |
259 #endif | 264 #endif |
260 } | 265 } |
261 } | 266 } |
262 | 267 |
263 } // namespace content | 268 } // namespace content |
OLD | NEW |