| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/public/browser/gpu_utils.h" | 5 #include "content/public/browser/gpu_utils.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "content/public/common/content_switches.h" | 9 #include "content/public/common/content_switches.h" |
| 10 #include "gpu/command_buffer/service/gpu_switches.h" | 10 #include "gpu/command_buffer/service/gpu_switches.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 gpu_preferences.ui_prioritize_in_gpu_process = | 38 gpu_preferences.ui_prioritize_in_gpu_process = |
| 39 command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess); | 39 command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess); |
| 40 gpu_preferences.disable_accelerated_video_decode = | 40 gpu_preferences.disable_accelerated_video_decode = |
| 41 command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode); | 41 command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode); |
| 42 #if defined(OS_CHROMEOS) | 42 #if defined(OS_CHROMEOS) |
| 43 gpu_preferences.disable_vaapi_accelerated_video_encode = | 43 gpu_preferences.disable_vaapi_accelerated_video_encode = |
| 44 command_line->HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode); | 44 command_line->HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode); |
| 45 #endif | 45 #endif |
| 46 #if defined(ENABLE_WEBRTC) | 46 #if defined(ENABLE_WEBRTC) |
| 47 gpu_preferences.disable_web_rtc_hw_encoding = | 47 gpu_preferences.disable_web_rtc_hw_encoding = |
| 48 command_line->HasSwitch(switches::kDisableWebRtcHWEncoding); | 48 command_line->HasSwitch(switches::kDisableWebRtcHWEncoding) && |
| 49 command_line->GetSwitchValueASCII(switches::kDisableWebRtcHWEncoding) |
| 50 .empty(); |
| 49 #endif | 51 #endif |
| 50 #if defined(OS_WIN) | 52 #if defined(OS_WIN) |
| 51 uint32_t enable_accelerated_vpx_decode_val = | 53 uint32_t enable_accelerated_vpx_decode_val = |
| 52 gpu::GpuPreferences::VPX_VENDOR_MICROSOFT; | 54 gpu::GpuPreferences::VPX_VENDOR_MICROSOFT; |
| 53 if (GetUintFromSwitch(command_line, switches::kEnableAcceleratedVpxDecode, | 55 if (GetUintFromSwitch(command_line, switches::kEnableAcceleratedVpxDecode, |
| 54 &enable_accelerated_vpx_decode_val)) { | 56 &enable_accelerated_vpx_decode_val)) { |
| 55 gpu_preferences.enable_accelerated_vpx_decode = | 57 gpu_preferences.enable_accelerated_vpx_decode = |
| 56 static_cast<gpu::GpuPreferences::VpxDecodeVendors>( | 58 static_cast<gpu::GpuPreferences::VpxDecodeVendors>( |
| 57 enable_accelerated_vpx_decode_val); | 59 enable_accelerated_vpx_decode_val); |
| 58 } | 60 } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 gpu_preferences.enable_gpu_service_tracing = | 106 gpu_preferences.enable_gpu_service_tracing = |
| 105 command_line->HasSwitch(switches::kEnableGPUServiceTracing); | 107 command_line->HasSwitch(switches::kEnableGPUServiceTracing); |
| 106 gpu_preferences.enable_unsafe_es3_apis = | 108 gpu_preferences.enable_unsafe_es3_apis = |
| 107 command_line->HasSwitch(switches::kEnableUnsafeES3APIs); | 109 command_line->HasSwitch(switches::kEnableUnsafeES3APIs); |
| 108 gpu_preferences.use_passthrough_cmd_decoder = | 110 gpu_preferences.use_passthrough_cmd_decoder = |
| 109 command_line->HasSwitch(switches::kUsePassthroughCmdDecoder); | 111 command_line->HasSwitch(switches::kUsePassthroughCmdDecoder); |
| 110 return gpu_preferences; | 112 return gpu_preferences; |
| 111 } | 113 } |
| 112 | 114 |
| 113 } // namespace content | 115 } // namespace content |
| OLD | NEW |