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); | |
61 gpu_preferences.disable_accelerated_video_decode = | 58 gpu_preferences.disable_accelerated_video_decode = |
62 command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode); | 59 command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode); |
63 #if defined(OS_CHROMEOS) | 60 #if defined(OS_CHROMEOS) |
64 gpu_preferences.disable_vaapi_accelerated_video_encode = | 61 gpu_preferences.disable_vaapi_accelerated_video_encode = |
65 command_line->HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode); | 62 command_line->HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode); |
66 #endif | 63 #endif |
67 #if BUILDFLAG(ENABLE_WEBRTC) | 64 #if BUILDFLAG(ENABLE_WEBRTC) |
68 gpu_preferences.disable_web_rtc_hw_encoding = | 65 gpu_preferences.disable_web_rtc_hw_encoding = |
69 command_line->HasSwitch(switches::kDisableWebRtcHWEncoding); | 66 command_line->HasSwitch(switches::kDisableWebRtcHWEncoding); |
70 #endif | 67 #endif |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 void StopGpuProcess(const base::Closure& callback) { | 133 void StopGpuProcess(const base::Closure& callback) { |
137 content::GpuProcessHost::CallOnIO( | 134 content::GpuProcessHost::CallOnIO( |
138 content::GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, | 135 content::GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, |
139 false /* force_create */, | 136 false /* force_create */, |
140 base::Bind(&StopGpuProcessImpl, | 137 base::Bind(&StopGpuProcessImpl, |
141 base::Bind(RunTaskOnTaskRunner, | 138 base::Bind(RunTaskOnTaskRunner, |
142 base::ThreadTaskRunnerHandle::Get(), callback))); | 139 base::ThreadTaskRunnerHandle::Get(), callback))); |
143 } | 140 } |
144 | 141 |
145 } // namespace content | 142 } // namespace content |
OLD | NEW |