OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 GrShaderVar_DEFINED | 8 #ifndef GrShaderVar_DEFINED |
9 #define GrShaderVar_DEFINED | 9 #define GrShaderVar_DEFINED |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 /** | 48 /** |
49 * Defaults to a float with no precision specifier | 49 * Defaults to a float with no precision specifier |
50 */ | 50 */ |
51 GrShaderVar() | 51 GrShaderVar() |
52 : fType(kFloat_GrSLType) | 52 : fType(kFloat_GrSLType) |
53 , fTypeModifier(kNone_TypeModifier) | 53 , fTypeModifier(kNone_TypeModifier) |
54 , fCount(kNonArray) | 54 , fCount(kNonArray) |
55 , fPrecision(kDefault_Precision) { | 55 , fPrecision(kDefault_Precision) { |
56 } | 56 } |
57 | 57 |
| 58 GrShaderVar(const SkString& name, GrSLType type, int arrayCount = kNonArray, |
| 59 Precision precision = kDefault_Precision) |
| 60 : fType(type) |
| 61 , fTypeModifier(kNone_TypeModifier) |
| 62 , fName(name) |
| 63 , fCount(arrayCount) |
| 64 , fPrecision(precision) { |
| 65 SkASSERT(kVoid_GrSLType != type); |
| 66 } |
| 67 |
58 GrShaderVar(const char* name, GrSLType type, int arrayCount = kNonArray, | 68 GrShaderVar(const char* name, GrSLType type, int arrayCount = kNonArray, |
59 Precision precision = kDefault_Precision) | 69 Precision precision = kDefault_Precision) |
60 : fType(type) | 70 : fType(type) |
61 , fTypeModifier(kNone_TypeModifier) | 71 , fTypeModifier(kNone_TypeModifier) |
62 , fName(name) | 72 , fName(name) |
63 , fCount(arrayCount) | 73 , fCount(arrayCount) |
64 , fPrecision(precision) { | 74 , fPrecision(precision) { |
65 SkASSERT(kVoid_GrSLType != type); | 75 SkASSERT(kVoid_GrSLType != type); |
66 } | 76 } |
67 | 77 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 | 224 |
215 protected: | 225 protected: |
216 GrSLType fType; | 226 GrSLType fType; |
217 TypeModifier fTypeModifier; | 227 TypeModifier fTypeModifier; |
218 SkString fName; | 228 SkString fName; |
219 int fCount; | 229 int fCount; |
220 Precision fPrecision; | 230 Precision fPrecision; |
221 }; | 231 }; |
222 | 232 |
223 #endif | 233 #endif |
OLD | NEW |