| 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 "gpu/command_buffer/service/shader_translator_cache.h" | 5 #include "gpu/command_buffer/service/shader_translator_cache.h" |
| 6 | 6 |
| 7 namespace gpu { | 7 namespace gpu { |
| 8 namespace gles2 { | 8 namespace gles2 { |
| 9 | 9 |
| 10 ShaderTranslatorCache* ShaderTranslatorCache::GetInstance() { | |
| 11 return Singleton<ShaderTranslatorCache>::get(); | |
| 12 } | |
| 13 | |
| 14 ShaderTranslatorCache::ShaderTranslatorCache() { | 10 ShaderTranslatorCache::ShaderTranslatorCache() { |
| 15 } | 11 } |
| 16 | 12 |
| 17 ShaderTranslatorCache::~ShaderTranslatorCache() { | 13 ShaderTranslatorCache::~ShaderTranslatorCache() { |
| 18 } | 14 } |
| 19 | 15 |
| 20 void ShaderTranslatorCache::OnDestruct(ShaderTranslator* translator) { | 16 void ShaderTranslatorCache::OnDestruct(ShaderTranslator* translator) { |
| 21 Cache::iterator it = cache_.begin(); | 17 Cache::iterator it = cache_.begin(); |
| 22 while (it != cache_.end()) { | 18 while (it != cache_.end()) { |
| 23 if (it->second == translator) { | 19 if (it->second == translator) { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 52 cache_[params] = translator; | 48 cache_[params] = translator; |
| 53 translator->AddDestructionObserver(this); | 49 translator->AddDestructionObserver(this); |
| 54 return translator; | 50 return translator; |
| 55 } else { | 51 } else { |
| 56 return NULL; | 52 return NULL; |
| 57 } | 53 } |
| 58 } | 54 } |
| 59 | 55 |
| 60 } // namespace gles2 | 56 } // namespace gles2 |
| 61 } // namespace gpu | 57 } // namespace gpu |
| OLD | NEW |