| 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 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 | 556 |
| 557 bool GpuProcessHost::Init() { | 557 bool GpuProcessHost::Init() { |
| 558 init_start_time_ = base::TimeTicks::Now(); | 558 init_start_time_ = base::TimeTicks::Now(); |
| 559 | 559 |
| 560 TRACE_EVENT_INSTANT0("gpu", "LaunchGpuProcess", TRACE_EVENT_SCOPE_THREAD); | 560 TRACE_EVENT_INSTANT0("gpu", "LaunchGpuProcess", TRACE_EVENT_SCOPE_THREAD); |
| 561 | 561 |
| 562 std::string channel_id = process_->GetHost()->CreateChannel(); | 562 std::string channel_id = process_->GetHost()->CreateChannel(); |
| 563 if (channel_id.empty()) | 563 if (channel_id.empty()) |
| 564 return false; | 564 return false; |
| 565 | 565 |
| 566 if (in_process_ && g_gpu_main_thread_factory) { | 566 if (in_process_) { |
| 567 DCHECK(g_gpu_main_thread_factory); |
| 567 CommandLine::ForCurrentProcess()->AppendSwitch( | 568 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 568 switches::kDisableGpuWatchdog); | 569 switches::kDisableGpuWatchdog); |
| 569 | 570 |
| 570 in_process_gpu_thread_.reset(g_gpu_main_thread_factory(channel_id)); | 571 in_process_gpu_thread_.reset(g_gpu_main_thread_factory(channel_id)); |
| 571 in_process_gpu_thread_->Start(); | 572 in_process_gpu_thread_->Start(); |
| 572 | 573 |
| 573 OnProcessLaunched(); // Fake a callback that the process is ready. | 574 OnProcessLaunched(); // Fake a callback that the process is ready. |
| 574 } else if (!LaunchGpuProcess(channel_id)) { | 575 } else if (!LaunchGpuProcess(channel_id)) { |
| 575 return false; | 576 return false; |
| 576 } | 577 } |
| (...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1236 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1237 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
| 1237 ClientIdToShaderCacheMap::iterator iter = | 1238 ClientIdToShaderCacheMap::iterator iter = |
| 1238 client_id_to_shader_cache_.find(client_id); | 1239 client_id_to_shader_cache_.find(client_id); |
| 1239 // If the cache doesn't exist then this is an off the record profile. | 1240 // If the cache doesn't exist then this is an off the record profile. |
| 1240 if (iter == client_id_to_shader_cache_.end()) | 1241 if (iter == client_id_to_shader_cache_.end()) |
| 1241 return; | 1242 return; |
| 1242 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1243 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
| 1243 } | 1244 } |
| 1244 | 1245 |
| 1245 } // namespace content | 1246 } // namespace content |
| OLD | NEW |