OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 GrGLShaderVar_DEFINED | 8 #ifndef GrGLShaderVar_DEFINED |
9 #define GrGLShaderVar_DEFINED | 9 #define GrGLShaderVar_DEFINED |
10 | 10 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 /** | 152 /** |
153 * Write a declaration of this variable to out. | 153 * Write a declaration of this variable to out. |
154 */ | 154 */ |
155 void appendDecl(const GrGLContextInfo& ctxInfo, SkString* out) const { | 155 void appendDecl(const GrGLContextInfo& ctxInfo, SkString* out) const { |
156 if (kUpperLeft_Origin == fOrigin) { | 156 if (kUpperLeft_Origin == fOrigin) { |
157 // this is the only place where we specify a layout modifier. If we
use other layout | 157 // this is the only place where we specify a layout modifier. If we
use other layout |
158 // modifiers in the future then they should be placed in a list. | 158 // modifiers in the future then they should be placed in a list. |
159 out->append("layout(origin_upper_left) "); | 159 out->append("layout(origin_upper_left) "); |
160 } | 160 } |
161 if (this->getTypeModifier() != kNone_TypeModifier) { | 161 if (this->getTypeModifier() != kNone_TypeModifier) { |
162 out->append(TypeModifierString(this->getTypeModifier(), ctxInfo.glslG
eneration())); | 162 out->append(TypeModifierString(this->getTypeModifier(), |
| 163 ctxInfo.glslGeneration())); |
163 out->append(" "); | 164 out->append(" "); |
164 } | 165 } |
165 out->append(PrecisionString(fPrecision, ctxInfo.standard())); | 166 out->append(PrecisionString(fPrecision, ctxInfo.standard())); |
166 GrSLType effectiveType = this->getType(); | 167 GrSLType effectiveType = this->getType(); |
167 if (this->isArray()) { | 168 if (this->isArray()) { |
168 if (this->isUnsizedArray()) { | 169 if (this->isUnsizedArray()) { |
169 out->appendf("%s %s[]", | 170 out->appendf("%s %s[]", |
170 GrGLSLTypeString(effectiveType), | 171 GrGLSLTypeString(effectiveType), |
171 this->getName().c_str()); | 172 this->getName().c_str()); |
172 } else { | 173 } else { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 | 244 |
244 Origin fOrigin; | 245 Origin fOrigin; |
245 /// Work around driver bugs on some hardware that don't correctly | 246 /// Work around driver bugs on some hardware that don't correctly |
246 /// support uniform float [] | 247 /// support uniform float [] |
247 bool fUseUniformFloatArrays; | 248 bool fUseUniformFloatArrays; |
248 | 249 |
249 typedef GrShaderVar INHERITED; | 250 typedef GrShaderVar INHERITED; |
250 }; | 251 }; |
251 | 252 |
252 #endif | 253 #endif |
OLD | NEW |