Remove GrFragmentProcessor::addCoordTransform()

At this point, every created instance of GrCoordTransform is an identity
so can be removed. Adding it manually using addCoordTransforms() is no
different than relying on the (current) implicitly returned coord
transform if the FP calls setUsesSampleCoordsDirectly().

Removing the addCoordTransform() lets us enforce that this remains the
case and this CL also deletes all of those members that were previously
used to provide access to the sample coordinates.

As part of this, GrFragmentProcessor.h and many other files no longer
need to include GrCoordTransform.h. This exposed a surprising popularity on
SkMatrixPriv.h so I updated those files to include that header directly.

Technically, a .fp file can still have an @coordTransform section and
the sksl generator will try and call addCoordTransform, which will then
fail to build. A follow up CL removes that support in .fp generation.

Bug: skia:10416
Change-Id: I5e4d2bb49ee6d7e56ac75ca00be5631106fec20b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299291
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
diff --git a/src/gpu/GrFragmentProcessor.cpp b/src/gpu/GrFragmentProcessor.cpp
index 22e511e..79611cf 100644
--- a/src/gpu/GrFragmentProcessor.cpp
+++ b/src/gpu/GrFragmentProcessor.cpp
@@ -69,34 +69,22 @@
 }
 
 int GrFragmentProcessor::numCoordTransforms() const {
-    if (SkToBool(fFlags & kUsesSampleCoordsDirectly_Flag) && fCoordTransforms.empty() &&
-        !this->isSampledWithExplicitCoords()) {
+    if (SkToBool(fFlags & kUsesSampleCoordsDirectly_Flag) && !this->isSampledWithExplicitCoords()) {
         // coordTransform(0) will return an implicitly defined coord transform so that varyings are
         // added for this FP in order to support const/uniform sample matrix lifting.
         return 1;
     } else {
-        return fCoordTransforms.count();
+        return 0;
     }
 }
 
 const GrCoordTransform& GrFragmentProcessor::coordTransform(int i) const {
-    SkASSERT(i >= 0 && i < this->numCoordTransforms());
-    if (SkToBool(fFlags & kUsesSampleCoordsDirectly_Flag) && fCoordTransforms.empty() &&
-        !this->isSampledWithExplicitCoords()) {
-        SkASSERT(i == 0);
-
-        // as things stand, matrices only work when there's a coord transform, so we need to add
-        // an identity transform to keep the downstream code happy
-        static const GrCoordTransform kImplicitIdentity;
-        return kImplicitIdentity;
-    } else {
-        return *fCoordTransforms[i];
-    }
-}
-
-void GrFragmentProcessor::addCoordTransform(GrCoordTransform* transform) {
-    fCoordTransforms.push_back(transform);
-    fFlags |= kHasCoordTransforms_Flag;
+    SkASSERT(i == 0 && SkToBool(fFlags & kUsesSampleCoordsDirectly_Flag) &&
+             !this->isSampledWithExplicitCoords());
+    // as things stand, matrices only work when there's a coord transform, so we need to add
+    // an identity transform to keep the downstream code happy
+    static const GrCoordTransform kImplicitIdentity;
+    return kImplicitIdentity;
 }
 
 void GrFragmentProcessor::setSampleMatrix(SkSL::SampleMatrix newMatrix) {
@@ -165,10 +153,6 @@
         child->setSampleMatrix(sampleMatrix);
     }
 
-    if (child->fFlags & kHasCoordTransforms_Flag) {
-        fFlags |= kHasCoordTransforms_Flag;
-    }
-
     if (child->sampleMatrix().fKind == SkSL::SampleMatrix::Kind::kVariable) {
         // Since the child is sampled with a variable matrix expression, auto-generated code in
         // invokeChildWithMatrix() for this FP will refer to the local coordinates.