| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_data_manager_impl_private.h" | 5 #include "content/browser/gpu/gpu_data_manager_impl_private.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 blacklist->GetDecisionEntries(&flag_disabled_entries, disabled); | 159 blacklist->GetDecisionEntries(&flag_disabled_entries, disabled); |
| 160 for (uint32_t disabled_entry : flag_disabled_entries) { | 160 for (uint32_t disabled_entry : flag_disabled_entries) { |
| 161 UMA_HISTOGRAM_ENUMERATION("GPU.BlacklistTestResultsPerDisabledEntry", | 161 UMA_HISTOGRAM_ENUMERATION("GPU.BlacklistTestResultsPerDisabledEntry", |
| 162 disabled_entry, max_entry_id + 1); | 162 disabled_entry, max_entry_id + 1); |
| 163 } | 163 } |
| 164 | 164 |
| 165 const gpu::GpuFeatureType kGpuFeatures[] = { | 165 const gpu::GpuFeatureType kGpuFeatures[] = { |
| 166 gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS, | 166 gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS, |
| 167 gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING, | 167 gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING, |
| 168 gpu::GPU_FEATURE_TYPE_GPU_RASTERIZATION, | 168 gpu::GPU_FEATURE_TYPE_GPU_RASTERIZATION, |
| 169 gpu::GPU_FEATURE_TYPE_WEBGL}; | 169 gpu::GPU_FEATURE_TYPE_WEBGL, |
| 170 gpu::GPU_FEATURE_TYPE_WEBGL2}; |
| 170 const std::string kGpuBlacklistFeatureHistogramNames[] = { | 171 const std::string kGpuBlacklistFeatureHistogramNames[] = { |
| 171 "GPU.BlacklistFeatureTestResults.Accelerated2dCanvas", | 172 "GPU.BlacklistFeatureTestResults.Accelerated2dCanvas", |
| 172 "GPU.BlacklistFeatureTestResults.GpuCompositing", | 173 "GPU.BlacklistFeatureTestResults.GpuCompositing", |
| 173 "GPU.BlacklistFeatureTestResults.GpuRasterization", | 174 "GPU.BlacklistFeatureTestResults.GpuRasterization", |
| 174 "GPU.BlacklistFeatureTestResults.Webgl"}; | 175 "GPU.BlacklistFeatureTestResults.Webgl", |
| 176 "GPU.BlacklistFeatureTestResults.Webgl2"}; |
| 175 const bool kGpuFeatureUserFlags[] = { | 177 const bool kGpuFeatureUserFlags[] = { |
| 176 command_line.HasSwitch(switches::kDisableAccelerated2dCanvas), | 178 command_line.HasSwitch(switches::kDisableAccelerated2dCanvas), |
| 177 command_line.HasSwitch(switches::kDisableGpu), | 179 command_line.HasSwitch(switches::kDisableGpu), |
| 178 command_line.HasSwitch(switches::kDisableGpuRasterization), | 180 command_line.HasSwitch(switches::kDisableGpuRasterization), |
| 179 command_line.HasSwitch(switches::kDisableExperimentalWebGL)}; | 181 command_line.HasSwitch(switches::kDisableExperimentalWebGL), |
| 182 (!command_line.HasSwitch(switches::kEnableUnsafeES3APIs) || |
| 183 command_line.HasSwitch(switches::kDisableES3APIs))}; |
| 180 #if defined(OS_WIN) | 184 #if defined(OS_WIN) |
| 181 const std::string kGpuBlacklistFeatureHistogramNamesWin[] = { | 185 const std::string kGpuBlacklistFeatureHistogramNamesWin[] = { |
| 182 "GPU.BlacklistFeatureTestResultsWindows.Accelerated2dCanvas", | 186 "GPU.BlacklistFeatureTestResultsWindows.Accelerated2dCanvas", |
| 183 "GPU.BlacklistFeatureTestResultsWindows.GpuCompositing", | 187 "GPU.BlacklistFeatureTestResultsWindows.GpuCompositing", |
| 184 "GPU.BlacklistFeatureTestResultsWindows.GpuRasterization", | 188 "GPU.BlacklistFeatureTestResultsWindows.GpuRasterization", |
| 185 "GPU.BlacklistFeatureTestResultsWindows.Webgl"}; | 189 "GPU.BlacklistFeatureTestResultsWindows.Webgl", |
| 190 "GPU.BlacklistFeatureTestResultsWindows.Webgl2"}; |
| 186 #endif | 191 #endif |
| 187 const size_t kNumFeatures = | 192 const size_t kNumFeatures = |
| 188 sizeof(kGpuFeatures) / sizeof(gpu::GpuFeatureType); | 193 sizeof(kGpuFeatures) / sizeof(gpu::GpuFeatureType); |
| 189 for (size_t i = 0; i < kNumFeatures; ++i) { | 194 for (size_t i = 0; i < kNumFeatures; ++i) { |
| 190 // We can't use UMA_HISTOGRAM_ENUMERATION here because the same name is | 195 // We can't use UMA_HISTOGRAM_ENUMERATION here because the same name is |
| 191 // expected if the macro is used within a loop. | 196 // expected if the macro is used within a loop. |
| 192 GpuFeatureStatus value = kGpuFeatureEnabled; | 197 GpuFeatureStatus value = kGpuFeatureEnabled; |
| 193 if (blacklisted_features.count(kGpuFeatures[i])) | 198 if (blacklisted_features.count(kGpuFeatures[i])) |
| 194 value = kGpuFeatureBlacklisted; | 199 value = kGpuFeatureBlacklisted; |
| 195 else if (kGpuFeatureUserFlags[i]) | 200 else if (kGpuFeatureUserFlags[i]) |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE) && | 758 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE) && |
| 754 !command_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) { | 759 !command_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) { |
| 755 if (gpu_preferences) { | 760 if (gpu_preferences) { |
| 756 gpu_preferences->disable_web_rtc_hw_encoding = true; | 761 gpu_preferences->disable_web_rtc_hw_encoding = true; |
| 757 } else { | 762 } else { |
| 758 command_line->AppendSwitch(switches::kDisableWebRtcHWEncoding); | 763 command_line->AppendSwitch(switches::kDisableWebRtcHWEncoding); |
| 759 } | 764 } |
| 760 } | 765 } |
| 761 #endif | 766 #endif |
| 762 | 767 |
| 768 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL2) && |
| 769 !command_line->HasSwitch(switches::kDisableES3APIs)) { |
| 770 command_line->AppendSwitch(switches::kDisableES3APIs); |
| 771 } |
| 772 |
| 763 // Pass GPU and driver information to GPU process. We try to avoid full GPU | 773 // Pass GPU and driver information to GPU process. We try to avoid full GPU |
| 764 // info collection at GPU process startup, but we need gpu vendor_id, | 774 // info collection at GPU process startup, but we need gpu vendor_id, |
| 765 // device_id, driver_vendor, driver_version for deciding whether we need to | 775 // device_id, driver_vendor, driver_version for deciding whether we need to |
| 766 // collect full info (on Linux) and for crash reporting purpose. | 776 // collect full info (on Linux) and for crash reporting purpose. |
| 767 command_line->AppendSwitchASCII(switches::kGpuVendorID, | 777 command_line->AppendSwitchASCII(switches::kGpuVendorID, |
| 768 base::StringPrintf("0x%04x", gpu_info_.gpu.vendor_id)); | 778 base::StringPrintf("0x%04x", gpu_info_.gpu.vendor_id)); |
| 769 command_line->AppendSwitchASCII(switches::kGpuDeviceID, | 779 command_line->AppendSwitchASCII(switches::kGpuDeviceID, |
| 770 base::StringPrintf("0x%04x", gpu_info_.gpu.device_id)); | 780 base::StringPrintf("0x%04x", gpu_info_.gpu.device_id)); |
| 771 command_line->AppendSwitchASCII(switches::kGpuDriverVendor, | 781 command_line->AppendSwitchASCII(switches::kGpuDriverVendor, |
| 772 gpu_info_.driver_vendor); | 782 gpu_info_.driver_vendor); |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1289 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; | 1299 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; |
| 1290 #if defined(OS_WIN) | 1300 #if defined(OS_WIN) |
| 1291 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; | 1301 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; |
| 1292 #endif | 1302 #endif |
| 1293 complete_gpu_info_already_requested_ = true; | 1303 complete_gpu_info_already_requested_ = true; |
| 1294 // Some observers might be waiting. | 1304 // Some observers might be waiting. |
| 1295 NotifyGpuInfoUpdate(); | 1305 NotifyGpuInfoUpdate(); |
| 1296 } | 1306 } |
| 1297 | 1307 |
| 1298 } // namespace content | 1308 } // namespace content |
| OLD | NEW |