OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/gpu/gpu_process_host.h" | 5 #include "content/browser/gpu/gpu_process_host.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/base_switches.h" | 8 #include "base/base_switches.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
505 if (in_process_) { | 505 if (in_process_) { |
506 DCHECK(g_gpu_main_thread_factory); | 506 DCHECK(g_gpu_main_thread_factory); |
507 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 507 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
508 command_line->AppendSwitch(switches::kDisableGpuWatchdog); | 508 command_line->AppendSwitch(switches::kDisableGpuWatchdog); |
509 | 509 |
510 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); | 510 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); |
511 DCHECK(gpu_data_manager); | 511 DCHECK(gpu_data_manager); |
512 gpu_data_manager->AppendGpuCommandLine(command_line); | 512 gpu_data_manager->AppendGpuCommandLine(command_line); |
513 | 513 |
514 in_process_gpu_thread_.reset(g_gpu_main_thread_factory(channel_id)); | 514 in_process_gpu_thread_.reset(g_gpu_main_thread_factory(channel_id)); |
515 in_process_gpu_thread_->Start(); | 515 base::Thread::Options options; |
516 #if defined(OS_WIN) | |
517 // WGL needs to create its own window and pump messages on it. | |
518 options.message_loop_type = base::MessageLoop::TYPE_UI; | |
Ken Russell (switch to Gerrit)
2014/10/11 03:04:32
Is there any benefit to checking if --use-gl=deskt
| |
519 #endif | |
520 in_process_gpu_thread_->StartWithOptions(options); | |
516 | 521 |
517 OnProcessLaunched(); // Fake a callback that the process is ready. | 522 OnProcessLaunched(); // Fake a callback that the process is ready. |
518 } else if (!LaunchGpuProcess(channel_id)) { | 523 } else if (!LaunchGpuProcess(channel_id)) { |
519 return false; | 524 return false; |
520 } | 525 } |
521 | 526 |
522 if (!Send(new GpuMsg_Initialize())) | 527 if (!Send(new GpuMsg_Initialize())) |
523 return false; | 528 return false; |
524 | 529 |
525 return true; | 530 return true; |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1058 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1063 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
1059 ClientIdToShaderCacheMap::iterator iter = | 1064 ClientIdToShaderCacheMap::iterator iter = |
1060 client_id_to_shader_cache_.find(client_id); | 1065 client_id_to_shader_cache_.find(client_id); |
1061 // If the cache doesn't exist then this is an off the record profile. | 1066 // If the cache doesn't exist then this is an off the record profile. |
1062 if (iter == client_id_to_shader_cache_.end()) | 1067 if (iter == client_id_to_shader_cache_.end()) |
1063 return; | 1068 return; |
1064 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1069 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
1065 } | 1070 } |
1066 | 1071 |
1067 } // namespace content | 1072 } // namespace content |
OLD | NEW |