| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 "GPU.BlacklistFeatureTestResults.Accelerated2dCanvas", | 172 "GPU.BlacklistFeatureTestResults.Accelerated2dCanvas", |
| 173 "GPU.BlacklistFeatureTestResults.GpuCompositing", | 173 "GPU.BlacklistFeatureTestResults.GpuCompositing", |
| 174 "GPU.BlacklistFeatureTestResults.GpuRasterization", | 174 "GPU.BlacklistFeatureTestResults.GpuRasterization", |
| 175 "GPU.BlacklistFeatureTestResults.Webgl", | 175 "GPU.BlacklistFeatureTestResults.Webgl", |
| 176 "GPU.BlacklistFeatureTestResults.Webgl2"}; | 176 "GPU.BlacklistFeatureTestResults.Webgl2"}; |
| 177 const bool kGpuFeatureUserFlags[] = { | 177 const bool kGpuFeatureUserFlags[] = { |
| 178 command_line.HasSwitch(switches::kDisableAccelerated2dCanvas), | 178 command_line.HasSwitch(switches::kDisableAccelerated2dCanvas), |
| 179 command_line.HasSwitch(switches::kDisableGpu), | 179 command_line.HasSwitch(switches::kDisableGpu), |
| 180 command_line.HasSwitch(switches::kDisableGpuRasterization), | 180 command_line.HasSwitch(switches::kDisableGpuRasterization), |
| 181 command_line.HasSwitch(switches::kDisableExperimentalWebGL), | 181 command_line.HasSwitch(switches::kDisableExperimentalWebGL), |
| 182 (!command_line.HasSwitch(switches::kEnableUnsafeES3APIs) || | 182 (!command_line.HasSwitch(switches::kEnableES3APIs) || |
| 183 command_line.HasSwitch(switches::kDisableES3APIs))}; | 183 command_line.HasSwitch(switches::kDisableES3APIs))}; |
| 184 #if defined(OS_WIN) | 184 #if defined(OS_WIN) |
| 185 const std::string kGpuBlacklistFeatureHistogramNamesWin[] = { | 185 const std::string kGpuBlacklistFeatureHistogramNamesWin[] = { |
| 186 "GPU.BlacklistFeatureTestResultsWindows.Accelerated2dCanvas", | 186 "GPU.BlacklistFeatureTestResultsWindows.Accelerated2dCanvas", |
| 187 "GPU.BlacklistFeatureTestResultsWindows.GpuCompositing", | 187 "GPU.BlacklistFeatureTestResultsWindows.GpuCompositing", |
| 188 "GPU.BlacklistFeatureTestResultsWindows.GpuRasterization", | 188 "GPU.BlacklistFeatureTestResultsWindows.GpuRasterization", |
| 189 "GPU.BlacklistFeatureTestResultsWindows.Webgl", | 189 "GPU.BlacklistFeatureTestResultsWindows.Webgl", |
| 190 "GPU.BlacklistFeatureTestResultsWindows.Webgl2"}; | 190 "GPU.BlacklistFeatureTestResultsWindows.Webgl2"}; |
| 191 #endif | 191 #endif |
| 192 const size_t kNumFeatures = | 192 const size_t kNumFeatures = |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE) && | 758 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE) && |
| 759 !command_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) { | 759 !command_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) { |
| 760 if (gpu_preferences) { | 760 if (gpu_preferences) { |
| 761 gpu_preferences->disable_web_rtc_hw_encoding = true; | 761 gpu_preferences->disable_web_rtc_hw_encoding = true; |
| 762 } else { | 762 } else { |
| 763 command_line->AppendSwitch(switches::kDisableWebRtcHWEncoding); | 763 command_line->AppendSwitch(switches::kDisableWebRtcHWEncoding); |
| 764 } | 764 } |
| 765 } | 765 } |
| 766 #endif | 766 #endif |
| 767 | 767 |
| 768 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL2) && gpu_preferences) { | 768 if (gpu_preferences) { // enable_unsafe_es3_apis |
| 769 gpu_preferences->enable_unsafe_es3_apis = false; | 769 bool blacklisted = IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL2); |
| 770 bool enabled = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 771 switches::kEnableES3APIs); |
| 772 bool disabled = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 773 switches::kDisableES3APIs); |
| 774 gpu_preferences->enable_unsafe_es3_apis = |
| 775 (enabled || !blacklisted) && !disabled; |
| 770 } | 776 } |
| 771 | 777 |
| 772 // Pass GPU and driver information to GPU process. We try to avoid full GPU | 778 // Pass GPU and driver information to GPU process. We try to avoid full GPU |
| 773 // info collection at GPU process startup, but we need gpu vendor_id, | 779 // info collection at GPU process startup, but we need gpu vendor_id, |
| 774 // device_id, driver_vendor, driver_version for deciding whether we need to | 780 // device_id, driver_vendor, driver_version for deciding whether we need to |
| 775 // collect full info (on Linux) and for crash reporting purpose. | 781 // collect full info (on Linux) and for crash reporting purpose. |
| 776 command_line->AppendSwitchASCII(switches::kGpuVendorID, | 782 command_line->AppendSwitchASCII(switches::kGpuVendorID, |
| 777 base::StringPrintf("0x%04x", gpu_info_.gpu.vendor_id)); | 783 base::StringPrintf("0x%04x", gpu_info_.gpu.vendor_id)); |
| 778 command_line->AppendSwitchASCII(switches::kGpuDeviceID, | 784 command_line->AppendSwitchASCII(switches::kGpuDeviceID, |
| 779 base::StringPrintf("0x%04x", gpu_info_.gpu.device_id)); | 785 base::StringPrintf("0x%04x", gpu_info_.gpu.device_id)); |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1298 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; | 1304 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; |
| 1299 #if defined(OS_WIN) | 1305 #if defined(OS_WIN) |
| 1300 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; | 1306 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; |
| 1301 #endif | 1307 #endif |
| 1302 complete_gpu_info_already_requested_ = true; | 1308 complete_gpu_info_already_requested_ = true; |
| 1303 // Some observers might be waiting. | 1309 // Some observers might be waiting. |
| 1304 NotifyGpuInfoUpdate(); | 1310 NotifyGpuInfoUpdate(); |
| 1305 } | 1311 } |
| 1306 | 1312 |
| 1307 } // namespace content | 1313 } // namespace content |
| OLD | NEW |