| 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 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1090 } | 1090 } |
| 1091 } | 1091 } |
| 1092 } | 1092 } |
| 1093 | 1093 |
| 1094 std::string GpuProcessHost::GetShaderPrefixKey() { | 1094 std::string GpuProcessHost::GetShaderPrefixKey() { |
| 1095 if (shader_prefix_key_.empty()) { | 1095 if (shader_prefix_key_.empty()) { |
| 1096 gpu::GPUInfo info = GpuDataManagerImpl::GetInstance()->GetGPUInfo(); | 1096 gpu::GPUInfo info = GpuDataManagerImpl::GetInstance()->GetGPUInfo(); |
| 1097 | 1097 |
| 1098 std::string in_str = GetContentClient()->GetProduct() + "-" + | 1098 std::string in_str = GetContentClient()->GetProduct() + "-" + |
| 1099 #if defined(OS_ANDROID) | 1099 #if defined(OS_ANDROID) |
| 1100 base::android::BuildInfo::GetInstance()->android_build_fp() + "-" + | 1100 base::android::BuildInfo::GetInstance()->build_fp() + "-" + |
| 1101 #endif | 1101 #endif |
| 1102 info.gl_vendor + "-" + info.gl_renderer + "-" + | 1102 info.gl_vendor + "-" + info.gl_renderer + "-" + |
| 1103 info.driver_version + "-" + info.driver_vendor; | 1103 info.driver_version + "-" + info.driver_vendor; |
| 1104 | 1104 |
| 1105 base::Base64Encode(base::SHA1HashString(in_str), &shader_prefix_key_); | 1105 base::Base64Encode(base::SHA1HashString(in_str), &shader_prefix_key_); |
| 1106 } | 1106 } |
| 1107 | 1107 |
| 1108 return shader_prefix_key_; | 1108 return shader_prefix_key_; |
| 1109 } | 1109 } |
| 1110 | 1110 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1139 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); | 1139 TRACE_EVENT0("gpu", "GpuProcessHost::OnCacheShader"); |
| 1140 ClientIdToShaderCacheMap::iterator iter = | 1140 ClientIdToShaderCacheMap::iterator iter = |
| 1141 client_id_to_shader_cache_.find(client_id); | 1141 client_id_to_shader_cache_.find(client_id); |
| 1142 // If the cache doesn't exist then this is an off the record profile. | 1142 // If the cache doesn't exist then this is an off the record profile. |
| 1143 if (iter == client_id_to_shader_cache_.end()) | 1143 if (iter == client_id_to_shader_cache_.end()) |
| 1144 return; | 1144 return; |
| 1145 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); | 1145 iter->second->Cache(GetShaderPrefixKey() + ":" + key, shader); |
| 1146 } | 1146 } |
| 1147 | 1147 |
| 1148 } // namespace content | 1148 } // namespace content |
| OLD | NEW |