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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 init_start_time_ = base::TimeTicks::Now(); | 571 init_start_time_ = base::TimeTicks::Now(); |
572 | 572 |
573 TRACE_EVENT_INSTANT0("gpu", "LaunchGpuProcess", TRACE_EVENT_SCOPE_THREAD); | 573 TRACE_EVENT_INSTANT0("gpu", "LaunchGpuProcess", TRACE_EVENT_SCOPE_THREAD); |
574 | 574 |
575 std::string channel_id = process_->GetHost()->CreateChannel(); | 575 std::string channel_id = process_->GetHost()->CreateChannel(); |
576 if (channel_id.empty()) | 576 if (channel_id.empty()) |
577 return false; | 577 return false; |
578 | 578 |
579 if (in_process_) { | 579 if (in_process_) { |
580 DCHECK(g_gpu_main_thread_factory); | 580 DCHECK(g_gpu_main_thread_factory); |
581 CommandLine::ForCurrentProcess()->AppendSwitch( | 581 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
582 switches::kDisableGpuWatchdog); | 582 command_line->AppendSwitch(switches::kDisableGpuWatchdog); |
| 583 |
| 584 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); |
| 585 DCHECK(gpu_data_manager); |
| 586 gpu_data_manager->AppendGpuCommandLine(command_line); |
583 | 587 |
584 in_process_gpu_thread_.reset(g_gpu_main_thread_factory(channel_id)); | 588 in_process_gpu_thread_.reset(g_gpu_main_thread_factory(channel_id)); |
585 in_process_gpu_thread_->Start(); | 589 in_process_gpu_thread_->Start(); |
586 | 590 |
587 OnProcessLaunched(); // Fake a callback that the process is ready. | 591 OnProcessLaunched(); // Fake a callback that the process is ready. |
588 } else if (!LaunchGpuProcess(channel_id)) { | 592 } else if (!LaunchGpuProcess(channel_id)) { |
589 return false; | 593 return false; |
590 } | 594 } |
591 | 595 |
592 if (!Send(new GpuMsg_Initialize())) | 596 if (!Send(new GpuMsg_Initialize())) |
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1265 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
1262 ClientIdToShaderCacheMap::iterator iter = | 1266 ClientIdToShaderCacheMap::iterator iter = |
1263 client_id_to_shader_cache_.find(client_id); | 1267 client_id_to_shader_cache_.find(client_id); |
1264 // If the cache doesn't exist then this is an off the record profile. | 1268 // If the cache doesn't exist then this is an off the record profile. |
1265 if (iter == client_id_to_shader_cache_.end()) | 1269 if (iter == client_id_to_shader_cache_.end()) |
1266 return; | 1270 return; |
1267 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1271 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
1268 } | 1272 } |
1269 | 1273 |
1270 } // namespace content | 1274 } // namespace content |
OLD | NEW |