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 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1234 | 1234 |
1235 void GpuProcessHost::LoadedShader(const std::string& key, | 1235 void GpuProcessHost::LoadedShader(const std::string& key, |
1236 const std::string& data) { | 1236 const std::string& data) { |
1237 std::string prefix = GetShaderPrefixKey(data); | 1237 std::string prefix = GetShaderPrefixKey(data); |
1238 bool prefix_ok = !key.compare(0, prefix.length(), prefix); | 1238 bool prefix_ok = !key.compare(0, prefix.length(), prefix); |
1239 UMA_HISTOGRAM_BOOLEAN("GPU.ShaderLoadPrefixOK", prefix_ok); | 1239 UMA_HISTOGRAM_BOOLEAN("GPU.ShaderLoadPrefixOK", prefix_ok); |
1240 if (prefix_ok) | 1240 if (prefix_ok) |
1241 gpu_service_ptr_->LoadedShader(data); | 1241 gpu_service_ptr_->LoadedShader(data); |
1242 } | 1242 } |
1243 | 1243 |
| 1244 ui::mojom::GpuService* GpuProcessHost::gpu_service() { |
| 1245 DCHECK(gpu_service_ptr_.is_bound()); |
| 1246 return gpu_service_ptr_.get(); |
| 1247 } |
| 1248 |
1244 void GpuProcessHost::CreateChannelCache(int32_t client_id) { | 1249 void GpuProcessHost::CreateChannelCache(int32_t client_id) { |
1245 TRACE_EVENT0("gpu", "GpuProcessHost::CreateChannelCache"); | 1250 TRACE_EVENT0("gpu", "GpuProcessHost::CreateChannelCache"); |
1246 | 1251 |
1247 scoped_refptr<gpu::ShaderDiskCache> cache = | 1252 scoped_refptr<gpu::ShaderDiskCache> cache = |
1248 GetShaderCacheFactorySingleton()->Get(client_id); | 1253 GetShaderCacheFactorySingleton()->Get(client_id); |
1249 if (!cache.get()) | 1254 if (!cache.get()) |
1250 return; | 1255 return; |
1251 | 1256 |
1252 cache->set_shader_loaded_callback(base::Bind(&HostLoadedShader, host_id_)); | 1257 cache->set_shader_loaded_callback(base::Bind(&HostLoadedShader, host_id_)); |
1253 | 1258 |
1254 client_id_to_shader_cache_[client_id] = cache; | 1259 client_id_to_shader_cache_[client_id] = cache; |
1255 } | 1260 } |
1256 | 1261 |
1257 } // namespace content | 1262 } // namespace content |
OLD | NEW |