| 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 #ifndef GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_CACHE_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_CACHE_H_ |
| 6 #define GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_CACHE_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_CACHE_H_ |
| 7 | 7 |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // | 22 // |
| 23 // TODO(backer): Investigate using glReleaseShaderCompiler as an alternative to | 23 // TODO(backer): Investigate using glReleaseShaderCompiler as an alternative to |
| 24 // to this cache. | 24 // to this cache. |
| 25 class GPU_EXPORT ShaderTranslatorCache | 25 class GPU_EXPORT ShaderTranslatorCache |
| 26 : public base::RefCounted<ShaderTranslatorCache>, | 26 : public base::RefCounted<ShaderTranslatorCache>, |
| 27 public NON_EXPORTED_BASE(ShaderTranslator::DestructionObserver) { | 27 public NON_EXPORTED_BASE(ShaderTranslator::DestructionObserver) { |
| 28 public: | 28 public: |
| 29 ShaderTranslatorCache(); | 29 ShaderTranslatorCache(); |
| 30 | 30 |
| 31 // ShaderTranslator::DestructionObserver implementation | 31 // ShaderTranslator::DestructionObserver implementation |
| 32 virtual void OnDestruct(ShaderTranslator* translator) OVERRIDE; | 32 virtual void OnDestruct(ShaderTranslator* translator) override; |
| 33 | 33 |
| 34 scoped_refptr<ShaderTranslator> GetTranslator( | 34 scoped_refptr<ShaderTranslator> GetTranslator( |
| 35 sh::GLenum shader_type, | 35 sh::GLenum shader_type, |
| 36 ShShaderSpec shader_spec, | 36 ShShaderSpec shader_spec, |
| 37 const ShBuiltInResources* resources, | 37 const ShBuiltInResources* resources, |
| 38 ShaderTranslatorInterface::GlslImplementationType | 38 ShaderTranslatorInterface::GlslImplementationType |
| 39 glsl_implementation_type, | 39 glsl_implementation_type, |
| 40 ShCompileOptions driver_bug_workarounds); | 40 ShCompileOptions driver_bug_workarounds); |
| 41 | 41 |
| 42 private: | 42 private: |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 typedef std::map<ShaderTranslatorInitParams, ShaderTranslator* > Cache; | 82 typedef std::map<ShaderTranslatorInitParams, ShaderTranslator* > Cache; |
| 83 Cache cache_; | 83 Cache cache_; |
| 84 | 84 |
| 85 DISALLOW_COPY_AND_ASSIGN(ShaderTranslatorCache); | 85 DISALLOW_COPY_AND_ASSIGN(ShaderTranslatorCache); |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 } // namespace gles2 | 88 } // namespace gles2 |
| 89 } // namespace gpu | 89 } // namespace gpu |
| 90 | 90 |
| 91 #endif // GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_CACHE_H_ | 91 #endif // GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_CACHE_H_ |
| OLD | NEW |