Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1007)

Unified Diff: content/browser/gpu/gpu_process_host.cc

Issue 1881463002: Set GpuPreferences correctly in GpuDataManagerImplPrivate::AppendGpuCommandLine. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/gpu/gpu_process_host.cc
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index c16a63968238191fc66a1ee016bd165350eb6e6c..1d729db9e325efca71417f97671bbff576133826 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -546,13 +546,14 @@ bool GpuProcessHost::Init() {
if (!SetupMojo())
return false;
+ gpu::GpuPreferences gpu_preferences = GetGpuPreferencesFromCommandLine();
if (in_process_) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(g_gpu_main_thread_factory);
in_process_gpu_thread_.reset(
g_gpu_main_thread_factory(InProcessChildThreadParams(
channel_id, base::MessageLoop::current()->task_runner()),
- GetGpuPreferencesFromCommandLine()));
+ gpu_preferences));
base::Thread::Options options;
#if defined(OS_WIN)
// WGL needs to create its own window and pump messages on it.
@@ -564,11 +565,11 @@ bool GpuProcessHost::Init() {
in_process_gpu_thread_->StartWithOptions(options);
OnProcessLaunched(); // Fake a callback that the process is ready.
- } else if (!LaunchGpuProcess(channel_id)) {
+ } else if (!LaunchGpuProcess(channel_id, &gpu_preferences)) {
return false;
}
- if (!Send(new GpuMsg_Initialize(GetGpuPreferencesFromCommandLine())))
+ if (!Send(new GpuMsg_Initialize(gpu_preferences)))
return false;
return true;
@@ -945,7 +946,8 @@ void GpuProcessHost::StopGpuProcess() {
Send(new GpuMsg_Finalize());
}
-bool GpuProcessHost::LaunchGpuProcess(const std::string& channel_id) {
+bool GpuProcessHost::LaunchGpuProcess(const std::string& channel_id,
+ gpu::GpuPreferences* gpu_preferences) {
if (!(gpu_enabled_ &&
GpuDataManagerImpl::GetInstance()->ShouldUseSwiftShader()) &&
!hardware_gpu_enabled_) {
@@ -1003,8 +1005,8 @@ bool GpuProcessHost::LaunchGpuProcess(const std::string& channel_id) {
GetContentClient()->browser()->AppendExtraCommandLineSwitches(
cmd_line, process_->GetData().id);
- GpuDataManagerImpl::GetInstance()->AppendGpuCommandLine(cmd_line);
-
+ GpuDataManagerImpl::GetInstance()->AppendGpuCommandLine(cmd_line,
+ gpu_preferences);
if (cmd_line->HasSwitch(switches::kUseGL)) {
swiftshader_rendering_ =
(cmd_line->GetSwitchValueASCII(switches::kUseGL) == "swiftshader");
« content/browser/gpu/gpu_data_manager_impl.h ('K') | « content/browser/gpu/gpu_process_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698