Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(497)

Side by Side Diff: content/browser/gpu/shader_cache_factory.cc

Issue 2555693005: gpu: Move ShaderDiskCache into //gpu/ipc/host component. (Closed)
Patch Set: tot merge Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/gpu/shader_cache_factory.h ('k') | content/browser/gpu/shader_disk_cache.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "content/browser/gpu/shader_cache_factory.h" 5 #include "content/browser/gpu/shader_cache_factory.h"
6 6
7 #include "base/single_thread_task_runner.h" 7 #include "base/single_thread_task_runner.h"
8 #include "content/browser/gpu/shader_disk_cache.h" 8 #include "gpu/ipc/host/shader_disk_cache.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 namespace { 12 namespace {
13 13
14 ShaderCacheFactory* factory_instance = nullptr; 14 gpu::ShaderCacheFactory* factory_instance = nullptr;
15 15
16 void CreateFactoryInstance( 16 void CreateFactoryInstance(
17 scoped_refptr<base::SingleThreadTaskRunner> cache_task_runner) { 17 scoped_refptr<base::SingleThreadTaskRunner> cache_task_runner) {
18 DCHECK(!factory_instance); 18 DCHECK(!factory_instance);
19 factory_instance = new ShaderCacheFactory(std::move(cache_task_runner)); 19 factory_instance = new gpu::ShaderCacheFactory(std::move(cache_task_runner));
20 } 20 }
21 21
22 } // namespace 22 } // namespace
23 23
24 void InitShaderCacheFactorySingleton( 24 void InitShaderCacheFactorySingleton(
25 scoped_refptr<base::SingleThreadTaskRunner> task_runner, 25 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
26 scoped_refptr<base::SingleThreadTaskRunner> cache_task_runner) { 26 scoped_refptr<base::SingleThreadTaskRunner> cache_task_runner) {
27 if (task_runner->BelongsToCurrentThread()) { 27 if (task_runner->BelongsToCurrentThread()) {
28 CreateFactoryInstance(std::move(cache_task_runner)); 28 CreateFactoryInstance(std::move(cache_task_runner));
29 } else { 29 } else {
30 task_runner->PostTask(FROM_HERE, base::Bind(&CreateFactoryInstance, 30 task_runner->PostTask(FROM_HERE, base::Bind(&CreateFactoryInstance,
31 std::move(cache_task_runner))); 31 std::move(cache_task_runner)));
32 } 32 }
33 } 33 }
34 34
35 ShaderCacheFactory* GetShaderCacheFactorySingleton() { 35 gpu::ShaderCacheFactory* GetShaderCacheFactorySingleton() {
36 DCHECK(!factory_instance || factory_instance->CalledOnValidThread()); 36 DCHECK(!factory_instance || factory_instance->CalledOnValidThread());
37 return factory_instance; 37 return factory_instance;
38 } 38 }
39 39
40 } // namespace content 40 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/shader_cache_factory.h ('k') | content/browser/gpu/shader_disk_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698