| 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 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE) && | 763 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_ENCODE) && |
| 764 !command_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) { | 764 !command_line->HasSwitch(switches::kDisableWebRtcHWEncoding)) { |
| 765 if (gpu_preferences) { | 765 if (gpu_preferences) { |
| 766 gpu_preferences->disable_web_rtc_hw_encoding = true; | 766 gpu_preferences->disable_web_rtc_hw_encoding = true; |
| 767 } else { | 767 } else { |
| 768 command_line->AppendSwitch(switches::kDisableWebRtcHWEncoding); | 768 command_line->AppendSwitch(switches::kDisableWebRtcHWEncoding); |
| 769 } | 769 } |
| 770 } | 770 } |
| 771 #endif | 771 #endif |
| 772 | 772 |
| 773 if (gpu_preferences) { // enable_unsafe_es3_apis | 773 if (gpu_preferences) { // enable_es3_apis |
| 774 bool blacklisted = IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL2); | 774 bool blacklisted = IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL2); |
| 775 bool enabled = base::CommandLine::ForCurrentProcess()->HasSwitch( | 775 bool enabled = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 776 switches::kEnableES3APIs); | 776 switches::kEnableES3APIs); |
| 777 bool disabled = base::CommandLine::ForCurrentProcess()->HasSwitch( | 777 bool disabled = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 778 switches::kDisableES3APIs); | 778 switches::kDisableES3APIs); |
| 779 gpu_preferences->enable_unsafe_es3_apis = | 779 gpu_preferences->enable_es3_apis = (enabled || !blacklisted) && !disabled; |
| 780 (enabled || !blacklisted) && !disabled; | |
| 781 } | 780 } |
| 782 | 781 |
| 783 // Pass GPU and driver information to GPU process. We try to avoid full GPU | 782 // Pass GPU and driver information to GPU process. We try to avoid full GPU |
| 784 // info collection at GPU process startup, but we need gpu vendor_id, | 783 // info collection at GPU process startup, but we need gpu vendor_id, |
| 785 // device_id, driver_vendor, driver_version for deciding whether we need to | 784 // device_id, driver_vendor, driver_version for deciding whether we need to |
| 786 // collect full info (on Linux) and for crash reporting purpose. | 785 // collect full info (on Linux) and for crash reporting purpose. |
| 787 command_line->AppendSwitchASCII(switches::kGpuVendorID, | 786 command_line->AppendSwitchASCII(switches::kGpuVendorID, |
| 788 base::StringPrintf("0x%04x", gpu_info_.gpu.vendor_id)); | 787 base::StringPrintf("0x%04x", gpu_info_.gpu.vendor_id)); |
| 789 command_line->AppendSwitchASCII(switches::kGpuDeviceID, | 788 command_line->AppendSwitchASCII(switches::kGpuDeviceID, |
| 790 base::StringPrintf("0x%04x", gpu_info_.gpu.device_id)); | 789 base::StringPrintf("0x%04x", gpu_info_.gpu.device_id)); |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1309 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; | 1308 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; |
| 1310 #if defined(OS_WIN) | 1309 #if defined(OS_WIN) |
| 1311 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; | 1310 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; |
| 1312 #endif | 1311 #endif |
| 1313 complete_gpu_info_already_requested_ = true; | 1312 complete_gpu_info_already_requested_ = true; |
| 1314 // Some observers might be waiting. | 1313 // Some observers might be waiting. |
| 1315 NotifyGpuInfoUpdate(); | 1314 NotifyGpuInfoUpdate(); |
| 1316 } | 1315 } |
| 1317 | 1316 |
| 1318 } // namespace content | 1317 } // namespace content |
| OLD | NEW |