Index: src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp |
diff --git a/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp b/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp |
index 76026b7a25005509701e91a874837d72555fe81f..1fa946793c64bead43fd59c8e1a83ed79d8d996d 100644 |
--- a/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp |
+++ b/src/gpu/gl/builders/GrGLVertexShaderBuilder.cpp |
@@ -23,17 +23,12 @@ GrGLVertexBuilder::GrGLVertexBuilder(GrGLProgramBuilder* program) |
, fEffectAttribOffset(0) { |
} |
-SkString* GrGLVertexBuilder::addVarying(GrSLType type, const char* name, |
- const char** vsOutName) { |
+void GrGLVertexBuilder::addVarying(const char* name, GrGLVarying* v) { |
fOutputs.push_back(); |
- fOutputs.back().setType(type); |
+ fOutputs.back().setType(v->fType); |
fOutputs.back().setTypeModifier(GrGLShaderVar::kVaryingOut_TypeModifier); |
fProgramBuilder->nameVariable(fOutputs.back().accessName(), 'v', name); |
- |
- if (vsOutName) { |
- *vsOutName = fOutputs.back().getName().c_str(); |
- } |
- return fOutputs.back().accessName(); |
+ v->fVsOut = fOutputs.back().getName().c_str(); |
} |
void GrGLVertexBuilder::setupLocalCoords() { |
@@ -63,15 +58,15 @@ void GrGLVertexBuilder::transformGLToSkiaCoords() { |
} |
void GrGLVertexBuilder::setupBuiltinVertexAttribute(const char* inName, GrGLSLExpr4* out) { |
+ GrGLVertToFrag v(kVec4f_GrSLType); |
+ fProgramBuilder->addVarying(inName, &v); |
SkString name(inName); |
- const char *vsName, *fsName; |
- fProgramBuilder->addVarying(kVec4f_GrSLType, name.c_str(), &vsName, &fsName); |
name.prepend("in"); |
this->addAttribute(GrShaderVar(name.c_str(), |
kVec4f_GrSLType, |
GrShaderVar::kAttribute_TypeModifier)); |
- this->codeAppendf("%s = %s;", vsName, name.c_str()); |
- *out = fsName; |
+ this->codeAppendf("%s = %s;", v.vsOut(), name.c_str()); |
+ *out = v.fsIn(); |
fEffectAttribOffset++; |
} |