| 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 20 matching lines...) Expand all Loading... |
| 31 DCHECK(base::CommandLine::InitializedForCurrentProcess()); | 31 DCHECK(base::CommandLine::InitializedForCurrentProcess()); |
| 32 const base::CommandLine* command_line = | 32 const base::CommandLine* command_line = |
| 33 base::CommandLine::ForCurrentProcess(); | 33 base::CommandLine::ForCurrentProcess(); |
| 34 gpu::GpuPreferences gpu_preferences; | 34 gpu::GpuPreferences gpu_preferences; |
| 35 gpu_preferences.single_process = | 35 gpu_preferences.single_process = |
| 36 command_line->HasSwitch(switches::kSingleProcess); | 36 command_line->HasSwitch(switches::kSingleProcess); |
| 37 gpu_preferences.in_process_gpu = | 37 gpu_preferences.in_process_gpu = |
| 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.enable_gpu_scheduler = |
| 42 command_line->HasSwitch(switches::kEnableGpuScheduler); |
| 41 gpu_preferences.disable_accelerated_video_decode = | 43 gpu_preferences.disable_accelerated_video_decode = |
| 42 command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode); | 44 command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode); |
| 43 #if defined(OS_CHROMEOS) | 45 #if defined(OS_CHROMEOS) |
| 44 gpu_preferences.disable_vaapi_accelerated_video_encode = | 46 gpu_preferences.disable_vaapi_accelerated_video_encode = |
| 45 command_line->HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode); | 47 command_line->HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode); |
| 46 #endif | 48 #endif |
| 47 #if BUILDFLAG(ENABLE_WEBRTC) | 49 #if BUILDFLAG(ENABLE_WEBRTC) |
| 48 gpu_preferences.disable_web_rtc_hw_encoding = | 50 gpu_preferences.disable_web_rtc_hw_encoding = |
| 49 command_line->HasSwitch(switches::kDisableWebRtcHWEncoding) && | 51 command_line->HasSwitch(switches::kDisableWebRtcHWEncoding) && |
| 50 command_line->GetSwitchValueASCII(switches::kDisableWebRtcHWEncoding) | 52 command_line->GetSwitchValueASCII(switches::kDisableWebRtcHWEncoding) |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 gpu_preferences.enable_gpu_service_tracing = | 111 gpu_preferences.enable_gpu_service_tracing = |
| 110 command_line->HasSwitch(switches::kEnableGPUServiceTracing); | 112 command_line->HasSwitch(switches::kEnableGPUServiceTracing); |
| 111 gpu_preferences.use_passthrough_cmd_decoder = | 113 gpu_preferences.use_passthrough_cmd_decoder = |
| 112 command_line->HasSwitch(switches::kUsePassthroughCmdDecoder); | 114 command_line->HasSwitch(switches::kUsePassthroughCmdDecoder); |
| 113 // Some of these preferences are set or adjusted in | 115 // Some of these preferences are set or adjusted in |
| 114 // GpuDataManagerImplPrivate::AppendGpuCommandLine. | 116 // GpuDataManagerImplPrivate::AppendGpuCommandLine. |
| 115 return gpu_preferences; | 117 return gpu_preferences; |
| 116 } | 118 } |
| 117 | 119 |
| 118 } // namespace content | 120 } // namespace content |
| OLD | NEW |