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_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // was successful or not. | 82 // was successful or not. |
83 virtual const char* translated_shader() const = 0; | 83 virtual const char* translated_shader() const = 0; |
84 virtual const char* info_log() const = 0; | 84 virtual const char* info_log() const = 0; |
85 | 85 |
86 virtual const VariableMap& attrib_map() const = 0; | 86 virtual const VariableMap& attrib_map() const = 0; |
87 virtual const VariableMap& uniform_map() const = 0; | 87 virtual const VariableMap& uniform_map() const = 0; |
88 virtual const VariableMap& varying_map() const = 0; | 88 virtual const VariableMap& varying_map() const = 0; |
89 virtual const NameMap& name_map() const = 0; | 89 virtual const NameMap& name_map() const = 0; |
90 | 90 |
91 // Return a string that is unique for a specfic set of options that would | 91 // Return a string that is unique for a specfic set of options that would |
92 // possibly effect compilation. | 92 // possibly affect compilation. |
93 virtual std::string GetStringForOptionsThatWouldEffectCompilation() const = 0; | 93 virtual std::string GetStringForOptionsThatWouldAffectCompilation() const = 0; |
94 | 94 |
95 protected: | 95 protected: |
96 virtual ~ShaderTranslatorInterface() {} | 96 virtual ~ShaderTranslatorInterface() {} |
97 }; | 97 }; |
98 | 98 |
99 // Implementation of ShaderTranslatorInterface | 99 // Implementation of ShaderTranslatorInterface |
100 class GPU_EXPORT ShaderTranslator | 100 class GPU_EXPORT ShaderTranslator |
101 : public base::RefCounted<ShaderTranslator>, | 101 : public base::RefCounted<ShaderTranslator>, |
102 NON_EXPORTED_BASE(public ShaderTranslatorInterface) { | 102 NON_EXPORTED_BASE(public ShaderTranslatorInterface) { |
103 public: | 103 public: |
(...skipping 24 matching lines...) Expand all Loading... |
128 // Overridden from ShaderTranslatorInterface. | 128 // Overridden from ShaderTranslatorInterface. |
129 virtual const char* translated_shader() const OVERRIDE; | 129 virtual const char* translated_shader() const OVERRIDE; |
130 virtual const char* info_log() const OVERRIDE; | 130 virtual const char* info_log() const OVERRIDE; |
131 | 131 |
132 // Overridden from ShaderTranslatorInterface. | 132 // Overridden from ShaderTranslatorInterface. |
133 virtual const VariableMap& attrib_map() const OVERRIDE; | 133 virtual const VariableMap& attrib_map() const OVERRIDE; |
134 virtual const VariableMap& uniform_map() const OVERRIDE; | 134 virtual const VariableMap& uniform_map() const OVERRIDE; |
135 virtual const VariableMap& varying_map() const OVERRIDE; | 135 virtual const VariableMap& varying_map() const OVERRIDE; |
136 virtual const NameMap& name_map() const OVERRIDE; | 136 virtual const NameMap& name_map() const OVERRIDE; |
137 | 137 |
138 virtual std::string GetStringForOptionsThatWouldEffectCompilation() const | 138 virtual std::string GetStringForOptionsThatWouldAffectCompilation() const |
139 OVERRIDE; | 139 OVERRIDE; |
140 | 140 |
141 void AddDestructionObserver(DestructionObserver* observer); | 141 void AddDestructionObserver(DestructionObserver* observer); |
142 void RemoveDestructionObserver(DestructionObserver* observer); | 142 void RemoveDestructionObserver(DestructionObserver* observer); |
143 | 143 |
144 private: | 144 private: |
145 friend class base::RefCounted<ShaderTranslator>; | 145 friend class base::RefCounted<ShaderTranslator>; |
146 | 146 |
147 virtual ~ShaderTranslator(); | 147 virtual ~ShaderTranslator(); |
148 void ClearResults(); | 148 void ClearResults(); |
(...skipping 12 matching lines...) Expand all Loading... |
161 ObserverList<DestructionObserver> destruction_observers_; | 161 ObserverList<DestructionObserver> destruction_observers_; |
162 | 162 |
163 DISALLOW_COPY_AND_ASSIGN(ShaderTranslator); | 163 DISALLOW_COPY_AND_ASSIGN(ShaderTranslator); |
164 }; | 164 }; |
165 | 165 |
166 } // namespace gles2 | 166 } // namespace gles2 |
167 } // namespace gpu | 167 } // namespace gpu |
168 | 168 |
169 #endif // GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_ | 169 #endif // GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_ |
170 | 170 |
OLD | NEW |