Chromium Code Reviews| 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 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 692 base::CommandLine* command_line, | 692 base::CommandLine* command_line, |
| 693 gpu::GpuPreferences* gpu_preferences) const { | 693 gpu::GpuPreferences* gpu_preferences) const { |
| 694 DCHECK(command_line); | 694 DCHECK(command_line); |
| 695 | 695 |
| 696 std::string use_gl = | 696 std::string use_gl = |
| 697 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 697 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 698 switches::kUseGL); | 698 switches::kUseGL); |
| 699 if (gpu_driver_bugs_.find(gpu::DISABLE_D3D11) != gpu_driver_bugs_.end()) | 699 if (gpu_driver_bugs_.find(gpu::DISABLE_D3D11) != gpu_driver_bugs_.end()) |
| 700 command_line->AppendSwitch(switches::kDisableD3D11); | 700 command_line->AppendSwitch(switches::kDisableD3D11); |
| 701 if (gpu_driver_bugs_.find(gpu::DISABLE_ES3_GL_CONTEXT) != | 701 if (gpu_driver_bugs_.find(gpu::DISABLE_ES3_GL_CONTEXT) != |
| 702 gpu_driver_bugs_.end()) { | 702 gpu_driver_bugs_.end() && gpu_preferences) { |
| 703 command_line->AppendSwitch(switches::kDisableES3GLContext); | 703 gpu_preferences->enable_unsafe_es3_apis = false; |
|
Zhenyao Mo
2016/11/02 21:46:28
Sorry I might mislead you. This switch is handling
| |
| 704 } | 704 } |
| 705 if (gpu_driver_bugs_.find(gpu::DISABLE_DIRECT_COMPOSITION) != | 705 if (gpu_driver_bugs_.find(gpu::DISABLE_DIRECT_COMPOSITION) != |
| 706 gpu_driver_bugs_.end()) { | 706 gpu_driver_bugs_.end()) { |
| 707 command_line->AppendSwitch(switches::kDisableDirectComposition); | 707 command_line->AppendSwitch(switches::kDisableDirectComposition); |
| 708 } | 708 } |
| 709 if (use_swiftshader_) { | 709 if (use_swiftshader_) { |
| 710 command_line->AppendSwitchASCII(switches::kUseGL, "swiftshader"); | 710 command_line->AppendSwitchASCII(switches::kUseGL, "swiftshader"); |
| 711 } else if ((IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL) || | 711 } else if ((IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL) || |
| 712 IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING) || | 712 IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING) || |
| 713 IsFeatureBlacklisted( | 713 IsFeatureBlacklisted( |
| (...skipping 44 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) && | 768 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_WEBGL2) && gpu_preferences) { |
| 769 !command_line->HasSwitch(switches::kDisableES3APIs)) { | 769 gpu_preferences->enable_unsafe_es3_apis = false; |
| 770 command_line->AppendSwitch(switches::kDisableES3APIs); | |
| 771 } | 770 } |
| 772 | 771 |
| 773 // Pass GPU and driver information to GPU process. We try to avoid full GPU | 772 // Pass GPU and driver information to GPU process. We try to avoid full GPU |
| 774 // info collection at GPU process startup, but we need gpu vendor_id, | 773 // info collection at GPU process startup, but we need gpu vendor_id, |
| 775 // device_id, driver_vendor, driver_version for deciding whether we need to | 774 // device_id, driver_vendor, driver_version for deciding whether we need to |
| 776 // collect full info (on Linux) and for crash reporting purpose. | 775 // collect full info (on Linux) and for crash reporting purpose. |
| 777 command_line->AppendSwitchASCII(switches::kGpuVendorID, | 776 command_line->AppendSwitchASCII(switches::kGpuVendorID, |
| 778 base::StringPrintf("0x%04x", gpu_info_.gpu.vendor_id)); | 777 base::StringPrintf("0x%04x", gpu_info_.gpu.vendor_id)); |
| 779 command_line->AppendSwitchASCII(switches::kGpuDeviceID, | 778 command_line->AppendSwitchASCII(switches::kGpuDeviceID, |
| 780 base::StringPrintf("0x%04x", gpu_info_.gpu.device_id)); | 779 base::StringPrintf("0x%04x", gpu_info_.gpu.device_id)); |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1299 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; | 1298 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; |
| 1300 #if defined(OS_WIN) | 1299 #if defined(OS_WIN) |
| 1301 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; | 1300 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; |
| 1302 #endif | 1301 #endif |
| 1303 complete_gpu_info_already_requested_ = true; | 1302 complete_gpu_info_already_requested_ = true; |
| 1304 // Some observers might be waiting. | 1303 // Some observers might be waiting. |
| 1305 NotifyGpuInfoUpdate(); | 1304 NotifyGpuInfoUpdate(); |
| 1306 } | 1305 } |
| 1307 | 1306 |
| 1308 } // namespace content | 1307 } // namespace content |
| OLD | NEW |