OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SKSL_MODIFIERS | 8 #ifndef SKSL_MODIFIERS |
9 #define SKSL_MODIFIERS | 9 #define SKSL_MODIFIERS |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 }; | 31 }; |
32 | 32 |
33 Modifiers(const ASTModifiers& modifiers) | 33 Modifiers(const ASTModifiers& modifiers) |
34 : fLayout(modifiers.fLayout) | 34 : fLayout(modifiers.fLayout) |
35 , fFlags(modifiers.fFlags) {} | 35 , fFlags(modifiers.fFlags) {} |
36 | 36 |
37 Modifiers(Layout& layout, int flags) | 37 Modifiers(Layout& layout, int flags) |
38 : fLayout(layout) | 38 : fLayout(layout) |
39 , fFlags(flags) {} | 39 , fFlags(flags) {} |
40 | 40 |
41 Modifiers() | |
42 : fLayout(Layout()) | |
43 , fFlags(0) {} | |
44 | |
45 std::string description() const { | 41 std::string description() const { |
46 std::string result = fLayout.description(); | 42 std::string result = fLayout.description(); |
47 if (fFlags & kUniform_Flag) { | 43 if (fFlags & kUniform_Flag) { |
48 result += "uniform "; | 44 result += "uniform "; |
49 } | 45 } |
50 if (fFlags & kConst_Flag) { | 46 if (fFlags & kConst_Flag) { |
51 result += "const "; | 47 result += "const "; |
52 } | 48 } |
53 if (fFlags & kLowp_Flag) { | 49 if (fFlags & kLowp_Flag) { |
54 result += "lowp "; | 50 result += "lowp "; |
(...skipping 30 matching lines...) Expand all Loading... |
85 return !(*this == other); | 81 return !(*this == other); |
86 } | 82 } |
87 | 83 |
88 Layout fLayout; | 84 Layout fLayout; |
89 int fFlags; | 85 int fFlags; |
90 }; | 86 }; |
91 | 87 |
92 } // namespace | 88 } // namespace |
93 | 89 |
94 #endif | 90 #endif |
OLD | NEW |