| 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 } | |
| 52 | 46 |
| 53 int type; | 47 int type; |
| 54 int size; | 48 int size; |
| 55 std::string name; // name in the original shader source. | 49 std::string name; // name in the original shader source. |
| 56 }; | 50 }; |
| 57 | 51 |
| 58 // Mapping between variable name and info. | 52 // Mapping between variable name and info. |
| 59 typedef base::hash_map<std::string, VariableInfo> VariableMap; | 53 typedef base::hash_map<std::string, VariableInfo> VariableMap; |
| 60 | 54 |
| 61 // Initializes the translator. | 55 // Initializes the translator. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 ObserverList<DestructionObserver> destruction_observers_; | 135 ObserverList<DestructionObserver> destruction_observers_; |
| 142 | 136 |
| 143 DISALLOW_COPY_AND_ASSIGN(ShaderTranslator); | 137 DISALLOW_COPY_AND_ASSIGN(ShaderTranslator); |
| 144 }; | 138 }; |
| 145 | 139 |
| 146 } // namespace gles2 | 140 } // namespace gles2 |
| 147 } // namespace gpu | 141 } // namespace gpu |
| 148 | 142 |
| 149 #endif // GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_ | 143 #endif // GPU_COMMAND_BUFFER_SERVICE_SHADER_TRANSLATOR_H_ |
| 150 | 144 |
| OLD | NEW |