Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Unified Diff: src/gpu/gl/GrGLShaderVar.h

Issue 16818013: Enabling Perlin Noise on Android (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Update Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/SkPerlinNoiseShader.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/effects/SkPerlinNoiseShader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698