Remove unneeded GrGLSLTransformedCoordsArray type
Rename GrGLSLFragmentBuilder::ensureFSCoords2D to ensureCoords2D and make it take an arbitrary GrShaderVar.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2324663004
Review-Url: https://codereview.chromium.org/2324663004
diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
index 7763f86..d35730f 100644
--- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
@@ -125,19 +125,16 @@
}
}
-SkString GrGLSLFragmentShaderBuilder::ensureFSCoords2D(const GrGLSLTransformedCoordsArray& coords,
- int index) {
- if (kVec3f_GrSLType != coords[index].getType()) {
- SkASSERT(kVec2f_GrSLType == coords[index].getType());
- return coords[index].getName();
+SkString GrGLSLFragmentShaderBuilder::ensureCoords2D(const GrShaderVar& coords) {
+ if (kVec3f_GrSLType != coords.getType()) {
+ SkASSERT(kVec2f_GrSLType == coords.getType());
+ return coords.getName();
}
- SkString coords2D("coords2D");
- if (0 != index) {
- coords2D.appendf("_%i", index);
- }
- this->codeAppendf("\tvec2 %s = %s.xy / %s.z;",
- coords2D.c_str(), coords[index].c_str(), coords[index].c_str());
+ SkString coords2D;
+ coords2D.printf("%s_ensure2D", coords.c_str());
+ this->codeAppendf("\tvec2 %s = %s.xy / %s.z;", coords2D.c_str(), coords.c_str(),
+ coords.c_str());
return coords2D;
}