Index: src/gpu/gl/GrGLShaderVar.h |
diff --git a/src/gpu/gl/GrGLShaderVar.h b/src/gpu/gl/GrGLShaderVar.h |
index c79589772ae704a48f81b35938a30777f9b5e82e..e03ed3e563bd423b2aef5153889295c6e283a21e 100644 |
--- a/src/gpu/gl/GrGLShaderVar.h |
+++ b/src/gpu/gl/GrGLShaderVar.h |
@@ -67,12 +67,13 @@ public: |
fUseUniformFloatArrays = USE_UNIFORM_FLOAT_ARRAYS; |
} |
- GrGLShaderVar(const char* name, GrSLType type, int arrayCount = kNonArray) { |
+ GrGLShaderVar(const char* name, GrSLType type, int arrayCount = kNonArray, |
+ Precision precision = kDefault_Precision) { |
GrAssert(kVoid_GrSLType != type); |
fType = type; |
fTypeModifier = kNone_TypeModifier; |
fCount = arrayCount; |
- fPrecision = kDefault_Precision; |
+ fPrecision = precision; |
fOrigin = kDefault_Origin; |
fUseUniformFloatArrays = USE_UNIFORM_FLOAT_ARRAYS; |
fName = name; |
@@ -301,6 +302,25 @@ public: |
fUseUniformFloatArrays ? "" : ".x"); |
} |
+ static const char* PrecisionString(Precision p, GrGLBinding binding) { |
+ // Desktop GLSL has added precision qualifiers but they don't do anything. |
+ if (kES2_GrGLBinding == binding) { |
+ switch (p) { |
+ case kLow_Precision: |
+ return "lowp "; |
+ case kMedium_Precision: |
+ return "mediump "; |
+ case kHigh_Precision: |
+ return "highp "; |
+ case kDefault_Precision: |
+ return ""; |
+ default: |
+ GrCrash("Unexpected precision type."); |
+ } |
+ } |
+ return ""; |
+ } |
+ |
private: |
static const char* TypeModifierString(TypeModifier t, GrGLSLGeneration gen) { |
switch (t) { |
@@ -326,25 +346,6 @@ private: |
} |
} |
- static const char* PrecisionString(Precision p, GrGLBinding binding) { |
- // Desktop GLSL has added precision qualifiers but they don't do anything. |
- if (kES2_GrGLBinding == binding) { |
- switch (p) { |
- case kLow_Precision: |
- return "lowp "; |
- case kMedium_Precision: |
- return "mediump "; |
- case kHigh_Precision: |
- return "highp "; |
- case kDefault_Precision: |
- return ""; |
- default: |
- GrCrash("Unexpected precision type."); |
- } |
- } |
- return ""; |
- } |
- |
GrSLType fType; |
TypeModifier fTypeModifier; |
SkString fName; |