Converted texture and runtime effects to use GrMatrixEffect
Change-Id: I6e769d52291dd29c2d06983dae5013b6058864cb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283780
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/src/gpu/glsl/GrGLSLGeometryProcessor.cpp b/src/gpu/glsl/GrGLSLGeometryProcessor.cpp
index 5cfb986..be69f25 100644
--- a/src/gpu/glsl/GrGLSLGeometryProcessor.cpp
+++ b/src/gpu/glsl/GrGLSLGeometryProcessor.cpp
@@ -131,14 +131,9 @@
vb->codeAppendf("%s = %s * %s;", v.vsOut(), matrix.c_str(), localCoordsStr.c_str());
}
fsVar = GrShaderVar(SkString(v.fsIn()), v.type(), GrShaderVar::TypeModifier::In);
- fTransformInfos.push_back({ v.vsOut(), v.type(), matrix.c_str(), localCoordsStr, &fp });
- } else {
- SkASSERT(fp.sampleMatrix().fKind != SkSL::SampleMatrix::Kind::kVariable);
- if (fp.sampleMatrix().fKind == SkSL::SampleMatrix::Kind::kConstantOrUniform) {
- matrix += " * " + fp.sampleMatrix().fExpression;
- }
+ fTransformInfos.push_back({ v.vsOut(), v.type(), matrix, localCoordsStr, &fp });
}
- handler->specifyCoordsForCurrCoordTransform(matrix, transformVar, fsVar);
+ handler->specifyCoordsForCurrCoordTransform(transformVar, fsVar);
}
}
@@ -151,12 +146,12 @@
uniformHandler->writeUniformMappings(tr.fFP->sampleMatrix().fOwner, vb);
if (tr.fType == kFloat2_GrSLType) {
vb->codeAppendf("%s = (%s * %s * %s).xy", tr.fName,
- tr.fFP->sampleMatrix().fExpression.c_str(), tr.fMatrix,
+ tr.fFP->sampleMatrix().fExpression.c_str(), tr.fMatrix.c_str(),
tr.fLocalCoords.c_str());
} else {
SkASSERT(tr.fType == kFloat3_GrSLType);
vb->codeAppendf("%s = %s * %s * %s", tr.fName,
- tr.fFP->sampleMatrix().fExpression.c_str(), tr.fMatrix,
+ tr.fFP->sampleMatrix().fExpression.c_str(), tr.fMatrix.c_str(),
tr.fName);
}
vb->codeAppend(";\n");