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 |
41 std::string description() const { | 45 std::string description() const { |
42 std::string result = fLayout.description(); | 46 std::string result = fLayout.description(); |
43 if (fFlags & kUniform_Flag) { | 47 if (fFlags & kUniform_Flag) { |
44 result += "uniform "; | 48 result += "uniform "; |
45 } | 49 } |
46 if (fFlags & kConst_Flag) { | 50 if (fFlags & kConst_Flag) { |
47 result += "const "; | 51 result += "const "; |
48 } | 52 } |
49 if (fFlags & kLowp_Flag) { | 53 if (fFlags & kLowp_Flag) { |
50 result += "lowp "; | 54 result += "lowp "; |
(...skipping 30 matching lines...) Expand all Loading... |
81 return !(*this == other); | 85 return !(*this == other); |
82 } | 86 } |
83 | 87 |
84 Layout fLayout; | 88 Layout fLayout; |
85 int fFlags; | 89 int fFlags; |
86 }; | 90 }; |
87 | 91 |
88 } // namespace | 92 } // namespace |
89 | 93 |
90 #endif | 94 #endif |
OLD | NEW |