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

Unified Diff: src/gpu/effects/GrCustomCoordsTextureEffect.cpp

Issue 671023002: Added varying struct (Closed) Base URL: https://skia.googlesource.com/skia.git@gp_emit_struct
Patch Set: feedback incorporated Created 6 years, 2 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
Index: src/gpu/effects/GrCustomCoordsTextureEffect.cpp
diff --git a/src/gpu/effects/GrCustomCoordsTextureEffect.cpp b/src/gpu/effects/GrCustomCoordsTextureEffect.cpp
index 84f6b43295cb27a137a2a3bc97573402ce6d7fd8..9a853da120ecfdfdbcc1c0d28b01d3b456d595b9 100644
--- a/src/gpu/effects/GrCustomCoordsTextureEffect.cpp
+++ b/src/gpu/effects/GrCustomCoordsTextureEffect.cpp
@@ -24,21 +24,18 @@ 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("TextureCoords", kVec2f_GrSLType);
+ args.fPB->addVarying(&v);
GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder();
const GrShaderVar& inTextureCoords = customCoordsTextureEffect.inTextureCoords();
- vsBuilder->codeAppendf("\t%s = %s;\n", vsVaryingName, inTextureCoords.c_str());
+ vsBuilder->codeAppendf("\t%s = %s;\n", v.vsOut(), inTextureCoords.c_str());
GrGLGPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
fsBuilder->codeAppendf("\t%s = ", args.fOutput);
fsBuilder->appendTextureLookupAndModulate(args.fInput,
args.fSamplers[0],
- fsCoordName.c_str(),
+ v.fsIn(),
kVec2f_GrSLType);
fsBuilder->codeAppend(";\n");
}

Powered by Google App Engine
This is Rietveld 408576698