Changes to GrCoordTransform and local coords
*Don't track vertex-shader status per-coord transform, just at FP level
*Remove outdated "in processor" checks
*Adjust "uses local coords" on FP to consider whether coord transforms
actually transform local coords or custom coords
*Remove unused accessMatrix() method
*Don't track normalization and y-flipping separately from proxy
*Rename some things for clarity
*Simplify FPCoordTransformHandler
Change-Id: Ic493afc82bd949bbab177d33111a1942e33f88a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256101
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/glsl/GrGLSLGeometryProcessor.cpp b/src/gpu/glsl/GrGLSLGeometryProcessor.cpp
index adb20fa..feaa162 100644
--- a/src/gpu/glsl/GrGLSLGeometryProcessor.cpp
+++ b/src/gpu/glsl/GrGLSLGeometryProcessor.cpp
@@ -67,8 +67,8 @@
} else {
localCoords.printf("float3(%s, 1)", localCoordsVar.c_str());
}
- int i = 0;
- while (const GrCoordTransform* coordTransform = handler->nextCoordTransform()) {
+ for (int i = 0; *handler; ++*handler, ++i) {
+ auto [coordTransform, fp] = handler->get();
SkString strUniName;
strUniName.printf("CoordTransformMatrix_%d", i);
const char* uniName;
@@ -77,14 +77,14 @@
strUniName.c_str(),
&uniName).toIndex();
GrSLType varyingType = kFloat2_GrSLType;
- if (localMatrix.hasPerspective() || coordTransform->getMatrix().hasPerspective()
- || threeComponentLocalCoords) {
+ if (localMatrix.hasPerspective() || coordTransform.matrix().hasPerspective() ||
+ threeComponentLocalCoords) {
varyingType = kFloat3_GrSLType;
}
SkString strVaryingName;
strVaryingName.printf("TransformedCoords_%d", i);
GrGLSLVarying v(varyingType);
- if (coordTransform->computeInVertexShader()) {
+ if (fp.coordTransformsApplyToLocalCoords()) {
varyingHandler->addVarying(strVaryingName.c_str(), &v);
if (kFloat2_GrSLType == varyingType) {
@@ -96,7 +96,6 @@
handler->specifyCoordsForCurrCoordTransform(SkString(uniName),
fInstalledTransforms.back().fHandle,
GrShaderVar(SkString(v.fsIn()), varyingType));
- ++i;
}
}