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 25 matching lines...) Expand all Loading... |
36 VariableInfo() | 36 VariableInfo() |
37 : type(0), | 37 : type(0), |
38 size(0) { | 38 size(0) { |
39 } | 39 } |
40 | 40 |
41 VariableInfo(int _type, int _size, std::string _name) | 41 VariableInfo(int _type, int _size, std::string _name) |
42 : type(_type), | 42 : type(_type), |
43 size(_size), | 43 size(_size), |
44 name(_name) { | 44 name(_name) { |
45 } | 45 } |
| 46 bool operator==( |
| 47 const ShaderTranslatorInterface::VariableInfo& other) const { |
| 48 return type == other.type && |
| 49 size == other.size && |
| 50 strcmp(name.c_str(), other.name.c_str()) == 0; |
| 51 } |
46 | 52 |
47 int type; | 53 int type; |
48 int size; | 54 int size; |
49 std::string name; // name in the original shader source. | 55 std::string name; // name in the original shader source. |
50 }; | 56 }; |
51 | 57 |
52 // Mapping between variable name and info. | 58 // Mapping between variable name and info. |
53 typedef base::hash_map<std::string, VariableInfo> VariableMap; | 59 typedef base::hash_map<std::string, VariableInfo> VariableMap; |
54 | 60 |
55 // Initializes the translator. | 61 // Initializes the translator. |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 ObserverList<DestructionObserver> destruction_observers_; | 141 ObserverList<DestructionObserver> destruction_observers_; |
136 | 142 |
137 DISALLOW_COPY_AND_ASSIGN(ShaderTranslator); | 143 DISALLOW_COPY_AND_ASSIGN(ShaderTranslator); |
138 }; | 144 }; |
139 | 145 |
140 } // namespace gles2 | 146 } // namespace gles2 |
141 } // namespace gpu | 147 } // namespace gpu |
142 | 148 |
143 #endif // GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_ | 149 #endif // GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_ |
144 | 150 |
OLD | NEW |