Fix constant output for Clamp FP when child processor is present.

Change-Id: I0ff358665c77b9826ee76befc4490b2204f2fa4a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/294698
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
diff --git a/src/gpu/effects/GrClampFragmentProcessor.fp b/src/gpu/effects/GrClampFragmentProcessor.fp
index c7420b0..de379ff 100644
--- a/src/gpu/effects/GrClampFragmentProcessor.fp
+++ b/src/gpu/effects/GrClampFragmentProcessor.fp
@@ -25,7 +25,10 @@
 }
 
 @class {
-    SkPMColor4f constantOutputForConstantInput(const SkPMColor4f& input) const override {
+    SkPMColor4f constantOutputForConstantInput(const SkPMColor4f& inColor) const override {
+        SkPMColor4f input = this->numChildProcessors()
+                            ? ConstantOutputForConstantInput(this->childProcessor(0), inColor)
+                            : inColor;
         float clampedAlpha = SkTPin(input.fA, 0.f, 1.f);
         float clampVal = clampToPremul ? clampedAlpha : 1.f;
         return {SkTPin(input.fR, 0.f, clampVal),
diff --git a/src/gpu/effects/generated/GrClampFragmentProcessor.h b/src/gpu/effects/generated/GrClampFragmentProcessor.h
index df2a6d1..66306ac 100644
--- a/src/gpu/effects/generated/GrClampFragmentProcessor.h
+++ b/src/gpu/effects/generated/GrClampFragmentProcessor.h
@@ -17,7 +17,10 @@
 #include "src/gpu/GrFragmentProcessor.h"
 class GrClampFragmentProcessor : public GrFragmentProcessor {
 public:
-    SkPMColor4f constantOutputForConstantInput(const SkPMColor4f& input) const override {
+    SkPMColor4f constantOutputForConstantInput(const SkPMColor4f& inColor) const override {
+        SkPMColor4f input = this->numChildProcessors() ? ConstantOutputForConstantInput(
+                                                                 this->childProcessor(0), inColor)
+                                                       : inColor;
         float clampedAlpha = SkTPin(input.fA, 0.f, 1.f);
         float clampVal = clampToPremul ? clampedAlpha : 1.f;
         return {SkTPin(input.fR, 0.f, clampVal), SkTPin(input.fG, 0.f, clampVal),