| 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/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "content/browser/gpu/gpu_process_host.h" | 10 #include "content/browser/gpu/gpu_process_host.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 DCHECK(base::CommandLine::InitializedForCurrentProcess()); | 48 DCHECK(base::CommandLine::InitializedForCurrentProcess()); |
| 49 const base::CommandLine* command_line = | 49 const base::CommandLine* command_line = |
| 50 base::CommandLine::ForCurrentProcess(); | 50 base::CommandLine::ForCurrentProcess(); |
| 51 gpu::GpuPreferences gpu_preferences; | 51 gpu::GpuPreferences gpu_preferences; |
| 52 gpu_preferences.single_process = | 52 gpu_preferences.single_process = |
| 53 command_line->HasSwitch(switches::kSingleProcess); | 53 command_line->HasSwitch(switches::kSingleProcess); |
| 54 gpu_preferences.in_process_gpu = | 54 gpu_preferences.in_process_gpu = |
| 55 command_line->HasSwitch(switches::kInProcessGPU); | 55 command_line->HasSwitch(switches::kInProcessGPU); |
| 56 gpu_preferences.ui_prioritize_in_gpu_process = | 56 gpu_preferences.ui_prioritize_in_gpu_process = |
| 57 command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess); | 57 command_line->HasSwitch(switches::kUIPrioritizeInGpuProcess); |
| 58 gpu_preferences.enable_gpu_scheduler = |
| 59 command_line->HasSwitch(switches::kEnableGpuScheduler) && |
| 60 !command_line->HasSwitch(switches::kDisableGpuScheduler); |
| 58 gpu_preferences.disable_accelerated_video_decode = | 61 gpu_preferences.disable_accelerated_video_decode = |
| 59 command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode); | 62 command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode); |
| 60 #if defined(OS_CHROMEOS) | 63 #if defined(OS_CHROMEOS) |
| 61 gpu_preferences.disable_vaapi_accelerated_video_encode = | 64 gpu_preferences.disable_vaapi_accelerated_video_encode = |
| 62 command_line->HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode); | 65 command_line->HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode); |
| 63 #endif | 66 #endif |
| 64 #if BUILDFLAG(ENABLE_WEBRTC) | 67 #if BUILDFLAG(ENABLE_WEBRTC) |
| 65 gpu_preferences.disable_web_rtc_hw_encoding = | 68 gpu_preferences.disable_web_rtc_hw_encoding = |
| 66 command_line->HasSwitch(switches::kDisableWebRtcHWEncoding); | 69 command_line->HasSwitch(switches::kDisableWebRtcHWEncoding); |
| 67 #endif | 70 #endif |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 void StopGpuProcess(const base::Closure& callback) { | 136 void StopGpuProcess(const base::Closure& callback) { |
| 134 content::GpuProcessHost::CallOnIO( | 137 content::GpuProcessHost::CallOnIO( |
| 135 content::GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, | 138 content::GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, |
| 136 false /* force_create */, | 139 false /* force_create */, |
| 137 base::Bind(&StopGpuProcessImpl, | 140 base::Bind(&StopGpuProcessImpl, |
| 138 base::Bind(RunTaskOnTaskRunner, | 141 base::Bind(RunTaskOnTaskRunner, |
| 139 base::ThreadTaskRunnerHandle::Get(), callback))); | 142 base::ThreadTaskRunnerHandle::Get(), callback))); |
| 140 } | 143 } |
| 141 | 144 |
| 142 } // namespace content | 145 } // namespace content |
| OLD | NEW |