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