Reland "In GrSkSLFP, always use a coord transform"

This reverts commit fd7fd960be.

Change-Id: Id0f39dfd906f24e5c5eb054a28fc8e96ef73835e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/267036
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
Brian Osman 2020-02-06 13:31:15 -05:00 committed by Skia Commit-Bot
parent 5f3d9f76c9
commit ab2f7c5720

View File

@ -91,9 +91,8 @@ public:
}
}
GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
SkString coords = args.fTransformedCoords.count()
? fragBuilder->ensureCoords2D(args.fTransformedCoords[0].fVaryingPoint)
: SkString("sk_FragCoord");
SkASSERT(args.fTransformedCoords.count() == 1);
SkString coords = fragBuilder->ensureCoords2D(args.fTransformedCoords[0].fVaryingPoint);
std::vector<SkString> childNames;
for (int i = 0; i < this->numChildProcessors(); ++i) {
childNames.push_back(this->invokeChild(i, args));
@ -179,8 +178,8 @@ GrSkSLFP::GrSkSLFP(sk_sp<const GrShaderCaps> shaderCaps, sk_sp<SkRuntimeEffect>
, fInputs(std::move(inputs)) {
if (matrix) {
fCoordTransform = GrCoordTransform(*matrix);
this->addCoordTransform(&fCoordTransform);
}
this->addCoordTransform(&fCoordTransform);
}
GrSkSLFP::GrSkSLFP(const GrSkSLFP& other)
@ -189,10 +188,9 @@ GrSkSLFP::GrSkSLFP(const GrSkSLFP& other)
, fEffect(other.fEffect)
, fName(other.fName)
, fInputs(other.fInputs) {
if (other.numCoordTransforms()) {
fCoordTransform = other.fCoordTransform;
this->addCoordTransform(&fCoordTransform);
}
SkASSERT(other.numCoordTransforms() == 1);
fCoordTransform = other.fCoordTransform;
this->addCoordTransform(&fCoordTransform);
}
const char* GrSkSLFP::name() const {