| 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 19 matching lines...) Expand all Loading... |
| 30 DCHECK(base::CommandLine::InitializedForCurrentProcess()); | 30 DCHECK(base::CommandLine::InitializedForCurrentProcess()); |
| 31 const base::CommandLine* command_line = | 31 const base::CommandLine* command_line = |
| 32 base::CommandLine::ForCurrentProcess(); | 32 base::CommandLine::ForCurrentProcess(); |
| 33 gpu::GpuPreferences gpu_preferences; | 33 gpu::GpuPreferences gpu_preferences; |
| 34 gpu_preferences.single_process = | 34 gpu_preferences.single_process = |
| 35 command_line->HasSwitch(switches::kSingleProcess); | 35 command_line->HasSwitch(switches::kSingleProcess); |
| 36 gpu_preferences.in_process_gpu = | 36 gpu_preferences.in_process_gpu = |
| 37 command_line->HasSwitch(switches::kInProcessGPU); | 37 command_line->HasSwitch(switches::kInProcessGPU); |
| 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 = | |
| 41 command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode); | |
| 42 #if defined(OS_CHROMEOS) | |
| 43 gpu_preferences.disable_vaapi_accelerated_video_encode = | |
| 44 command_line->HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode); | |
| 45 #endif | |
| 46 #if defined(ENABLE_WEBRTC) | |
| 47 gpu_preferences.disable_web_rtc_hw_encoding = | |
| 48 command_line->HasSwitch(switches::kDisableWebRtcHWEncoding); | |
| 49 #endif | |
| 50 #if defined(OS_WIN) | |
| 51 gpu_preferences.enable_accelerated_vpx_decode = | |
| 52 command_line->HasSwitch(switches::kEnableAcceleratedVpxDecode); | |
| 53 #endif | |
| 54 gpu_preferences.compile_shader_always_succeeds = | 40 gpu_preferences.compile_shader_always_succeeds = |
| 55 command_line->HasSwitch(switches::kCompileShaderAlwaysSucceeds); | 41 command_line->HasSwitch(switches::kCompileShaderAlwaysSucceeds); |
| 56 gpu_preferences.disable_gl_error_limit = | 42 gpu_preferences.disable_gl_error_limit = |
| 57 command_line->HasSwitch(switches::kDisableGLErrorLimit); | 43 command_line->HasSwitch(switches::kDisableGLErrorLimit); |
| 58 gpu_preferences.disable_glsl_translator = | 44 gpu_preferences.disable_glsl_translator = |
| 59 command_line->HasSwitch(switches::kDisableGLSLTranslator); | 45 command_line->HasSwitch(switches::kDisableGLSLTranslator); |
| 60 gpu_preferences.disable_gpu_driver_bug_workarounds = | 46 gpu_preferences.disable_gpu_driver_bug_workarounds = |
| 61 command_line->HasSwitch(switches::kDisableGpuDriverBugWorkarounds); | 47 command_line->HasSwitch(switches::kDisableGpuDriverBugWorkarounds); |
| 62 gpu_preferences.disable_shader_name_hashing = | 48 gpu_preferences.disable_shader_name_hashing = |
| 63 command_line->HasSwitch(switches::kDisableShaderNameHashing); | 49 command_line->HasSwitch(switches::kDisableShaderNameHashing); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 94 gpu_preferences.enable_gpu_service_logging = | 80 gpu_preferences.enable_gpu_service_logging = |
| 95 command_line->HasSwitch(switches::kEnableGPUServiceLogging); | 81 command_line->HasSwitch(switches::kEnableGPUServiceLogging); |
| 96 gpu_preferences.enable_gpu_service_tracing = | 82 gpu_preferences.enable_gpu_service_tracing = |
| 97 command_line->HasSwitch(switches::kEnableGPUServiceTracing); | 83 command_line->HasSwitch(switches::kEnableGPUServiceTracing); |
| 98 gpu_preferences.enable_unsafe_es3_apis = | 84 gpu_preferences.enable_unsafe_es3_apis = |
| 99 command_line->HasSwitch(switches::kEnableUnsafeES3APIs); | 85 command_line->HasSwitch(switches::kEnableUnsafeES3APIs); |
| 100 return gpu_preferences; | 86 return gpu_preferences; |
| 101 } | 87 } |
| 102 | 88 |
| 103 } // namespace content | 89 } // namespace content |
| OLD | NEW |