| 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 |
| 40 gpu_preferences.compile_shader_always_succeeds = | 54 gpu_preferences.compile_shader_always_succeeds = |
| 41 command_line->HasSwitch(switches::kCompileShaderAlwaysSucceeds); | 55 command_line->HasSwitch(switches::kCompileShaderAlwaysSucceeds); |
| 42 gpu_preferences.disable_gl_error_limit = | 56 gpu_preferences.disable_gl_error_limit = |
| 43 command_line->HasSwitch(switches::kDisableGLErrorLimit); | 57 command_line->HasSwitch(switches::kDisableGLErrorLimit); |
| 44 gpu_preferences.disable_glsl_translator = | 58 gpu_preferences.disable_glsl_translator = |
| 45 command_line->HasSwitch(switches::kDisableGLSLTranslator); | 59 command_line->HasSwitch(switches::kDisableGLSLTranslator); |
| 46 gpu_preferences.disable_gpu_driver_bug_workarounds = | 60 gpu_preferences.disable_gpu_driver_bug_workarounds = |
| 47 command_line->HasSwitch(switches::kDisableGpuDriverBugWorkarounds); | 61 command_line->HasSwitch(switches::kDisableGpuDriverBugWorkarounds); |
| 48 gpu_preferences.disable_shader_name_hashing = | 62 gpu_preferences.disable_shader_name_hashing = |
| 49 command_line->HasSwitch(switches::kDisableShaderNameHashing); | 63 command_line->HasSwitch(switches::kDisableShaderNameHashing); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 80 gpu_preferences.enable_gpu_service_logging = | 94 gpu_preferences.enable_gpu_service_logging = |
| 81 command_line->HasSwitch(switches::kEnableGPUServiceLogging); | 95 command_line->HasSwitch(switches::kEnableGPUServiceLogging); |
| 82 gpu_preferences.enable_gpu_service_tracing = | 96 gpu_preferences.enable_gpu_service_tracing = |
| 83 command_line->HasSwitch(switches::kEnableGPUServiceTracing); | 97 command_line->HasSwitch(switches::kEnableGPUServiceTracing); |
| 84 gpu_preferences.enable_unsafe_es3_apis = | 98 gpu_preferences.enable_unsafe_es3_apis = |
| 85 command_line->HasSwitch(switches::kEnableUnsafeES3APIs); | 99 command_line->HasSwitch(switches::kEnableUnsafeES3APIs); |
| 86 return gpu_preferences; | 100 return gpu_preferences; |
| 87 } | 101 } |
| 88 | 102 |
| 89 } // namespace content | 103 } // namespace content |
| OLD | NEW |