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 command_line->HasSwitch(switches::kInProcessGPU); | 38 command_line->HasSwitch(switches::kInProcessGPU); |
39 gpu_preferences.ui_prioritize_in_gpu_process = | 39 gpu_preferences.ui_prioritize_in_gpu_process = |
40 command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess); | 40 command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess); |
41 gpu_preferences.disable_accelerated_video_decode = | 41 gpu_preferences.disable_accelerated_video_decode = |
42 command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode); | 42 command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode); |
43 #if defined(OS_CHROMEOS) | 43 #if defined(OS_CHROMEOS) |
44 gpu_preferences.disable_vaapi_accelerated_video_encode = | 44 gpu_preferences.disable_vaapi_accelerated_video_encode = |
45 command_line->HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode); | 45 command_line->HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode); |
46 #endif | 46 #endif |
47 #if BUILDFLAG(ENABLE_WEBRTC) | 47 #if BUILDFLAG(ENABLE_WEBRTC) |
48 gpu_preferences.disable_web_rtc_hw_encoding = | 48 gpu_preferences.disable_web_rtc_hw_encoding = |
piman
2016/12/07 19:16:33
nit: update the name of this field too, to accurat
braveyao
2016/12/07 20:29:53
It's better to keep it as is. Because either VP8 o
piman
2016/12/07 20:35:33
The logic here is wrong then. If H264 HW encoding
braveyao
2016/12/07 21:34:02
Thanks so much! I neglected that case...
Done.
| |
49 command_line->HasSwitch(switches::kDisableWebRtcHWEncoding) && | 49 command_line->HasSwitch(switches::kDisableWebRtcHWVP8Encoding); |
50 command_line->GetSwitchValueASCII(switches::kDisableWebRtcHWEncoding) | |
51 .empty(); | |
52 #endif | 50 #endif |
53 #if defined(OS_WIN) | 51 #if defined(OS_WIN) |
54 uint32_t enable_accelerated_vpx_decode_val = | 52 uint32_t enable_accelerated_vpx_decode_val = |
55 gpu::GpuPreferences::VPX_VENDOR_MICROSOFT; | 53 gpu::GpuPreferences::VPX_VENDOR_MICROSOFT; |
56 if (GetUintFromSwitch(command_line, switches::kEnableAcceleratedVpxDecode, | 54 if (GetUintFromSwitch(command_line, switches::kEnableAcceleratedVpxDecode, |
57 &enable_accelerated_vpx_decode_val)) { | 55 &enable_accelerated_vpx_decode_val)) { |
58 gpu_preferences.enable_accelerated_vpx_decode = | 56 gpu_preferences.enable_accelerated_vpx_decode = |
59 static_cast<gpu::GpuPreferences::VpxDecodeVendors>( | 57 static_cast<gpu::GpuPreferences::VpxDecodeVendors>( |
60 enable_accelerated_vpx_decode_val); | 58 enable_accelerated_vpx_decode_val); |
61 } | 59 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
109 gpu_preferences.enable_gpu_service_tracing = | 107 gpu_preferences.enable_gpu_service_tracing = |
110 command_line->HasSwitch(switches::kEnableGPUServiceTracing); | 108 command_line->HasSwitch(switches::kEnableGPUServiceTracing); |
111 gpu_preferences.use_passthrough_cmd_decoder = | 109 gpu_preferences.use_passthrough_cmd_decoder = |
112 command_line->HasSwitch(switches::kUsePassthroughCmdDecoder); | 110 command_line->HasSwitch(switches::kUsePassthroughCmdDecoder); |
113 // Some of these preferences are set or adjusted in | 111 // Some of these preferences are set or adjusted in |
114 // GpuDataManagerImplPrivate::AppendGpuCommandLine. | 112 // GpuDataManagerImplPrivate::AppendGpuCommandLine. |
115 return gpu_preferences; | 113 return gpu_preferences; |
116 } | 114 } |
117 | 115 |
118 } // namespace content | 116 } // namespace content |
OLD | NEW |