OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CONTENT_BROWSER_GPU_SHADER_CACHE_FACTORY_H_ | 5 #ifndef CONTENT_BROWSER_GPU_SHADER_CACHE_FACTORY_H_ |
6 #define CONTENT_BROWSER_GPU_SHADER_CACHE_FACTORY_H_ | 6 #define CONTENT_BROWSER_GPU_SHADER_CACHE_FACTORY_H_ |
7 | 7 |
| 8 #include "base/single_thread_task_runner.h" |
8 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
9 #include "gpu/ipc/host/shader_disk_cache.h" | 10 #include "gpu/ipc/host/shader_disk_cache.h" |
10 | 11 |
11 namespace content { | 12 namespace content { |
12 | 13 |
13 // Initializes the ShaderCacheFactory singleton instance. The singleton | 14 // Initializes the ShaderCacheFactory singleton instance. The singleton |
14 // instance is created and used in the thread associated with |task_runner|. | 15 // instance is created and used in the thread associated with |task_runner|. |
15 // |cache_task_runner| is associated with the thread responsible for managing | 16 // |cache_task_runner| is associated with the thread responsible for managing |
16 // the disk cache. | 17 // the disk cache. |
17 CONTENT_EXPORT void InitShaderCacheFactorySingleton( | 18 CONTENT_EXPORT void InitShaderCacheFactorySingleton( |
18 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 19 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
19 scoped_refptr<base::SingleThreadTaskRunner> cache_task_runner); | 20 scoped_refptr<base::SingleThreadTaskRunner> cache_task_runner); |
20 | 21 |
21 // Returns an instance previously created by InitShaderCacheFactorySingleton(). | 22 // Returns an instance previously created by InitShaderCacheFactorySingleton(). |
22 // This can return nullptr if an instance has not yet been created. | 23 // This can return nullptr if an instance has not yet been created. |
23 CONTENT_EXPORT gpu::ShaderCacheFactory* GetShaderCacheFactorySingleton(); | 24 CONTENT_EXPORT gpu::ShaderCacheFactory* GetShaderCacheFactorySingleton(); |
24 | 25 |
25 } // namespace content | 26 } // namespace content |
26 | 27 |
27 #endif // CONTENT_BROWSER_GPU_SHADER_CACHE_FACTORY_H_ | 28 #endif // CONTENT_BROWSER_GPU_SHADER_CACHE_FACTORY_H_ |
OLD | NEW |