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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 | 297 |
298 void appendArrayAccess(const char* indexName, SkString* out) const { | 298 void appendArrayAccess(const char* indexName, SkString* out) const { |
299 out->appendf("%s[%s]%s", | 299 out->appendf("%s[%s]%s", |
300 this->getName().c_str(), | 300 this->getName().c_str(), |
301 indexName, | 301 indexName, |
302 fUseUniformFloatArrays ? "" : ".x"); | 302 fUseUniformFloatArrays ? "" : ".x"); |
303 } | 303 } |
304 | 304 |
305 static const char* PrecisionString(Precision p, GrGLBinding binding) { | 305 static const char* PrecisionString(Precision p, GrGLBinding binding) { |
306 // Desktop GLSL has added precision qualifiers but they don't do anythin
g. | 306 // Desktop GLSL has added precision qualifiers but they don't do anythin
g. |
307 if (kES2_GrGLBinding == binding) { | 307 if (kES_GrGLBinding == binding) { |
308 switch (p) { | 308 switch (p) { |
309 case kLow_Precision: | 309 case kLow_Precision: |
310 return "lowp "; | 310 return "lowp "; |
311 case kMedium_Precision: | 311 case kMedium_Precision: |
312 return "mediump "; | 312 return "mediump "; |
313 case kHigh_Precision: | 313 case kHigh_Precision: |
314 return "highp "; | 314 return "highp "; |
315 case kDefault_Precision: | 315 case kDefault_Precision: |
316 return ""; | 316 return ""; |
317 default: | 317 default: |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 SkString fName; | 351 SkString fName; |
352 int fCount; | 352 int fCount; |
353 Precision fPrecision; | 353 Precision fPrecision; |
354 Origin fOrigin; | 354 Origin fOrigin; |
355 /// Work around driver bugs on some hardware that don't correctly | 355 /// Work around driver bugs on some hardware that don't correctly |
356 /// support uniform float [] | 356 /// support uniform float [] |
357 bool fUseUniformFloatArrays; | 357 bool fUseUniformFloatArrays; |
358 }; | 358 }; |
359 | 359 |
360 #endif | 360 #endif |
OLD | NEW |