| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <list> | 10 #include <list> |
| (...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 957 | 957 |
| 958 void GpuProcessHost::ForceShutdown() { | 958 void GpuProcessHost::ForceShutdown() { |
| 959 // This is only called on the IO thread so no race against the constructor | 959 // This is only called on the IO thread so no race against the constructor |
| 960 // for another GpuProcessHost. | 960 // for another GpuProcessHost. |
| 961 if (g_gpu_process_hosts[kind_] == this) | 961 if (g_gpu_process_hosts[kind_] == this) |
| 962 g_gpu_process_hosts[kind_] = NULL; | 962 g_gpu_process_hosts[kind_] = NULL; |
| 963 | 963 |
| 964 process_->ForceShutdown(); | 964 process_->ForceShutdown(); |
| 965 } | 965 } |
| 966 | 966 |
| 967 void GpuProcessHost::StopGpuProcess() { | |
| 968 Send(new GpuMsg_Finalize()); | |
| 969 } | |
| 970 | |
| 971 bool GpuProcessHost::LaunchGpuProcess(gpu::GpuPreferences* gpu_preferences) { | 967 bool GpuProcessHost::LaunchGpuProcess(gpu::GpuPreferences* gpu_preferences) { |
| 972 if (!(gpu_enabled_ && | 968 if (!(gpu_enabled_ && |
| 973 GpuDataManagerImpl::GetInstance()->ShouldUseSwiftShader()) && | 969 GpuDataManagerImpl::GetInstance()->ShouldUseSwiftShader()) && |
| 974 !hardware_gpu_enabled_) { | 970 !hardware_gpu_enabled_) { |
| 975 SendOutstandingReplies(); | 971 SendOutstandingReplies(); |
| 976 return false; | 972 return false; |
| 977 } | 973 } |
| 978 | 974 |
| 979 const base::CommandLine& browser_command_line = | 975 const base::CommandLine& browser_command_line = |
| 980 *base::CommandLine::ForCurrentProcess(); | 976 *base::CommandLine::ForCurrentProcess(); |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1189 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1185 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
| 1190 ClientIdToShaderCacheMap::iterator iter = | 1186 ClientIdToShaderCacheMap::iterator iter = |
| 1191 client_id_to_shader_cache_.find(client_id); | 1187 client_id_to_shader_cache_.find(client_id); |
| 1192 // If the cache doesn't exist then this is an off the record profile. | 1188 // If the cache doesn't exist then this is an off the record profile. |
| 1193 if (iter == client_id_to_shader_cache_.end()) | 1189 if (iter == client_id_to_shader_cache_.end()) |
| 1194 return; | 1190 return; |
| 1195 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1191 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
| 1196 } | 1192 } |
| 1197 | 1193 |
| 1198 } // namespace content | 1194 } // namespace content |
| OLD | NEW |