diff options
author | joshualitt <joshualitt@chromium.org> | 2014-10-24 07:56:04 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-24 07:56:04 -0700 |
commit | 852ae80b9c3c6fd53f993ac35133d80863993cbe (patch) | |
tree | 59aa7b7fd0d319b3fcc15cc2fa291689b2a68bb3 /src/gpu/effects/GrCustomCoordsTextureEffect.cpp | |
parent | 8dae0f364b04da1584554f94fc30b3263dae5c3a (diff) |
Added varying struct
TBR=
BUG=skia:
Review URL: https://codereview.chromium.org/671023002
Diffstat (limited to 'src/gpu/effects/GrCustomCoordsTextureEffect.cpp')
-rw-r--r-- | src/gpu/effects/GrCustomCoordsTextureEffect.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/gpu/effects/GrCustomCoordsTextureEffect.cpp b/src/gpu/effects/GrCustomCoordsTextureEffect.cpp index 84f6b43295..afa0754603 100644 --- a/src/gpu/effects/GrCustomCoordsTextureEffect.cpp +++ b/src/gpu/effects/GrCustomCoordsTextureEffect.cpp @@ -24,23 +24,20 @@ public: args.fGP.cast<GrCustomCoordsTextureEffect>(); SkASSERT(1 == customCoordsTextureEffect.getVertexAttribs().count()); - SkString fsCoordName; - const char* vsVaryingName; - const char* fsVaryingNamePtr; - args.fPB->addVarying(kVec2f_GrSLType, "textureCoords", &vsVaryingName, &fsVaryingNamePtr); - fsCoordName = fsVaryingNamePtr; + GrGLVertToFrag v(kVec2f_GrSLType); + args.fPB->addVarying("TextureCoords", &v); GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder(); const GrShaderVar& inTextureCoords = customCoordsTextureEffect.inTextureCoords(); - vsBuilder->codeAppendf("\t%s = %s;\n", vsVaryingName, inTextureCoords.c_str()); + vsBuilder->codeAppendf("%s = %s;", v.vsOut(), inTextureCoords.c_str()); GrGLGPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder(); - fsBuilder->codeAppendf("\t%s = ", args.fOutput); + fsBuilder->codeAppendf("%s = ", args.fOutput); fsBuilder->appendTextureLookupAndModulate(args.fInput, args.fSamplers[0], - fsCoordName.c_str(), + v.fsIn(), kVec2f_GrSLType); - fsBuilder->codeAppend(";\n"); + fsBuilder->codeAppend(";"); } virtual void setData(const GrGLProgramDataManager&, |