Revert "Start of rewrite of GrFragmentProcessor optimizations."

This reverts commit 85eb4226a4cd8c10a0e3f3ba2f3a60efbb2dd61b.

Reason for revert: test failures on Windows, e.g. https://chromium-swarm.appspot.com/task?id=33f9527484414110&refresh=10

Original change's description:
> Start of rewrite of GrFragmentProcessor optimizations.
> 
> This adds a replacement for computeInvariantOutput buts does not use it yet. The replacement allows for three types of optimizations:
> 
> * known input color -> known output color for GrFP elimination
> * tracking of whether all color processors modulate their input for the "tweak alpha" optimziation
> * opaqueness tracking
> 
> This loses some of the generality of computInvariantOutput. It does not track the known output status of individual color components (other than opaque alpha). It does not track whether GrFragmentProcessors read their input color. It doesn't allow a processor that will receive non-constant output to advertise that it produces a constant output. These could probably be added back in the unlikely case that they prove valuable.
> 
> Unlike computeInvariantOutput the optimizations are decided at instantiation time and constant colors are expressed as GrColor4f rather than GrColor.
> 
> Change-Id: I684d3f9050693dde2d28154fa695e049ed8cf61a
> Reviewed-on: https://skia-review.googlesource.com/7481
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> 

TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I2390df257456013fa74137cb5d7b5a93820c291e
Reviewed-on: https://skia-review.googlesource.com/7652
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
diff --git a/src/gpu/GrFragmentProcessor.cpp b/src/gpu/GrFragmentProcessor.cpp
index f294ac6..0ad144a 100644
--- a/src/gpu/GrFragmentProcessor.cpp
+++ b/src/gpu/GrFragmentProcessor.cpp
@@ -58,7 +58,7 @@
 
 void GrFragmentProcessor::addCoordTransform(const GrCoordTransform* transform) {
     fCoordTransforms.push_back(transform);
-    fFlags |= kUsesLocalCoords_Flag;
+    fUsesLocalCoords = true;
     SkDEBUGCODE(transform->setInProcessor();)
 }
 
@@ -66,10 +66,10 @@
     this->combineRequiredFeatures(*child);
 
     if (child->usesLocalCoords()) {
-        fFlags |= kUsesLocalCoords_Flag;
+        fUsesLocalCoords = true;
     }
     if (child->usesDistanceVectorField()) {
-        fFlags |= kUsesDistanceVectorField_Flag;
+        fUsesDistanceVectorField = true;
     }
 
     int index = fChildProcessors.count();
@@ -111,13 +111,12 @@
 
     class PremulInputFragmentProcessor : public GrFragmentProcessor {
     public:
-        PremulInputFragmentProcessor()
-                : INHERITED(kPreservesOpaqueInput_OptimizationFlag |
-                            kConstantOutputForConstantInput_OptimizationFlag) {
+        PremulInputFragmentProcessor() {
             this->initClassID<PremulInputFragmentProcessor>();
         }
 
         const char* name() const override { return "PremultiplyInput"; }
+
     private:
         GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
             class GLFP : public GrGLSLFragmentProcessor {
@@ -140,11 +139,6 @@
         void onComputeInvariantOutput(GrInvariantOutput* inout) const override {
             inout->premulFourChannelColor();
         }
-        GrColor4f constantOutputForConstantInput(GrColor4f input) const override {
-            return input.premul();
-        }
-
-        typedef GrFragmentProcessor INHERITED;
     };
     if (!fp) {
         return nullptr;
@@ -158,8 +152,7 @@
 
     class PremulFragmentProcessor : public GrFragmentProcessor {
     public:
-        PremulFragmentProcessor(sk_sp<GrFragmentProcessor> processor)
-                : INHERITED(OptFlags(processor.get())) {
+        PremulFragmentProcessor(sk_sp<GrFragmentProcessor> processor) {
             this->initClassID<PremulFragmentProcessor>();
             this->registerChildProcessor(processor);
         }
@@ -185,16 +178,6 @@
 
         bool onIsEqual(const GrFragmentProcessor&) const override { return true; }
 
-        static OptimizationFlags OptFlags(const GrFragmentProcessor* inner) {
-            OptimizationFlags flags = kNone_OptimizationFlags;
-            if (inner->preservesOpaqueInput()) {
-                flags |= kPreservesOpaqueInput_OptimizationFlag;
-            }
-            if (inner->hasConstantOutputForConstantInput()) {
-                flags |= kConstantOutputForConstantInput_OptimizationFlag;
-            }
-            return flags;
-        }
         void onComputeInvariantOutput(GrInvariantOutput* inout) const override {
             // TODO: Add a helper to GrInvariantOutput that handles multiplying by color with flags?
             if (!(inout->validFlags() & kA_GrColorComponentFlag)) {
@@ -227,16 +210,6 @@
             }
             inout->setToOther(commonFlags, color);
         }
-        GrColor4f constantOutputForConstantInput(GrColor4f input) const override {
-            GrColor4f childColor = ConstantOutputForConstantInput(this->childProcessor(0),
-                                                                  GrColor4f::OpaqueWhite());
-            return GrColor4f(input.fRGBA[3] * input.fRGBA[0] * childColor.fRGBA[0],
-                             input.fRGBA[3] * input.fRGBA[1] * childColor.fRGBA[1],
-                             input.fRGBA[3] * input.fRGBA[2] * childColor.fRGBA[2],
-                             input.fRGBA[3] * childColor.fRGBA[3]);
-        }
-
-        typedef GrFragmentProcessor INHERITED;
     };
     if (!fp) {
         return nullptr;
@@ -251,7 +224,7 @@
     class ReplaceInputFragmentProcessor : public GrFragmentProcessor {
     public:
         ReplaceInputFragmentProcessor(sk_sp<GrFragmentProcessor> child, GrColor4f color)
-                : INHERITED(OptFlags(child.get(), color)), fColor(color) {
+            : fColor(color) {
             this->initClassID<ReplaceInputFragmentProcessor>();
             this->registerChildProcessor(std::move(child));
         }
@@ -291,18 +264,6 @@
         }
 
     private:
-        static OptimizationFlags OptFlags(const GrFragmentProcessor* child, GrColor4f color) {
-            OptimizationFlags childFlags = child->optimizationFlags();
-            OptimizationFlags flags = kNone_OptimizationFlags;
-            if (childFlags & kConstantOutputForConstantInput_OptimizationFlag) {
-                flags |= kConstantOutputForConstantInput_OptimizationFlag;
-            }
-            if ((childFlags & kPreservesOpaqueInput_OptimizationFlag) && color.isOpaque()) {
-                flags |= kPreservesOpaqueInput_OptimizationFlag;
-            }
-            return flags;
-        }
-
         void onGetGLSLProcessorKey(const GrShaderCaps& caps, GrProcessorKeyBuilder* b) const override
         {}
 
@@ -315,13 +276,7 @@
             this->childProcessor(0).computeInvariantOutput(inout);
         }
 
-        GrColor4f constantOutputForConstantInput(GrColor4f) const override {
-            return ConstantOutputForConstantInput(this->childProcessor(0), fColor);
-        }
-
         GrColor4f fColor;
-
-        typedef GrFragmentProcessor INHERITED;
     };
 
     GrInvariantOutput childOut(0x0, kNone_GrColorComponentFlags);
@@ -333,8 +288,7 @@
                                                             int cnt) {
     class SeriesFragmentProcessor : public GrFragmentProcessor {
     public:
-        SeriesFragmentProcessor(sk_sp<GrFragmentProcessor>* children, int cnt)
-                : INHERITED(OptFlags(children, cnt)) {
+        SeriesFragmentProcessor(sk_sp<GrFragmentProcessor>* children, int cnt){
             SkASSERT(cnt > 1);
             this->initClassID<SeriesFragmentProcessor>();
             for (int i = 0; i < cnt; ++i) {
@@ -363,14 +317,8 @@
             };
             return new GLFP;
         }
+
     private:
-        static OptimizationFlags OptFlags(sk_sp<GrFragmentProcessor>* children, int cnt) {
-            OptimizationFlags flags = kAll_OptimizationFlags;
-            for (int i = 0; i < cnt && flags != kNone_OptimizationFlags; ++i) {
-                flags &= children[i]->optimizationFlags();
-            }
-            return flags;
-        }
         void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override {}
 
         bool onIsEqual(const GrFragmentProcessor&) const override { return true; }
@@ -380,15 +328,6 @@
                 this->childProcessor(i).computeInvariantOutput(inout);
             }
         }
-        GrColor4f constantOutputForConstantInput(GrColor4f color) const override {
-            int childCnt = this->numChildProcessors();
-            for (int i = 0; i < childCnt; ++i) {
-                color = ConstantOutputForConstantInput(this->childProcessor(i), color);
-            }
-            return color;
-        }
-
-        typedef GrFragmentProcessor INHERITED;
     };
 
     if (!cnt) {
diff --git a/src/gpu/SkGrPriv.h b/src/gpu/SkGrPriv.h
index 9e2aad0..a4e3976 100644
--- a/src/gpu/SkGrPriv.h
+++ b/src/gpu/SkGrPriv.h
@@ -8,11 +8,10 @@
 #ifndef SkGrPriv_DEFINED
 #define SkGrPriv_DEFINED
 
-#include "GrBlend.h"
 #include "GrTypes.h"
+#include "GrBlend.h"
 #include "SkImageInfo.h"
 #include "SkMatrix.h"
-#include "SkPM4f.h"
 #include "SkXfermodePriv.h"
 
 class GrCaps;
@@ -103,21 +102,6 @@
 
 //////////////////////////////////////////////////////////////////////////////
 
-static inline SkPM4f GrColor4fToSkPM4f(const GrColor4f& c) {
-    SkPM4f pm4f;
-    pm4f.fVec[SkPM4f::R] = c.fRGBA[0];
-    pm4f.fVec[SkPM4f::G] = c.fRGBA[1];
-    pm4f.fVec[SkPM4f::B] = c.fRGBA[2];
-    pm4f.fVec[SkPM4f::A] = c.fRGBA[3];
-    return pm4f;
-}
-
-static inline GrColor4f SkPM4fToGrColor4f(const SkPM4f& c) {
-    return GrColor4f{c.r(), c.g(), c.b(), c.a()};
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
 GrSurfaceDesc GrImageInfoToSurfaceDesc(const SkImageInfo&, const GrCaps&);
 
 bool GrPixelConfigToColorType(GrPixelConfig, SkColorType*);
diff --git a/src/gpu/effects/Gr1DKernelEffect.h b/src/gpu/effects/Gr1DKernelEffect.h
index 67cc771..29e0e5d 100644
--- a/src/gpu/effects/Gr1DKernelEffect.h
+++ b/src/gpu/effects/Gr1DKernelEffect.h
@@ -28,11 +28,12 @@
         kY_Direction,
     };
 
-    Gr1DKernelEffect(GrTexture* texture, Direction direction, int radius,
-                     OptimizationFlags optFlags)
-            : INHERITED(texture, nullptr, SkMatrix::I(), optFlags)
-            , fDirection(direction)
-            , fRadius(radius) {}
+    Gr1DKernelEffect(GrTexture* texture,
+                     Direction direction,
+                     int radius)
+        : INHERITED(texture, nullptr, SkMatrix::I())
+        , fDirection(direction)
+        , fRadius(radius) {}
 
     virtual ~Gr1DKernelEffect() {}
 
@@ -50,6 +51,7 @@
     }
 
 private:
+
     Direction       fDirection;
     int             fRadius;
 
diff --git a/src/gpu/effects/GrBicubicEffect.cpp b/src/gpu/effects/GrBicubicEffect.cpp
index cf3d2b5..07d1c53 100644
--- a/src/gpu/effects/GrBicubicEffect.cpp
+++ b/src/gpu/effects/GrBicubicEffect.cpp
@@ -132,23 +132,21 @@
 
 GrBicubicEffect::GrBicubicEffect(GrTexture* texture,
                                  sk_sp<GrColorSpaceXform> colorSpaceXform,
-                                 const SkMatrix& matrix,
+                                 const SkMatrix &matrix,
                                  const SkShader::TileMode tileModes[2])
-        : INHERITED(texture, std::move(colorSpaceXform), matrix,
-                    GrSamplerParams(tileModes, GrSamplerParams::kNone_FilterMode),
-                    ModulationFlags(texture->config()))
-        , fDomain(GrTextureDomain::IgnoredDomain()) {
+  : INHERITED(texture, std::move(colorSpaceXform), matrix,
+              GrSamplerParams(tileModes, GrSamplerParams::kNone_FilterMode))
+  , fDomain(GrTextureDomain::IgnoredDomain()) {
     this->initClassID<GrBicubicEffect>();
 }
 
 GrBicubicEffect::GrBicubicEffect(GrTexture* texture,
                                  sk_sp<GrColorSpaceXform> colorSpaceXform,
-                                 const SkMatrix& matrix,
+                                 const SkMatrix &matrix,
                                  const SkRect& domain)
-        : INHERITED(texture, std::move(colorSpaceXform), matrix,
-                    GrSamplerParams(SkShader::kClamp_TileMode, GrSamplerParams::kNone_FilterMode),
-                    ModulationFlags(texture->config()))
-        , fDomain(texture, domain, GrTextureDomain::kClamp_Mode) {
+  : INHERITED(texture, std::move(colorSpaceXform), matrix,
+              GrSamplerParams(SkShader::kClamp_TileMode, GrSamplerParams::kNone_FilterMode))
+  , fDomain(texture, domain, GrTextureDomain::kClamp_Mode) {
     this->initClassID<GrBicubicEffect>();
 }
 
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index 74cf2ca..2380ad3 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -98,9 +98,9 @@
                                                    const GrSwizzle& swizzle,
                                                    PMConversion pmConversion,
                                                    const SkMatrix& matrix)
-        : INHERITED(texture, nullptr, matrix, ModulationFlags(texture->config()))
-        , fSwizzle(swizzle)
-        , fPMConversion(pmConversion) {
+    : INHERITED(texture, nullptr, matrix)
+    , fSwizzle(swizzle)
+    , fPMConversion(pmConversion) {
     this->initClassID<GrConfigConversionEffect>();
     // We expect to get here with non-BGRA/RGBA only if we're doing not doing a premul/unpremul
     // conversion.
@@ -116,7 +116,7 @@
                                                    const GrSwizzle& swizzle,
                                                    PMConversion pmConversion,
                                                    const SkMatrix& matrix)
-    : INHERITED(context, ModulationFlags(proxy->config()), proxy, nullptr, matrix)
+    : INHERITED(context, proxy, nullptr, matrix)
     , fSwizzle(swizzle)
     , fPMConversion(pmConversion) {
     this->initClassID<GrConfigConversionEffect>();
diff --git a/src/gpu/effects/GrConfigConversionEffect.h b/src/gpu/effects/GrConfigConversionEffect.h
index 151365b..46180bb 100644
--- a/src/gpu/effects/GrConfigConversionEffect.h
+++ b/src/gpu/effects/GrConfigConversionEffect.h
@@ -52,6 +52,7 @@
     static void TestForPreservingPMConversions(GrContext* context,
                                                PMConversion* PMToUPMRule,
                                                PMConversion* UPMToPMRule);
+
 private:
     GrConfigConversionEffect(GrTexture*, const GrSwizzle&, PMConversion, const SkMatrix& matrix);
 
diff --git a/src/gpu/effects/GrConstColorProcessor.cpp b/src/gpu/effects/GrConstColorProcessor.cpp
index 3875ffc..e656879 100644
--- a/src/gpu/effects/GrConstColorProcessor.cpp
+++ b/src/gpu/effects/GrConstColorProcessor.cpp
@@ -85,19 +85,6 @@
     }
 }
 
-GrColor4f GrConstColorProcessor::constantOutputForConstantInput(GrColor4f input) const {
-    switch (fMode) {
-        case kIgnore_InputMode:
-            return fColor;
-        case kModulateA_InputMode:
-            return fColor.mulByScalar(input.fRGBA[3]);
-        case kModulateRGBA_InputMode:
-            return fColor.modulate(input);
-    }
-    SkFAIL("Unexpected mode");
-    return GrColor4f::TransparentBlack();
-}
-
 void GrConstColorProcessor::onGetGLSLProcessorKey(const GrShaderCaps&,
                                                   GrProcessorKeyBuilder* b) const {
     b->add32(fMode);
diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp
index 4100a0f..65ed87b 100644
--- a/src/gpu/effects/GrConvexPolyEffect.cpp
+++ b/src/gpu/effects/GrConvexPolyEffect.cpp
@@ -32,7 +32,7 @@
 
 private:
     AARectEffect(GrPrimitiveEdgeType edgeType, const SkRect& rect)
-            : INHERITED(kModulatesInput_OptimizationFlag), fRect(rect), fEdgeType(edgeType) {
+        : fRect(rect), fEdgeType(edgeType) {
         this->initClassID<AARectEffect>();
     }
 
@@ -339,7 +339,8 @@
 }
 
 GrConvexPolyEffect::GrConvexPolyEffect(GrPrimitiveEdgeType edgeType, int n, const SkScalar edges[])
-        : INHERITED(kModulatesInput_OptimizationFlag), fEdgeType(edgeType), fEdgeCount(n) {
+    : fEdgeType(edgeType)
+    , fEdgeCount(n) {
     this->initClassID<GrConvexPolyEffect>();
     // Factory function should have already ensured this.
     SkASSERT(n <= kMaxEdges);
diff --git a/src/gpu/effects/GrDitherEffect.cpp b/src/gpu/effects/GrDitherEffect.cpp
index 24e3ba6..2ba47d2 100644
--- a/src/gpu/effects/GrDitherEffect.cpp
+++ b/src/gpu/effects/GrDitherEffect.cpp
@@ -26,7 +26,9 @@
     const char* name() const override { return "Dither"; }
 
 private:
-    DitherEffect() : INHERITED(kNone_OptimizationFlags) { this->initClassID<DitherEffect>(); }
+    DitherEffect() {
+        this->initClassID<DitherEffect>();
+    }
 
     GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
 
diff --git a/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp b/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp
index be6d4d8..91301ff 100644
--- a/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp
+++ b/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp
@@ -150,8 +150,7 @@
                                                                                float gaussianSigma,
                                                                                bool useBounds,
                                                                                float bounds[2])
-        : INHERITED(texture, direction, radius, ModulationFlags(texture->config()))
-        , fUseBounds(useBounds) {
+        : INHERITED(texture, direction, radius), fUseBounds(useBounds) {
     this->initClassID<GrGaussianConvolutionFragmentProcessor>();
     SkASSERT(radius <= kMaxKernelRadius);
     int width = this->width();
diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.cpp b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
index 9b670e1..01fc6ce 100644
--- a/src/gpu/effects/GrMatrixConvolutionEffect.cpp
+++ b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
@@ -156,14 +156,12 @@
                                                      const SkIPoint& kernelOffset,
                                                      GrTextureDomain::Mode tileMode,
                                                      bool convolveAlpha)
-        // To advertise either the modulation or opaqueness optimizations we'd have to examine the
-        // parameters.
-        : INHERITED(texture, nullptr, SkMatrix::I(), kNone_OptimizationFlags)
-        , fKernelSize(kernelSize)
-        , fGain(SkScalarToFloat(gain))
-        , fBias(SkScalarToFloat(bias) / 255.0f)
-        , fConvolveAlpha(convolveAlpha)
-        , fDomain(texture, GrTextureDomain::MakeTexelDomainForMode(bounds, tileMode), tileMode) {
+  : INHERITED(texture, nullptr, SkMatrix::I()),
+    fKernelSize(kernelSize),
+    fGain(SkScalarToFloat(gain)),
+    fBias(SkScalarToFloat(bias) / 255.0f),
+    fConvolveAlpha(convolveAlpha),
+    fDomain(texture, GrTextureDomain::MakeTexelDomainForMode(bounds, tileMode), tileMode) {
     this->initClassID<GrMatrixConvolutionEffect>();
     for (int i = 0; i < kernelSize.width() * kernelSize.height(); i++) {
         fKernel[i] = SkScalarToFloat(kernel[i]);
diff --git a/src/gpu/effects/GrOvalEffect.cpp b/src/gpu/effects/GrOvalEffect.cpp
index 3b0a887..21a4ba0 100644
--- a/src/gpu/effects/GrOvalEffect.cpp
+++ b/src/gpu/effects/GrOvalEffect.cpp
@@ -64,7 +64,9 @@
 }
 
 CircleEffect::CircleEffect(GrPrimitiveEdgeType edgeType, const SkPoint& c, SkScalar r)
-        : INHERITED(kModulatesInput_OptimizationFlag), fCenter(c), fRadius(r), fEdgeType(edgeType) {
+    : fCenter(c)
+    , fRadius(r)
+    , fEdgeType(edgeType) {
     this->initClassID<CircleEffect>();
 }
 
@@ -228,12 +230,10 @@
     inout->mulByUnknownSingleComponent();
 }
 
-EllipseEffect::EllipseEffect(GrPrimitiveEdgeType edgeType, const SkPoint& c, SkScalar rx,
-                             SkScalar ry)
-        : INHERITED(kModulatesInput_OptimizationFlag)
-        , fCenter(c)
-        , fRadii(SkVector::Make(rx, ry))
-        , fEdgeType(edgeType) {
+EllipseEffect::EllipseEffect(GrPrimitiveEdgeType edgeType, const SkPoint& c, SkScalar rx, SkScalar ry)
+    : fCenter(c)
+    , fRadii(SkVector::Make(rx, ry))
+    , fEdgeType(edgeType) {
     this->initClassID<EllipseEffect>();
 }
 
diff --git a/src/gpu/effects/GrRRectEffect.cpp b/src/gpu/effects/GrRRectEffect.cpp
index 4397fcf..adebc24 100644
--- a/src/gpu/effects/GrRRectEffect.cpp
+++ b/src/gpu/effects/GrRRectEffect.cpp
@@ -95,10 +95,9 @@
 
 CircularRRectEffect::CircularRRectEffect(GrPrimitiveEdgeType edgeType, uint32_t circularCornerFlags,
                                          const SkRRect& rrect)
-        : INHERITED(kModulatesInput_OptimizationFlag)
-        , fRRect(rrect)
-        , fEdgeType(edgeType)
-        , fCircularCornerFlags(circularCornerFlags) {
+    : fRRect(rrect)
+    , fEdgeType(edgeType)
+    , fCircularCornerFlags(circularCornerFlags) {
     this->initClassID<CircularRRectEffect>();
 }
 
@@ -411,8 +410,8 @@
 
     void onComputeInvariantOutput(GrInvariantOutput* inout) const override;
 
-    SkRRect fRRect;
-    GrPrimitiveEdgeType fEdgeType;
+    SkRRect             fRRect;
+    GrPrimitiveEdgeType    fEdgeType;
 
     GR_DECLARE_FRAGMENT_PROCESSOR_TEST;
 
@@ -432,7 +431,8 @@
 }
 
 EllipticalRRectEffect::EllipticalRRectEffect(GrPrimitiveEdgeType edgeType, const SkRRect& rrect)
-        : INHERITED(kModulatesInput_OptimizationFlag), fRRect(rrect), fEdgeType(edgeType) {
+    : fRRect(rrect)
+    , fEdgeType(edgeType) {
     this->initClassID<EllipticalRRectEffect>();
 }
 
diff --git a/src/gpu/effects/GrSRGBEffect.cpp b/src/gpu/effects/GrSRGBEffect.cpp
index 9279586..67600ef 100644
--- a/src/gpu/effects/GrSRGBEffect.cpp
+++ b/src/gpu/effects/GrSRGBEffect.cpp
@@ -71,9 +71,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 GrSRGBEffect::GrSRGBEffect(Mode mode)
-        : INHERITED(kPreservesOpaqueInput_OptimizationFlag |
-                    kConstantOutputForConstantInput_OptimizationFlag)
-        , fMode(mode) {
+    : fMode(mode) {
     this->initClassID<GrSRGBEffect>();
 }
 
@@ -86,26 +84,6 @@
     inout->setToUnknown();
 }
 
-static inline float srgb_to_linear(float srgb) {
-    return (srgb <= 0.04045f) ? srgb / 12.92f : powf((srgb + 0.055f) / 1.055f, 2.4f);
-}
-static inline float linear_to_srgb(float linear) {
-    return (linear <= 0.0031308) ? linear * 12.92f : 1.055f * powf(linear, 1.f / 2.4f) - 0.055f;
-}
-
-GrColor4f GrSRGBEffect::constantOutputForConstantInput(GrColor4f input) const {
-    switch (fMode) {
-        case Mode::kLinearToSRGB:
-            return GrColor4f(linear_to_srgb(input.fRGBA[0]), linear_to_srgb(input.fRGBA[1]),
-                             linear_to_srgb(input.fRGBA[2]), input.fRGBA[3]);
-        case Mode::kSRGBToLinear:
-            return GrColor4f(srgb_to_linear(input.fRGBA[0]), srgb_to_linear(input.fRGBA[1]),
-                             srgb_to_linear(input.fRGBA[2]), input.fRGBA[3]);
-    }
-    SkFAIL("Unexpected mode");
-    return GrColor4f::TransparentBlack();
-}
-
 ///////////////////////////////////////////////////////////////////////////////
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrSRGBEffect);
diff --git a/src/gpu/effects/GrSRGBEffect.h b/src/gpu/effects/GrSRGBEffect.h
index 3d05dd6..2952689 100644
--- a/src/gpu/effects/GrSRGBEffect.h
+++ b/src/gpu/effects/GrSRGBEffect.h
@@ -33,7 +33,6 @@
     void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
     bool onIsEqual(const GrFragmentProcessor&) const override;
     void onComputeInvariantOutput(GrInvariantOutput* inout) const override;
-    GrColor4f constantOutputForConstantInput(GrColor4f input) const override;
 
     Mode fMode;
 
diff --git a/src/gpu/effects/GrSimpleTextureEffect.h b/src/gpu/effects/GrSimpleTextureEffect.h
index c44ce44..bf013e9 100644
--- a/src/gpu/effects/GrSimpleTextureEffect.h
+++ b/src/gpu/effects/GrSimpleTextureEffect.h
@@ -13,29 +13,6 @@
 
 class GrInvariantOutput;
 
-// In a few places below we rely on braced initialization order being defined by the C++ spec (left
-// to right). We use operator-> on a sk_sp and then in a later argument std::move() the sk_sp. GCC
-// 4.9.0 and earlier has a bug where the left to right order evaluation isn't implemented correctly.
-#if defined(__GNUC__) && !defined(__clang__)
-#   define GCC_VERSION (__GNUC__ * 10000  + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
-#   if (GCC_VERSION > 40900)
-#       define GCC_EVAL_ORDER_BUG 0
-#   else
-#       define GCC_EVAL_ORDER_BUG 1
-#   endif
-#   undef GCC_VERSION
-#else
-#   define GCC_EVAL_ORDER_BUG 0
-#endif
-
-#if GCC_EVAL_ORDER_BUG
-#   define PROXY_MOVE(X) (X)
-#else
-#   define PROXY_MOVE(X) (std::move(X))
-#endif
-
-#undef GCC_EVAL_ORDER_BUG
-
 /**
  * The output color of this effect is a modulation of the input color and a sample from a texture.
  * It allows explicit specification of the filtering and wrap modes (GrSamplerParams) and accepts
@@ -104,41 +81,32 @@
                           sk_sp<GrColorSpaceXform> colorSpaceXform,
                           const SkMatrix& matrix,
                           GrSamplerParams::FilterMode filterMode)
-            : INHERITED(texture, std::move(colorSpaceXform), matrix, filterMode,
-                        ModulationFlags(texture->config())) {
+        : GrSingleTextureEffect(texture, std::move(colorSpaceXform), matrix, filterMode) {
         this->initClassID<GrSimpleTextureEffect>();
     }
 
     GrSimpleTextureEffect(GrContext* ctx, sk_sp<GrTextureProxy> proxy,
-                          sk_sp<GrColorSpaceXform> colorSpaceXform, const SkMatrix& matrix,
+                          sk_sp<GrColorSpaceXform> colorSpaceXform,
+                          const SkMatrix& matrix,
                           GrSamplerParams::FilterMode filterMode)
-            : INHERITED{ctx,
-                        ModulationFlags(proxy->config()),
-                        PROXY_MOVE(proxy),
-                        std::move(colorSpaceXform),
-                        matrix,
-                        filterMode} {
+        : GrSingleTextureEffect(ctx, std::move(proxy), std::move(colorSpaceXform),
+                                matrix, filterMode) {
         this->initClassID<GrSimpleTextureEffect>();
     }
 
     GrSimpleTextureEffect(GrTexture* texture,
-                          sk_sp<GrColorSpaceXform>colorSpaceXform,
+                          sk_sp<GrColorSpaceXform> colorSpaceXform,
                           const SkMatrix& matrix,
                           const GrSamplerParams& params)
-            : INHERITED(texture, std::move(colorSpaceXform), matrix, params,
-                        ModulationFlags(texture->config())) {
+        : GrSingleTextureEffect(texture, std::move(colorSpaceXform), matrix, params) {
         this->initClassID<GrSimpleTextureEffect>();
     }
 
     GrSimpleTextureEffect(GrContext* ctx, sk_sp<GrTextureProxy> proxy,
-                          sk_sp<GrColorSpaceXform> colorSpaceXform, const SkMatrix& matrix,
+                          sk_sp<GrColorSpaceXform> colorSpaceXform,
+                          const SkMatrix& matrix,
                           const GrSamplerParams& params)
-            : INHERITED{ctx,
-                        ModulationFlags(proxy->config()),
-                        PROXY_MOVE(proxy),
-                        std::move(colorSpaceXform),
-                        matrix,
-                        params} {
+        : GrSingleTextureEffect(ctx, std::move(proxy), std::move(colorSpaceXform), matrix, params) {
         this->initClassID<GrSimpleTextureEffect>();
     }
 
@@ -155,6 +123,4 @@
     typedef GrSingleTextureEffect INHERITED;
 };
 
-#undef PROXY_MOVE
-
 #endif
diff --git a/src/gpu/effects/GrSingleTextureEffect.cpp b/src/gpu/effects/GrSingleTextureEffect.cpp
index acfc0d1..c493920 100644
--- a/src/gpu/effects/GrSingleTextureEffect.cpp
+++ b/src/gpu/effects/GrSingleTextureEffect.cpp
@@ -12,73 +12,67 @@
 
 GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture,
                                              sk_sp<GrColorSpaceXform> colorSpaceXform,
-                                             const SkMatrix& m, OptimizationFlags optFlags)
-        : INHERITED(optFlags)
-        , fCoordTransform(m, texture, GrSamplerParams::kNone_FilterMode)
-        , fTextureSampler(texture)
-        , fColorSpaceXform(std::move(colorSpaceXform)) {
-    this->addCoordTransform(&fCoordTransform);
-    this->addTextureSampler(&fTextureSampler);
-}
-
-GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture,
-                                             sk_sp<GrColorSpaceXform> colorSpaceXform,
-                                             const SkMatrix& m,
-                                             GrSamplerParams::FilterMode filterMode,
-                                             OptimizationFlags optFlags)
-        : INHERITED(optFlags)
-        , fCoordTransform(m, texture, filterMode)
-        , fTextureSampler(texture, filterMode)
-        , fColorSpaceXform(std::move(colorSpaceXform)) {
-    this->addCoordTransform(&fCoordTransform);
-    this->addTextureSampler(&fTextureSampler);
-}
-
-GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture,
-                                             sk_sp<GrColorSpaceXform> colorSpaceXform,
-                                             const SkMatrix& m, const GrSamplerParams& params,
-                                             OptimizationFlags optFlags)
-        : INHERITED(optFlags)
-        , fCoordTransform(m, texture, params.filterMode())
-        , fTextureSampler(texture, params)
-        , fColorSpaceXform(std::move(colorSpaceXform)) {
-    this->addCoordTransform(&fCoordTransform);
-    this->addTextureSampler(&fTextureSampler);
-}
-
-GrSingleTextureEffect::GrSingleTextureEffect(GrContext* ctx, OptimizationFlags optFlags,
-                                             sk_sp<GrTextureProxy> proxy,
-                                             sk_sp<GrColorSpaceXform> colorSpaceXform,
                                              const SkMatrix& m)
-        : INHERITED(optFlags)
-        , fCoordTransform(ctx, m, proxy.get(), GrSamplerParams::kNone_FilterMode)
-        , fTextureSampler(ctx->textureProvider(), std::move(proxy))
-        , fColorSpaceXform(std::move(colorSpaceXform)) {
+    : fCoordTransform(m, texture, GrSamplerParams::kNone_FilterMode)
+    , fTextureSampler(texture)
+    , fColorSpaceXform(std::move(colorSpaceXform)) {
     this->addCoordTransform(&fCoordTransform);
     this->addTextureSampler(&fTextureSampler);
 }
 
-GrSingleTextureEffect::GrSingleTextureEffect(GrContext* ctx, OptimizationFlags optFlags,
-                                             sk_sp<GrTextureProxy> proxy,
+GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture,
                                              sk_sp<GrColorSpaceXform> colorSpaceXform,
                                              const SkMatrix& m,
                                              GrSamplerParams::FilterMode filterMode)
-        : INHERITED(optFlags)
-        , fCoordTransform(ctx, m, proxy.get(), filterMode)
-        , fTextureSampler(ctx->textureProvider(), std::move(proxy), filterMode)
-        , fColorSpaceXform(std::move(colorSpaceXform)) {
+    : fCoordTransform(m, texture, filterMode)
+    , fTextureSampler(texture, filterMode)
+    , fColorSpaceXform(std::move(colorSpaceXform)) {
     this->addCoordTransform(&fCoordTransform);
     this->addTextureSampler(&fTextureSampler);
 }
 
-GrSingleTextureEffect::GrSingleTextureEffect(GrContext* ctx, OptimizationFlags optFlags,
-                                             sk_sp<GrTextureProxy> proxy,
+GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture,
                                              sk_sp<GrColorSpaceXform> colorSpaceXform,
-                                             const SkMatrix& m, const GrSamplerParams& params)
-        : INHERITED(optFlags)
-        , fCoordTransform(ctx, m, proxy.get(), params.filterMode())
-        , fTextureSampler(ctx->textureProvider(), std::move(proxy), params)
-        , fColorSpaceXform(std::move(colorSpaceXform)) {
+                                             const SkMatrix& m,
+                                             const GrSamplerParams& params)
+    : fCoordTransform(m, texture, params.filterMode())
+    , fTextureSampler(texture, params)
+    , fColorSpaceXform(std::move(colorSpaceXform)) {
     this->addCoordTransform(&fCoordTransform);
     this->addTextureSampler(&fTextureSampler);
 }
+
+GrSingleTextureEffect::GrSingleTextureEffect(GrContext* ctx, sk_sp<GrTextureProxy> proxy,
+                                             sk_sp<GrColorSpaceXform> colorSpaceXform,
+                                             const SkMatrix& m)
+    : fCoordTransform(ctx, m, proxy.get(), GrSamplerParams::kNone_FilterMode)
+    , fTextureSampler(ctx->textureProvider(), std::move(proxy))
+    , fColorSpaceXform(std::move(colorSpaceXform)) {
+    this->addCoordTransform(&fCoordTransform);
+    this->addTextureSampler(&fTextureSampler);
+}
+
+GrSingleTextureEffect::GrSingleTextureEffect(GrContext* ctx, sk_sp<GrTextureProxy> proxy,
+                                             sk_sp<GrColorSpaceXform> colorSpaceXform,
+                                             const SkMatrix& m,
+                                             GrSamplerParams::FilterMode filterMode)
+    : fCoordTransform(ctx, m, proxy.get(), filterMode)
+    , fTextureSampler(ctx->textureProvider(), std::move(proxy), filterMode)
+    , fColorSpaceXform(std::move(colorSpaceXform)) {
+    this->addCoordTransform(&fCoordTransform);
+    this->addTextureSampler(&fTextureSampler);
+}
+
+GrSingleTextureEffect::GrSingleTextureEffect(GrContext* ctx, sk_sp<GrTextureProxy> proxy,
+                                             sk_sp<GrColorSpaceXform> colorSpaceXform,
+                                             const SkMatrix& m,
+                                             const GrSamplerParams& params)
+    : fCoordTransform(ctx, m, proxy.get(), params.filterMode())
+    , fTextureSampler(ctx->textureProvider(), std::move(proxy), params)
+    , fColorSpaceXform(std::move(colorSpaceXform)) {
+    this->addCoordTransform(&fCoordTransform);
+    this->addTextureSampler(&fTextureSampler);
+}
+
+GrSingleTextureEffect::~GrSingleTextureEffect() {
+}
diff --git a/src/gpu/effects/GrSingleTextureEffect.h b/src/gpu/effects/GrSingleTextureEffect.h
index 29105b5..1d0f27a 100644
--- a/src/gpu/effects/GrSingleTextureEffect.h
+++ b/src/gpu/effects/GrSingleTextureEffect.h
@@ -23,6 +23,8 @@
  */
 class GrSingleTextureEffect : public GrFragmentProcessor {
 public:
+    ~GrSingleTextureEffect() override;
+
     SkString dumpInfo() const override {
         SkString str;
         str.appendf("Texture: %d", fTextureSampler.texture()->uniqueID().asUInt());
@@ -33,26 +35,25 @@
 
 protected:
     /** unfiltered, clamp mode */
-    GrSingleTextureEffect(GrTexture*, sk_sp<GrColorSpaceXform>, const SkMatrix&,
-                          OptimizationFlags optFlags);
+    GrSingleTextureEffect(GrTexture*, sk_sp<GrColorSpaceXform>, const SkMatrix&);
     /** clamp mode */
     GrSingleTextureEffect(GrTexture*, sk_sp<GrColorSpaceXform>, const SkMatrix&,
-                          GrSamplerParams::FilterMode filterMode, OptimizationFlags optFlags);
+                          GrSamplerParams::FilterMode filterMode);
     GrSingleTextureEffect(GrTexture*,
                           sk_sp<GrColorSpaceXform>,
                           const SkMatrix&,
-                          const GrSamplerParams&,
-                          OptimizationFlags optFlags);
+                          const GrSamplerParams&);
 
     /** unfiltered, clamp mode */
-    GrSingleTextureEffect(GrContext*, OptimizationFlags, sk_sp<GrTextureProxy>,
-                          sk_sp<GrColorSpaceXform>, const SkMatrix&);
+    GrSingleTextureEffect(GrContext*,
+                          sk_sp<GrTextureProxy>, sk_sp<GrColorSpaceXform>, const SkMatrix&);
     /** clamp mode */
-    GrSingleTextureEffect(GrContext*, OptimizationFlags, sk_sp<GrTextureProxy>,
-                          sk_sp<GrColorSpaceXform>, const SkMatrix&,
+    GrSingleTextureEffect(GrContext*,
+                          sk_sp<GrTextureProxy>, sk_sp<GrColorSpaceXform>, const SkMatrix&,
                           GrSamplerParams::FilterMode filterMode);
-    GrSingleTextureEffect(GrContext*, OptimizationFlags, sk_sp<GrTextureProxy>,
-                          sk_sp<GrColorSpaceXform>, const SkMatrix&, const GrSamplerParams&);
+    GrSingleTextureEffect(GrContext*,
+                          sk_sp<GrTextureProxy>, sk_sp<GrColorSpaceXform>, const SkMatrix&,
+                          const GrSamplerParams&);
 
     /**
      * Can be used as a helper to implement subclass onComputeInvariantOutput(). It assumes that
@@ -70,19 +71,6 @@
         }
     }
 
-    /**
-     * Can be used as a helper to implement subclass onOptimizationFlags(). It assumes that
-     * the subclass output color will be a modulation of the input color with a value read from the
-     * texture.
-     */
-    static OptimizationFlags ModulationFlags(GrPixelConfig config) {
-        if (GrPixelConfigIsOpaque(config)) {
-            return kModulatesInput_OptimizationFlag | kPreservesOpaqueInput_OptimizationFlag;
-        } else {
-            return kModulatesInput_OptimizationFlag;
-        }
-    }
-
 private:
     GrCoordTransform fCoordTransform;
     TextureSampler fTextureSampler;
diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp
index 7ab598f..095f100 100644
--- a/src/gpu/effects/GrTextureDomain.cpp
+++ b/src/gpu/effects/GrTextureDomain.cpp
@@ -208,25 +208,14 @@
     }
 }
 
-inline GrFragmentProcessor::OptimizationFlags GrTextureDomainEffect::OptFlags(
-        GrTexture* texture, GrTextureDomain::Mode mode) {
-    if (mode == GrTextureDomain::kDecal_Mode || !GrPixelConfigIsOpaque(texture->config())) {
-        return GrFragmentProcessor::kModulatesInput_OptimizationFlag;
-    } else {
-        return GrFragmentProcessor::kModulatesInput_OptimizationFlag |
-               GrFragmentProcessor::kPreservesOpaqueInput_OptimizationFlag;
-    }
-}
-
 GrTextureDomainEffect::GrTextureDomainEffect(GrTexture* texture,
                                              sk_sp<GrColorSpaceXform> colorSpaceXform,
                                              const SkMatrix& matrix,
                                              const SkRect& domain,
                                              GrTextureDomain::Mode mode,
                                              GrSamplerParams::FilterMode filterMode)
-        : GrSingleTextureEffect(texture, std::move(colorSpaceXform), matrix, filterMode,
-                                OptFlags(texture, mode))
-        , fTextureDomain(texture, domain, mode) {
+    : GrSingleTextureEffect(texture, std::move(colorSpaceXform), matrix, filterMode)
+    , fTextureDomain(texture, domain, mode) {
     SkASSERT(mode != GrTextureDomain::kRepeat_Mode ||
             filterMode == GrSamplerParams::kNone_FilterMode);
     this->initClassID<GrTextureDomainEffect>();
@@ -334,8 +323,7 @@
 
 GrDeviceSpaceTextureDecalFragmentProcessor::GrDeviceSpaceTextureDecalFragmentProcessor(
         GrTexture* texture, const SkIRect& subset, const SkIPoint& deviceSpaceOffset)
-        : INHERITED(kModulatesInput_OptimizationFlag)
-        , fTextureSampler(texture, GrSamplerParams::ClampNoFilter())
+        : fTextureSampler(texture, GrSamplerParams::ClampNoFilter())
         , fTextureDomain(texture, GrTextureDomain::MakeTexelDomain(subset),
                          GrTextureDomain::kDecal_Mode) {
     this->addTextureSampler(&fTextureSampler);
diff --git a/src/gpu/effects/GrTextureDomain.h b/src/gpu/effects/GrTextureDomain.h
index 6758d90..66bd220 100644
--- a/src/gpu/effects/GrTextureDomain.h
+++ b/src/gpu/effects/GrTextureDomain.h
@@ -178,8 +178,6 @@
                           GrTextureDomain::Mode,
                           GrSamplerParams::FilterMode);
 
-    static OptimizationFlags OptFlags(GrTexture* texture, GrTextureDomain::Mode mode);
-
     GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
 
     void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
diff --git a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
index af32ade..d984787 100644
--- a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
+++ b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
@@ -19,7 +19,7 @@
 public:
     ComposeTwoFragmentProcessor(sk_sp<GrFragmentProcessor> src, sk_sp<GrFragmentProcessor> dst,
                                 SkBlendMode mode)
-            : INHERITED(OptFlags(src.get(), dst.get(), mode)), fMode(mode) {
+        : fMode(mode) {
         this->initClassID<ComposeTwoFragmentProcessor>();
         SkDEBUGCODE(int shaderAChildIndex = )this->registerChildProcessor(std::move(src));
         SkDEBUGCODE(int shaderBChildIndex = )this->registerChildProcessor(std::move(dst));
@@ -35,18 +35,7 @@
 
     SkBlendMode getMode() const { return fMode; }
 
-private:
-    static OptimizationFlags OptFlags(const GrFragmentProcessor* src,
-                                      const GrFragmentProcessor* dst, SkBlendMode mode) {
-        // We only attempt the constant output optimization.
-        // The CPU and GPU implementations differ significantly for the advanced modes.
-        if (mode <= SkBlendMode::kLastSeparableMode && src->hasConstantOutputForConstantInput() &&
-            dst->hasConstantOutputForConstantInput()) {
-            return kConstantOutputForConstantInput_OptimizationFlag;
-        }
-        return kNone_OptimizationFlags;
-    }
-
+protected:
     bool onIsEqual(const GrFragmentProcessor& other) const override {
         const ComposeTwoFragmentProcessor& cs = other.cast<ComposeTwoFragmentProcessor>();
         return fMode == cs.fMode;
@@ -56,17 +45,7 @@
         inout->setToUnknown();
     }
 
-    GrColor4f constantOutputForConstantInput(GrColor4f input) const override {
-        float alpha = input.fRGBA[3];
-        input = input.opaque();
-        GrColor4f srcColor = ConstantOutputForConstantInput(this->childProcessor(0), input);
-        GrColor4f dstColor = ConstantOutputForConstantInput(this->childProcessor(1), input);
-        SkPM4f src = GrColor4fToSkPM4f(srcColor);
-        SkPM4f dst = GrColor4fToSkPM4f(dstColor);
-        auto proc = SkXfermode::GetProc4f(fMode);
-        return SkPM4fToGrColor4f(proc(src, dst)).mulByScalar(alpha);
-    }
-
+private:
     GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
 
     SkBlendMode fMode;
@@ -166,7 +145,8 @@
     };
 
     ComposeOneFragmentProcessor(sk_sp<GrFragmentProcessor> dst, SkBlendMode mode, Child child)
-            : INHERITED(OptFlags(dst.get(), mode)), fMode(mode), fChild(child) {
+        : fMode(mode)
+        , fChild(child) {
         this->initClassID<ComposeOneFragmentProcessor>();
         SkDEBUGCODE(int dstIndex = )this->registerChildProcessor(std::move(dst));
         SkASSERT(0 == dstIndex);
@@ -192,16 +172,7 @@
 
     Child child() const { return fChild; }
 
-private:
-    OptimizationFlags OptFlags(const GrFragmentProcessor* child, SkBlendMode mode) {
-        // We only attempt the constant output optimization.
-        // The CPU and GPU implementations differ significantly for the advanced modes.
-        if (mode <= SkBlendMode::kLastSeparableMode && child->hasConstantOutputForConstantInput()) {
-            return kConstantOutputForConstantInput_OptimizationFlag;
-        }
-        return kNone_OptimizationFlags;
-    }
-
+protected:
     bool onIsEqual(const GrFragmentProcessor& that) const override {
         return fMode == that.cast<ComposeOneFragmentProcessor>().fMode;
     }
@@ -232,21 +203,6 @@
         }
     }
 
-    GrColor4f constantOutputForConstantInput(GrColor4f inputColor) const override {
-        GrColor4f childColor =
-                ConstantOutputForConstantInput(this->childProcessor(0), GrColor4f::OpaqueWhite());
-        SkPM4f src, dst;
-        if (kSrc_Child == fChild) {
-            src = GrColor4fToSkPM4f(childColor);
-            dst = GrColor4fToSkPM4f(inputColor);
-        } else {
-            src = GrColor4fToSkPM4f(inputColor);
-            dst = GrColor4fToSkPM4f(childColor);
-        }
-        auto proc = SkXfermode::GetProc4f(fMode);
-        return SkPM4fToGrColor4f(proc(src, dst));
-    }
-
 private:
     GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
 
diff --git a/src/gpu/effects/GrYUVEffect.cpp b/src/gpu/effects/GrYUVEffect.cpp
index 6d917f3..254cdff 100644
--- a/src/gpu/effects/GrYUVEffect.cpp
+++ b/src/gpu/effects/GrYUVEffect.cpp
@@ -155,17 +155,19 @@
     };
 
 private:
-    YUVtoRGBEffect(GrContext* ctx, sk_sp<GrTextureProxy> yProxy, sk_sp<GrTextureProxy> uProxy,
-                   sk_sp<GrTextureProxy> vProxy, const SkMatrix yuvMatrix[3],
-                   GrSamplerParams::FilterMode uvFilterMode, SkYUVColorSpace colorSpace, bool nv12)
-            : INHERITED(kPreservesOpaqueInput_OptimizationFlag)
-            , fYTransform(ctx, yuvMatrix[0], yProxy.get(), GrSamplerParams::kNone_FilterMode)
-            , fYSampler(ctx->textureProvider(), std::move(yProxy))
-            , fUTransform(ctx, yuvMatrix[1], uProxy.get(), uvFilterMode)
-            , fUSampler(ctx->textureProvider(), std::move(uProxy), uvFilterMode)
-            , fVSampler(ctx->textureProvider(), vProxy, uvFilterMode)
-            , fColorSpace(colorSpace)
-            , fNV12(nv12) {
+    YUVtoRGBEffect(GrContext* ctx,
+                   sk_sp<GrTextureProxy> yProxy,
+                   sk_sp<GrTextureProxy> uProxy,
+                   sk_sp<GrTextureProxy> vProxy,
+                   const SkMatrix yuvMatrix[3], GrSamplerParams::FilterMode uvFilterMode,
+                   SkYUVColorSpace colorSpace, bool nv12)
+        : fYTransform(ctx, yuvMatrix[0], yProxy.get(), GrSamplerParams::kNone_FilterMode)
+        , fYSampler(ctx->textureProvider(), std::move(yProxy))
+        , fUTransform(ctx, yuvMatrix[1], uProxy.get(), uvFilterMode)
+        , fUSampler(ctx->textureProvider(), std::move(uProxy), uvFilterMode)
+        , fVSampler(ctx->textureProvider(), vProxy, uvFilterMode)
+        , fColorSpace(colorSpace)
+        , fNV12(nv12) {
         this->initClassID<YUVtoRGBEffect>();
         this->addCoordTransform(&fYTransform);
         this->addTextureSampler(&fYSampler);
@@ -226,10 +228,8 @@
 
     RGBToYUVEffect(sk_sp<GrFragmentProcessor> rgbFP, SkYUVColorSpace colorSpace,
                    OutputChannels output)
-            // This could advertise kConstantOutputForConstantInput, but doesn't seem useful.
-            : INHERITED(kPreservesOpaqueInput_OptimizationFlag)
-            , fColorSpace(colorSpace)
-            , fOutputChannels(output) {
+        : fColorSpace(colorSpace)
+        , fOutputChannels(output) {
         this->initClassID<RGBToYUVEffect>();
         this->registerChildProcessor(std::move(rgbFP));
     }