aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLShaderVar.h
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-07 17:36:29 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-07 17:36:29 +0000
commita1bf0fffff821d9c11809c89bd98d4ced480421a (patch)
tree4a89b6a6684bfcf55dfea3f9cb84ddb6a574201e /src/gpu/gl/GrGLShaderVar.h
parent2972bb5fd2441709026b350c6b9b66eecd80f868 (diff)
uniquely name FS functions, add lighting effects to unit test
Review URL: http://codereview.appspot.com/6458080/ git-svn-id: http://skia.googlecode.com/svn/trunk@4992 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/gl/GrGLShaderVar.h')
-rw-r--r--src/gpu/gl/GrGLShaderVar.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/gpu/gl/GrGLShaderVar.h b/src/gpu/gl/GrGLShaderVar.h
index 0231d214d3..92d7ee07fd 100644
--- a/src/gpu/gl/GrGLShaderVar.h
+++ b/src/gpu/gl/GrGLShaderVar.h
@@ -55,13 +55,25 @@ public:
fUseUniformFloatArrays = USE_UNIFORM_FLOAT_ARRAYS;
}
+ GrGLShaderVar(const char* name, GrSLType type, int arrayCount = kNonArray) {
+ GrAssert(kVoid_GrSLType != type);
+ fType = type;
+ fTypeModifier = kNone_TypeModifier;
+ fCount = arrayCount;
+ fPrecision = kDefault_Precision;
+ fUseUniformFloatArrays = USE_UNIFORM_FLOAT_ARRAYS;
+ fName = name;
+ }
+
GrGLShaderVar(const GrGLShaderVar& var)
: fType(var.fType)
, fTypeModifier(var.fTypeModifier)
, fName(var.fName)
, fCount(var.fCount)
, fPrecision(var.fPrecision)
- , fUseUniformFloatArrays(var.fUseUniformFloatArrays) {}
+ , fUseUniformFloatArrays(var.fUseUniformFloatArrays) {
+ GrAssert(kVoid_GrSLType != var.fType);
+ }
/**
* Values for array count that have special meaning. We allow 1-sized arrays.
@@ -79,6 +91,7 @@ public:
const SkString& name,
Precision precision = kDefault_Precision,
bool useUniformFloatArrays = USE_UNIFORM_FLOAT_ARRAYS) {
+ GrAssert(kVoid_GrSLType != type);
fType = type;
fTypeModifier = typeModifier;
fName = name;
@@ -95,6 +108,7 @@ public:
const char* name,
Precision precision = kDefault_Precision,
bool useUniformFloatArrays = USE_UNIFORM_FLOAT_ARRAYS) {
+ GrAssert(kVoid_GrSLType != type);
fType = type;
fTypeModifier = typeModifier;
fName = name;
@@ -112,6 +126,7 @@ public:
int count,
Precision precision = kDefault_Precision,
bool useUniformFloatArrays = USE_UNIFORM_FLOAT_ARRAYS) {
+ GrAssert(kVoid_GrSLType != type);
fType = type;
fTypeModifier = typeModifier;
fName = name;
@@ -129,6 +144,7 @@ public:
int count,
Precision precision = kDefault_Precision,
bool useUniformFloatArrays = USE_UNIFORM_FLOAT_ARRAYS) {
+ GrAssert(kVoid_GrSLType != type);
fType = type;
fTypeModifier = typeModifier;
fName = name;
@@ -232,11 +248,12 @@ public:
TypeString(effectiveType),
this->getName().c_str());
}
- out->append(";\n");
}
static const char* TypeString(GrSLType t) {
switch (t) {
+ case kVoid_GrSLType:
+ return "void";
case kFloat_GrSLType:
return "float";
case kVec2f_GrSLType: