removing GrDrawEffect

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/8ddbe8b9366c8c59c4fb55f01f253de8a0b37d6e

R=bsalomon@google.com

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/571163002
diff --git a/src/gpu/effects/GrBezierEffect.cpp b/src/gpu/effects/GrBezierEffect.cpp
index 8c85809..1b4191c 100644
--- a/src/gpu/effects/GrBezierEffect.cpp
+++ b/src/gpu/effects/GrBezierEffect.cpp
@@ -15,19 +15,19 @@
 
 class GrGLConicEffect : public GrGLGeometryProcessor {
 public:
-    GrGLConicEffect(const GrBackendEffectFactory&, const GrDrawEffect&);
+    GrGLConicEffect(const GrBackendEffectFactory&, const GrEffect&);
 
     virtual void emitCode(GrGLFullProgramBuilder* builder,
-                          const GrDrawEffect& drawEffect,
+                          const GrEffect& effect,
                           const GrEffectKey& key,
                           const char* outputColor,
                           const char* inputColor,
                           const TransformedCoordsArray&,
                           const TextureSamplerArray&) SK_OVERRIDE;
 
-    static inline void GenKey(const GrDrawEffect&, const GrGLCaps&, GrEffectKeyBuilder*);
+    static inline void GenKey(const GrEffect&, const GrGLCaps&, GrEffectKeyBuilder*);
 
-    virtual void setData(const GrGLProgramDataManager&, const GrDrawEffect&) SK_OVERRIDE {}
+    virtual void setData(const GrGLProgramDataManager&, const GrEffect&) SK_OVERRIDE {}
 
 private:
     GrEffectEdgeType fEdgeType;
@@ -36,14 +36,14 @@
 };
 
 GrGLConicEffect::GrGLConicEffect(const GrBackendEffectFactory& factory,
-                                 const GrDrawEffect& drawEffect)
+                                 const GrEffect& effect)
     : INHERITED (factory) {
-    const GrConicEffect& ce = drawEffect.castEffect<GrConicEffect>();
+    const GrConicEffect& ce = effect.cast<GrConicEffect>();
     fEdgeType = ce.getEdgeType();
 }
 
 void GrGLConicEffect::emitCode(GrGLFullProgramBuilder* builder,
-                               const GrDrawEffect& drawEffect,
+                               const GrEffect& effect,
                                const GrEffectKey& key,
                                const char* outputColor,
                                const char* inputColor,
@@ -54,7 +54,7 @@
     builder->addVarying(kVec4f_GrSLType, "ConicCoeffs",
                               &vsName, &fsName);
 
-    const GrShaderVar& inConicCoeffs = drawEffect.castEffect<GrConicEffect>().inConicCoeffs();
+    const GrShaderVar& inConicCoeffs = effect.cast<GrConicEffect>().inConicCoeffs();
     GrGLVertexShaderBuilder* vsBuilder = builder->getVertexShaderBuilder();
     vsBuilder->codeAppendf("%s = %s;", vsName, inConicCoeffs.c_str());
 
@@ -119,9 +119,9 @@
                            (GrGLSLExpr4(inputColor) * GrGLSLExpr1("edgeAlpha")).c_str());
 }
 
-void GrGLConicEffect::GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&,
+void GrGLConicEffect::GenKey(const GrEffect& effect, const GrGLCaps&,
                              GrEffectKeyBuilder* b) {
-    const GrConicEffect& ce = drawEffect.castEffect<GrConicEffect>();
+    const GrConicEffect& ce = effect.cast<GrConicEffect>();
     uint32_t key = ce.isAntiAliased() ? (ce.isFilled() ? 0x0 : 0x1) : 0x2;
     b->add32(key);
 }
@@ -142,7 +142,7 @@
 }
 
 bool GrConicEffect::onIsEqual(const GrEffect& other) const {
-    const GrConicEffect& ce = CastEffect<GrConicEffect>(other);
+    const GrConicEffect& ce = other.cast<GrConicEffect>();
     return (ce.fEdgeType == fEdgeType);
 }
 
@@ -169,19 +169,19 @@
 
 class GrGLQuadEffect : public GrGLGeometryProcessor {
 public:
-    GrGLQuadEffect(const GrBackendEffectFactory&, const GrDrawEffect&);
+    GrGLQuadEffect(const GrBackendEffectFactory&, const GrEffect&);
 
     virtual void emitCode(GrGLFullProgramBuilder* builder,
-                          const GrDrawEffect& drawEffect,
+                          const GrEffect& effect,
                           const GrEffectKey& key,
                           const char* outputColor,
                           const char* inputColor,
                           const TransformedCoordsArray&,
                           const TextureSamplerArray&) SK_OVERRIDE;
 
-    static inline void GenKey(const GrDrawEffect&, const GrGLCaps&, GrEffectKeyBuilder*);
+    static inline void GenKey(const GrEffect&, const GrGLCaps&, GrEffectKeyBuilder*);
 
-    virtual void setData(const GrGLProgramDataManager&, const GrDrawEffect&) SK_OVERRIDE {}
+    virtual void setData(const GrGLProgramDataManager&, const GrEffect&) SK_OVERRIDE {}
 
 private:
     GrEffectEdgeType fEdgeType;
@@ -190,14 +190,14 @@
 };
 
 GrGLQuadEffect::GrGLQuadEffect(const GrBackendEffectFactory& factory,
-                                 const GrDrawEffect& drawEffect)
+                                 const GrEffect& effect)
     : INHERITED (factory) {
-    const GrQuadEffect& ce = drawEffect.castEffect<GrQuadEffect>();
+    const GrQuadEffect& ce = effect.cast<GrQuadEffect>();
     fEdgeType = ce.getEdgeType();
 }
 
 void GrGLQuadEffect::emitCode(GrGLFullProgramBuilder* builder,
-                              const GrDrawEffect& drawEffect,
+                              const GrEffect& effect,
                               const GrEffectKey& key,
                               const char* outputColor,
                               const char* inputColor,
@@ -207,7 +207,7 @@
     builder->addVarying(kVec4f_GrSLType, "HairQuadEdge", &vsName, &fsName);
 
     GrGLVertexShaderBuilder* vsBuilder = builder->getVertexShaderBuilder();
-    const GrShaderVar& inHairQuadEdge = drawEffect.castEffect<GrQuadEffect>().inHairQuadEdge();
+    const GrShaderVar& inHairQuadEdge = effect.cast<GrQuadEffect>().inHairQuadEdge();
     vsBuilder->codeAppendf("%s = %s;", vsName, inHairQuadEdge.c_str());
 
     GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
@@ -257,9 +257,9 @@
                            (GrGLSLExpr4(inputColor) * GrGLSLExpr1("edgeAlpha")).c_str());
 }
 
-void GrGLQuadEffect::GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&,
+void GrGLQuadEffect::GenKey(const GrEffect& effect, const GrGLCaps&,
                             GrEffectKeyBuilder* b) {
-    const GrQuadEffect& ce = drawEffect.castEffect<GrQuadEffect>();
+    const GrQuadEffect& ce = effect.cast<GrQuadEffect>();
     uint32_t key = ce.isAntiAliased() ? (ce.isFilled() ? 0x0 : 0x1) : 0x2;
     b->add32(key);
 }
@@ -280,7 +280,7 @@
 }
 
 bool GrQuadEffect::onIsEqual(const GrEffect& other) const {
-    const GrQuadEffect& ce = CastEffect<GrQuadEffect>(other);
+    const GrQuadEffect& ce = other.cast<GrQuadEffect>();
     return (ce.fEdgeType == fEdgeType);
 }
 
@@ -307,19 +307,19 @@
 
 class GrGLCubicEffect : public GrGLGeometryProcessor {
 public:
-    GrGLCubicEffect(const GrBackendEffectFactory&, const GrDrawEffect&);
+    GrGLCubicEffect(const GrBackendEffectFactory&, const GrEffect&);
 
     virtual void emitCode(GrGLFullProgramBuilder* builder,
-                          const GrDrawEffect& drawEffect,
+                          const GrEffect& effect,
                           const GrEffectKey& key,
                           const char* outputColor,
                           const char* inputColor,
                           const TransformedCoordsArray&,
                           const TextureSamplerArray&) SK_OVERRIDE;
 
-    static inline void GenKey(const GrDrawEffect&, const GrGLCaps&, GrEffectKeyBuilder*);
+    static inline void GenKey(const GrEffect&, const GrGLCaps&, GrEffectKeyBuilder*);
 
-    virtual void setData(const GrGLProgramDataManager&, const GrDrawEffect&) SK_OVERRIDE {}
+    virtual void setData(const GrGLProgramDataManager&, const GrEffect&) SK_OVERRIDE {}
 
 private:
     GrEffectEdgeType fEdgeType;
@@ -328,14 +328,14 @@
 };
 
 GrGLCubicEffect::GrGLCubicEffect(const GrBackendEffectFactory& factory,
-                                 const GrDrawEffect& drawEffect)
+                                 const GrEffect& effect)
     : INHERITED (factory) {
-    const GrCubicEffect& ce = drawEffect.castEffect<GrCubicEffect>();
+    const GrCubicEffect& ce = effect.cast<GrCubicEffect>();
     fEdgeType = ce.getEdgeType();
 }
 
 void GrGLCubicEffect::emitCode(GrGLFullProgramBuilder* builder,
-                               const GrDrawEffect& drawEffect,
+                               const GrEffect& effect,
                                const GrEffectKey& key,
                                const char* outputColor,
                                const char* inputColor,
@@ -347,7 +347,7 @@
                               &vsName, &fsName, GrGLShaderVar::kHigh_Precision);
 
     GrGLVertexShaderBuilder* vsBuilder = builder->getVertexShaderBuilder();
-    const GrShaderVar& inCubicCoeffs = drawEffect.castEffect<GrCubicEffect>().inCubicCoeffs();
+    const GrShaderVar& inCubicCoeffs = effect.cast<GrCubicEffect>().inCubicCoeffs();
     vsBuilder->codeAppendf("%s = %s;", vsName, inCubicCoeffs.c_str());
 
     GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
@@ -437,9 +437,9 @@
                            (GrGLSLExpr4(inputColor) * GrGLSLExpr1(edgeAlpha.c_str())).c_str());
 }
 
-void GrGLCubicEffect::GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&,
+void GrGLCubicEffect::GenKey(const GrEffect& effect, const GrGLCaps&,
                              GrEffectKeyBuilder* b) {
-    const GrCubicEffect& ce = drawEffect.castEffect<GrCubicEffect>();
+    const GrCubicEffect& ce = effect.cast<GrCubicEffect>();
     uint32_t key = ce.isAntiAliased() ? (ce.isFilled() ? 0x0 : 0x1) : 0x2;
     b->add32(key);
 }
@@ -460,7 +460,7 @@
 }
 
 bool GrCubicEffect::onIsEqual(const GrEffect& other) const {
-    const GrCubicEffect& ce = CastEffect<GrCubicEffect>(other);
+    const GrCubicEffect& ce = other.cast<GrCubicEffect>();
     return (ce.fEdgeType == fEdgeType);
 }