Clean up GrGLSLFragmentProcessor-derived classes
authorrobertphillips <robertphillips@google.com>
Wed, 3 Feb 2016 20:25:40 +0000 (12:25 -0800)
committerCommit bot <commit-bot@chromium.org>
Wed, 3 Feb 2016 20:25:40 +0000 (12:25 -0800)
In some other patches it was observed that many of the GrGLSLFragmentProcessor-derived classes needlessly pass a parameter to their constructors.

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1666773002

Review URL: https://codereview.chromium.org/1666773002

30 files changed:
src/core/SkColorMatrixFilterRowMajor255.cpp
src/effects/GrCircleBlurFragmentProcessor.cpp
src/effects/SkAlphaThresholdFilter.cpp
src/effects/SkArithmeticMode_gpu.cpp
src/effects/SkBlurMaskFilter.cpp
src/effects/SkColorCubeFilter.cpp
src/effects/SkDisplacementMapEffect.cpp
src/effects/SkLumaColorFilter.cpp
src/effects/SkMagnifierImageFilter.cpp
src/effects/SkMorphologyImageFilter.cpp
src/effects/SkPerlinNoiseShader.cpp
src/effects/SkPixelXorXfermode.cpp
src/effects/SkTableColorFilter.cpp
src/effects/gradients/SkGradientShader.cpp
src/effects/gradients/SkGradientShaderPriv.h
src/gpu/GrFragmentProcessor.cpp
src/gpu/effects/GrBicubicEffect.cpp
src/gpu/effects/GrConfigConversionEffect.cpp
src/gpu/effects/GrConvexPolyEffect.cpp
src/gpu/effects/GrConvolutionEffect.cpp
src/gpu/effects/GrDitherEffect.cpp
src/gpu/effects/GrMatrixConvolutionEffect.cpp
src/gpu/effects/GrOvalEffect.cpp
src/gpu/effects/GrRRectEffect.cpp
src/gpu/effects/GrSimpleTextureEffect.cpp
src/gpu/effects/GrTextureDomain.cpp
src/gpu/effects/GrXfermodeFragmentProcessor.cpp
src/gpu/effects/GrYUVEffect.cpp
src/utils/debugger/SkOverdrawMode.cpp
tests/GLProgramsTest.cpp

index 9106a279c0802fc9830b6bf63038d10c7d58e429..b9508ff2c7f3328b5ea32d0f4c06bb02fd414197 100644 (file)
@@ -253,11 +253,9 @@ public:
     class GLSLProcessor : public GrGLSLFragmentProcessor {
     public:
         // this class always generates the same code.
-        static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder* b) {}
+        static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*) {}
 
-        GLSLProcessor(const GrProcessor&) {}
-
-        virtual void emitCode(EmitArgs& args) override {
+        void emitCode(EmitArgs& args) override {
             GrGLSLUniformHandler* uniformHandler = args.fUniformHandler;
             fMatrixHandle = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility,
                                                        kMat44f_GrSLType, kDefault_GrSLPrecision,
@@ -286,8 +284,8 @@ public:
         }
 
     protected:
-        virtual void onSetData(const GrGLSLProgramDataManager& uniManager,
-                               const GrProcessor& proc) override {
+        void onSetData(const GrGLSLProgramDataManager& uniManager,
+                       const GrProcessor& proc) override {
             const ColorMatrixEffect& cme = proc.cast<ColorMatrixEffect>();
             const float* m = cme.fMatrix;
             // The GL matrix is transposed from SkColorMatrix.
@@ -319,7 +317,7 @@ private:
     }
 
     GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
-        return new GLSLProcessor(*this);
+        return new GLSLProcessor;
     }
 
     virtual void onGetGLSLProcessorKey(const GrGLSLCaps& caps,
index 83faa86fa2df834efa734cb819d7e9e1c691a200..decb3c2d5e855f33312aae2ffe3dc73c71d3544d 100644 (file)
@@ -21,7 +21,6 @@
 
 class GrGLCircleBlurFragmentProcessor : public GrGLSLFragmentProcessor {
 public:
-    GrGLCircleBlurFragmentProcessor(const GrProcessor&) {}
     void emitCode(EmitArgs&) override;
 
 protected:
@@ -100,7 +99,7 @@ GrCircleBlurFragmentProcessor::GrCircleBlurFragmentProcessor(const SkRect& circl
 }
 
 GrGLSLFragmentProcessor* GrCircleBlurFragmentProcessor::onCreateGLSLInstance() const {
-    return new GrGLCircleBlurFragmentProcessor(*this);
+    return new GrGLCircleBlurFragmentProcessor;
 }
 
 void GrCircleBlurFragmentProcessor::onGetGLSLProcessorKey(const GrGLSLCaps& caps,
index 6cadbc3e5185fe178890bc1613938cdf7995f62d..71d9aa2077cdf92b995d84c0f7fb9d6f53966f49 100644 (file)
@@ -143,9 +143,7 @@ private:
 
 class GrGLAlphaThresholdEffect : public GrGLSLFragmentProcessor {
 public:
-    GrGLAlphaThresholdEffect(const GrFragmentProcessor&) {}
-
-    virtual void emitCode(EmitArgs&) override;
+    void emitCode(EmitArgs&) override;
 
 protected:
     void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) override;
@@ -237,7 +235,7 @@ void AlphaThresholdEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLSLFragmentProcessor* AlphaThresholdEffect::onCreateGLSLInstance() const {
-    return new GrGLAlphaThresholdEffect(*this);
+    return new GrGLAlphaThresholdEffect;
 }
 
 bool AlphaThresholdEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
index 29c6602146db3c1504418923e419f1d45aba9991..709f59d3d68b05255ed6870e077e348d68f186a1 100644 (file)
@@ -55,12 +55,9 @@ static void add_arithmetic_code(GrGLSLFragmentBuilder* fragBuilder,
 
 class GLArithmeticFP : public GrGLSLFragmentProcessor {
 public:
-    GLArithmeticFP(const GrArithmeticFP& arithmeticFP)
-        : fEnforcePMColor(arithmeticFP.enforcePMColor()) {}
-
-    ~GLArithmeticFP() override {}
-
     void emitCode(EmitArgs& args) override {
+        const GrArithmeticFP& arith = args.fFp.cast<GrArithmeticFP>();
+
         GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
         SkString dstColor("dstColor");
         this->emitChild(0, nullptr, &dstColor, args);
@@ -75,7 +72,7 @@ public:
                             dstColor.c_str(),
                             args.fOutputColor,
                             kUni,
-                            fEnforcePMColor);
+                            arith.enforcePMColor());
     }
 
     static void GenKey(const GrProcessor& proc, const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) {
@@ -88,12 +85,10 @@ protected:
     void onSetData(const GrGLSLProgramDataManager& pdman, const GrProcessor& proc) override {
         const GrArithmeticFP& arith = proc.cast<GrArithmeticFP>();
         pdman.set4f(fKUni, arith.k1(), arith.k2(), arith.k3(), arith.k4());
-        fEnforcePMColor = arith.enforcePMColor();
     }
 
 private:
     GrGLSLProgramDataManager::UniformHandle fKUni;
-    bool fEnforcePMColor;
 
     typedef GrGLSLFragmentProcessor INHERITED;
 };
@@ -115,7 +110,7 @@ void GrArithmeticFP::onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKe
 }
 
 GrGLSLFragmentProcessor* GrArithmeticFP::onCreateGLSLInstance() const {
-    return new GLArithmeticFP(*this);
+    return new GLArithmeticFP;
 }
 
 bool GrArithmeticFP::onIsEqual(const GrFragmentProcessor& fpBase) const {
index be0c8166e2cf06ad816586c6acc40a2dd3a9e9d0..d55c669e74da8c858a78ca663be50c0989a05828 100644 (file)
@@ -1043,9 +1043,7 @@ const GrFragmentProcessor* GrRRectBlurEffect::TestCreate(GrProcessorTestData* d)
 
 class GrGLRRectBlurEffect : public GrGLSLFragmentProcessor {
 public:
-    GrGLRRectBlurEffect(const GrProcessor&) {}
-
-    virtual void emitCode(EmitArgs&) override;
+    void emitCode(EmitArgs&) override;
 
 protected:
     void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) override;
@@ -1138,7 +1136,7 @@ void GrRRectBlurEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLSLFragmentProcessor* GrRRectBlurEffect::onCreateGLSLInstance() const {
-    return new GrGLRRectBlurEffect(*this);
+    return new GrGLRRectBlurEffect;
 }
 
 bool SkBlurMaskFilterImpl::directFilterRRectMaskGPU(GrTextureProvider* texProvider,
index 5f1f10d53f020f5192ba5c84c4f1e7a9fa714b5e..255c59074e66110764dcb51b6aa40677eff95bb0 100644 (file)
@@ -177,10 +177,7 @@ public:
 
     class GLSLProcessor : public GrGLSLFragmentProcessor {
     public:
-        GLSLProcessor(const GrProcessor&);
-        virtual ~GLSLProcessor();
-
-        virtual void emitCode(EmitArgs&) override;
+        void emitCode(EmitArgs&) override;
 
         static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*);
 
@@ -226,7 +223,7 @@ void GrColorCubeEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLSLFragmentProcessor* GrColorCubeEffect::onCreateGLSLInstance() const {
-    return new GLSLProcessor(*this);
+    return new GLSLProcessor;
 }
 
 void GrColorCubeEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const {
@@ -235,12 +232,6 @@ void GrColorCubeEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const
 
 ///////////////////////////////////////////////////////////////////////////////
 
-GrColorCubeEffect::GLSLProcessor::GLSLProcessor(const GrProcessor&) {
-}
-
-GrColorCubeEffect::GLSLProcessor::~GLSLProcessor() {
-}
-
 void GrColorCubeEffect::GLSLProcessor::emitCode(EmitArgs& args) {
     if (nullptr == args.fInputColor) {
         args.fInputColor = "vec4(1)";
index 41f1a6db71678fa8b0cb1afb6b4ffaafc53522b5..e861d5836fee966ba1380539e2638ae542e629b9 100644 (file)
@@ -313,9 +313,8 @@ void SkDisplacementMapEffect::toString(SkString* str) const {
 class GrGLDisplacementMapEffect : public GrGLSLFragmentProcessor {
 public:
     GrGLDisplacementMapEffect(const GrProcessor&);
-    virtual ~GrGLDisplacementMapEffect();
 
-    virtual void emitCode(EmitArgs&) override;
+    void emitCode(EmitArgs&) override;
 
     static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*);
 
@@ -548,9 +547,6 @@ GrGLDisplacementMapEffect::GrGLDisplacementMapEffect(const GrProcessor& proc)
     , fYChannelSelector(proc.cast<GrDisplacementMapEffect>().yChannelSelector()) {
 }
 
-GrGLDisplacementMapEffect::~GrGLDisplacementMapEffect() {
-}
-
 void GrGLDisplacementMapEffect::emitCode(EmitArgs& args) {
     const GrTextureDomain& domain = args.fFp.cast<GrDisplacementMapEffect>().domain();
 
index acdebf8418b7cd382dc051a5b1ec4bc4ac796d80..46d02aa6b34fa89f32e60f9e88d33e1e020c2196 100644 (file)
@@ -62,11 +62,9 @@ public:
 
     class GLSLProcessor : public GrGLSLFragmentProcessor {
     public:
-        GLSLProcessor(const GrProcessor&) {}
-
         static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder* b) {}
 
-        virtual void emitCode(EmitArgs& args) override {
+        void emitCode(EmitArgs& args) override {
             if (nullptr == args.fInputColor) {
                 args.fInputColor = "vec4(1)";
             }
@@ -92,7 +90,7 @@ private:
     }
 
     GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
-        return new GLSLProcessor(*this);
+        return new GLSLProcessor;
     }
 
     virtual void onGetGLSLProcessorKey(const GrGLSLCaps& caps,
index 45f630a0858b8f9745e3a47577fd7e46853eba06..734002dfaea4cb68c7f227d799a24c1cdab8f25e 100644 (file)
@@ -100,9 +100,7 @@ typedef GrGLSLProgramDataManager::UniformHandle UniformHandle;
 
 class GrGLMagnifierEffect : public GrGLSLFragmentProcessor {
 public:
-    GrGLMagnifierEffect(const GrProcessor&);
-
-    virtual void emitCode(EmitArgs&) override;
+    void emitCode(EmitArgs&) override;
 
 protected:
     void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) override;
@@ -116,9 +114,6 @@ private:
     typedef GrGLSLFragmentProcessor INHERITED;
 };
 
-GrGLMagnifierEffect::GrGLMagnifierEffect(const GrProcessor&) {
-}
-
 void GrGLMagnifierEffect::emitCode(EmitArgs& args) {
     GrGLSLUniformHandler* uniformHandler = args.fUniformHandler;
     fOffsetVar = uniformHandler->addUniform(GrGLSLUniformHandler::kFragment_Visibility,
@@ -187,7 +182,7 @@ void GrMagnifierEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLSLFragmentProcessor* GrMagnifierEffect::onCreateGLSLInstance() const {
-    return new GrGLMagnifierEffect(*this);
+    return new GrGLMagnifierEffect;
 }
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrMagnifierEffect);
index 3f6bc947cfcbc0f209496593b1e0770bca37c242..0a4bc2add61ff5bcedad141177cdcff38a41f1e1 100644 (file)
@@ -255,7 +255,7 @@ class GrGLMorphologyEffect : public GrGLSLFragmentProcessor {
 public:
     GrGLMorphologyEffect(const GrProcessor&);
 
-    virtual void emitCode(EmitArgs&) override;
+    void emitCode(EmitArgs&) override;
 
     static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder* b);
 
index 60e96017b2c903c696d084e3379cd4575f2fbd29..f66655ce3f48d7823cae3a0fbba6795a862174c7 100644 (file)
@@ -473,9 +473,8 @@ void SkPerlinNoiseShader::PerlinNoiseShaderContext::shadeSpan(
 class GrGLPerlinNoise : public GrGLSLFragmentProcessor {
 public:
     GrGLPerlinNoise(const GrProcessor&);
-    virtual ~GrGLPerlinNoise() {}
 
-    virtual void emitCode(EmitArgs&) override;
+    void emitCode(EmitArgs&) override;
 
     static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder* b);
 
@@ -490,7 +489,6 @@ private:
     int                                     fNumOctaves;
     GrGLSLProgramDataManager::UniformHandle fBaseFrequencyUni;
 
-private:
     typedef GrGLSLFragmentProcessor INHERITED;
 };
 
index 2eb42942cdd9a0db6262dba863ae83a252615eb4..833eecd85940f4fd6c37856d863d2edb691f04dc 100644 (file)
@@ -171,10 +171,6 @@ private:
 
 class GLPixelXorFP : public GrGLSLFragmentProcessor {
 public:
-    GLPixelXorFP(const PixelXorFP&) {}
-
-    ~GLPixelXorFP() override {}
-
     void emitCode(EmitArgs& args) override {
         GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
         SkString dstColor("dstColor");
@@ -209,7 +205,7 @@ private:
 ///////////////////////////////////////////////////////////////////////////////
 
 GrGLSLFragmentProcessor* PixelXorFP::onCreateGLSLInstance() const {
-    return new GLPixelXorFP(*this);
+    return new GLPixelXorFP;
 }
 
 void PixelXorFP::onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const {
index d9c07e254cc60416f7c7287380e75b3cd8f83752..c06e4363bf331a9fe01fcf5ccd7b35ab91cca97b 100644 (file)
@@ -377,9 +377,7 @@ private:
 
 class GLColorTableEffect : public GrGLSLFragmentProcessor {
 public:
-    GLColorTableEffect(const GrProcessor&);
-
-    virtual void emitCode(EmitArgs&) override;
+    void emitCode(EmitArgs&) override;
 
     static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder* b) {}
 
@@ -391,9 +389,6 @@ private:
     typedef GrGLSLFragmentProcessor INHERITED;
 };
 
-GLColorTableEffect::GLColorTableEffect(const GrProcessor&) {
-}
-
 void GLColorTableEffect::onSetData(const GrGLSLProgramDataManager& pdm, const GrProcessor& proc) {
     // The textures are organized in a strip where the rows are ordered a, r, g, b.
     float rgbaYValues[4];
@@ -507,7 +502,7 @@ void ColorTableEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLSLFragmentProcessor* ColorTableEffect::onCreateGLSLInstance() const {
-    return new GLColorTableEffect(*this);
+    return new GLColorTableEffect;
 }
 
 bool ColorTableEffect::onIsEqual(const GrFragmentProcessor& other) const {
index ac70bc25e1126fdd8cd618dba62e50176c86f9dd..03ebfd657ba7b581811be2a5f120253672a6cc1c 100644 (file)
@@ -913,8 +913,6 @@ GrGLGradientEffect::GrGLGradientEffect()
     : fCachedYCoord(SK_ScalarMax) {
 }
 
-GrGLGradientEffect::~GrGLGradientEffect() { }
-
 void GrGLGradientEffect::emitUniforms(GrGLSLUniformHandler* uniformHandler,
                                       const GrGradientEffect& ge) {
 
index f8a968d1a2516e54ab8d30b34e2fde5e368532fc..601ac026a9e6d8589c818f7a39ce6f7454563b97 100644 (file)
@@ -404,7 +404,6 @@ private:
 class GrGLGradientEffect : public GrGLSLFragmentProcessor {
 public:
     GrGLGradientEffect();
-    virtual ~GrGLGradientEffect();
 
 protected:
     void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) override;
index f05b7aa0845aa8781b9065811394d99d1d9e0111..ca2298c663c796ce0a728c0773ab78876efd6ab4 100644 (file)
@@ -152,8 +152,6 @@ const GrFragmentProcessor* GrFragmentProcessor::MulOutputByInputUnpremulColor(
         GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
             class GLFP : public GrGLSLFragmentProcessor {
             public:
-                GLFP() {}
-
                 void emitCode(EmitArgs& args) override {
                     GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
                     this->emitChild(0, nullptr, args);
@@ -304,7 +302,6 @@ const GrFragmentProcessor* GrFragmentProcessor::RunInSeries(const GrFragmentProc
         GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
             class GLFP : public GrGLSLFragmentProcessor {
             public:
-                GLFP() {}
                 void emitCode(EmitArgs& args) override {
                     SkString input(args.fInputColor);
                     for (int i = 0; i < this->numChildProcessors() - 1; ++i) {
index 37ac4ab766344bd93133062ef06627eb78d4ca6f..cc38d626a9fbb6819bbf9d0885c8ea4b901c9030 100644 (file)
@@ -23,9 +23,7 @@ const SkScalar GrBicubicEffect::gMitchellCoefficients[16] = {
 
 class GrGLBicubicEffect : public GrGLSLFragmentProcessor {
 public:
-    GrGLBicubicEffect(const GrProcessor&);
-
-    virtual void emitCode(EmitArgs&) override;
+    void emitCode(EmitArgs&) override;
 
     static inline void GenKey(const GrProcessor& effect, const GrGLSLCaps&,
                               GrProcessorKeyBuilder* b) {
@@ -46,9 +44,6 @@ private:
     typedef GrGLSLFragmentProcessor INHERITED;
 };
 
-GrGLBicubicEffect::GrGLBicubicEffect(const GrProcessor&) {
-}
-
 void GrGLBicubicEffect::emitCode(EmitArgs& args) {
     const GrTextureDomain& domain = args.fFp.cast<GrBicubicEffect>().domain();
 
@@ -168,7 +163,7 @@ void GrBicubicEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLSLFragmentProcessor* GrBicubicEffect::onCreateGLSLInstance() const  {
-    return new GrGLBicubicEffect(*this);
+    return new GrGLBicubicEffect;
 }
 
 bool GrBicubicEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
index 5ac86a96756eba7266fbe44ada8a20bc18dfbe8a..ace736c49425ed996e4cefd3ce7ff574c116a605 100644 (file)
@@ -16,9 +16,7 @@
 
 class GrGLConfigConversionEffect : public GrGLSLFragmentProcessor {
 public:
-    GrGLConfigConversionEffect() {}
-
-    virtual void emitCode(EmitArgs& args) override {
+    void emitCode(EmitArgs& args) override {
         const GrConfigConversionEffect& cce = args.fFp.cast<GrConfigConversionEffect>();
         const GrSwizzle& swizzle = cce.swizzle();
         GrConfigConversionEffect::PMConversion pmConversion = cce.pmConversion();
index dc7a5285013eeaf1b0234e30c98147e00d77411a..f95d1a2fb3d1e060b4e0163924e6584fc34d277c 100644 (file)
@@ -81,9 +81,11 @@ const GrFragmentProcessor* AARectEffect::TestCreate(GrProcessorTestData* d) {
 
 class GLAARectEffect : public GrGLSLFragmentProcessor {
 public:
-    GLAARectEffect(const GrProcessor&);
+    GLAARectEffect() {
+        fPrevRect.fLeft = SK_ScalarNaN;
+    }
 
-    virtual void emitCode(EmitArgs&) override;
+    void emitCode(EmitArgs&) override;
 
     static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*);
 
@@ -96,10 +98,6 @@ private:
     typedef GrGLSLFragmentProcessor INHERITED;
 };
 
-GLAARectEffect::GLAARectEffect(const GrProcessor& effect) {
-    fPrevRect.fLeft = SK_ScalarNaN;
-}
-
 void GLAARectEffect::emitCode(EmitArgs& args) {
     const AARectEffect& aare = args.fFp.cast<AARectEffect>();
     const char *rectName;
@@ -161,16 +159,18 @@ void AARectEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyB
 }
 
 GrGLSLFragmentProcessor* AARectEffect::onCreateGLSLInstance() const  {
-    return new GLAARectEffect(*this);
+    return new GLAARectEffect;
 }
 
 //////////////////////////////////////////////////////////////////////////////
 
 class GrGLConvexPolyEffect : public GrGLSLFragmentProcessor {
 public:
-    GrGLConvexPolyEffect(const GrProcessor&);
+    GrGLConvexPolyEffect() {
+        fPrevEdges[0] = SK_ScalarNaN;
+    }
 
-    virtual void emitCode(EmitArgs&) override;
+    void emitCode(EmitArgs&) override;
 
     static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*);
 
@@ -183,10 +183,6 @@ private:
     typedef GrGLSLFragmentProcessor INHERITED;
 };
 
-GrGLConvexPolyEffect::GrGLConvexPolyEffect(const GrProcessor&) {
-    fPrevEdges[0] = SK_ScalarNaN;
-}
-
 void GrGLConvexPolyEffect::emitCode(EmitArgs& args) {
     const GrConvexPolyEffect& cpe = args.fFp.cast<GrConvexPolyEffect>();
 
@@ -309,7 +305,7 @@ void GrConvexPolyEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLSLFragmentProcessor* GrConvexPolyEffect::onCreateGLSLInstance() const  {
-    return new GrGLConvexPolyEffect(*this);
+    return new GrGLConvexPolyEffect;
 }
 
 GrConvexPolyEffect::GrConvexPolyEffect(GrPrimitiveEdgeType edgeType, int n, const SkScalar edges[])
index fb68a29420cf5dd72b6e030857d1f8ca36b1cf0e..adb62ae8aef072a5c46e8668bd929014f5d0862c 100644 (file)
@@ -18,7 +18,7 @@ class GrGLConvolutionEffect : public GrGLSLFragmentProcessor {
 public:
     GrGLConvolutionEffect(const GrProcessor&);
 
-    virtual void emitCode(EmitArgs&) override;
+    void emitCode(EmitArgs&) override;
 
     static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*);
 
index 44aacfccab8adfb27f435ee94d9a33c74208cebf..43fe93769aaca848d3fd3c5df4e6a3e3e7e469a9 100644 (file)
@@ -60,17 +60,12 @@ const GrFragmentProcessor* DitherEffect::TestCreate(GrProcessorTestData*) {
 
 class GLDitherEffect : public GrGLSLFragmentProcessor {
 public:
-    GLDitherEffect(const GrProcessor&);
-
-    virtual void emitCode(EmitArgs& args) override;
+    void emitCode(EmitArgs& args) override;
 
 private:
     typedef GrGLSLFragmentProcessor INHERITED;
 };
 
-GLDitherEffect::GLDitherEffect(const GrProcessor&) {
-}
-
 void GLDitherEffect::emitCode(EmitArgs& args) {
     GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
     // Generate a random number based on the fragment position. For this
@@ -97,7 +92,7 @@ void DitherEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLSLFragmentProcessor* DitherEffect::onCreateGLSLInstance() const  {
-    return new GLDitherEffect(*this);
+    return new GLDitherEffect;
 }
 
 GrFragmentProcessor* GrDitherEffect::Create() { return DitherEffect::Create(); }
index 8867ab9dba80a84229b019be6cec96697d330657..6d411c4712aa945a48c4166ca80cc073c9052af9 100644 (file)
@@ -13,7 +13,7 @@
 class GrGLMatrixConvolutionEffect : public GrGLSLFragmentProcessor {
 public:
     GrGLMatrixConvolutionEffect(const GrProcessor&);
-    virtual void emitCode(EmitArgs&) override;
+    void emitCode(EmitArgs&) override;
 
     static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*);
 
index c7e685f9022a9077eaf0e8278e7322017b243eaf..150b5b3718d1417c30040c876120614377e6eebb 100644 (file)
@@ -93,7 +93,7 @@ const GrFragmentProcessor* CircleEffect::TestCreate(GrProcessorTestData* d) {
 
 class GLCircleEffect : public GrGLSLFragmentProcessor {
 public:
-    GLCircleEffect(const GrProcessor&);
+    GLCircleEffect() : fPrevRadius(-1.0f) { }
 
     virtual void emitCode(EmitArgs&) override;
 
@@ -110,10 +110,6 @@ private:
     typedef GrGLSLFragmentProcessor INHERITED;
 };
 
-GLCircleEffect::GLCircleEffect(const GrProcessor&) {
-    fPrevRadius = -1.f;
-}
-
 void GLCircleEffect::emitCode(EmitArgs& args) {
     const CircleEffect& ce = args.fFp.cast<CircleEffect>();
     const char *circleName;
@@ -180,7 +176,7 @@ void CircleEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLSLFragmentProcessor* CircleEffect::onCreateGLSLInstance() const  {
-    return new GLCircleEffect(*this);
+    return new GLCircleEffect;
 }
 
 //////////////////////////////////////////////////////////////////////////////
@@ -265,9 +261,11 @@ const GrFragmentProcessor* EllipseEffect::TestCreate(GrProcessorTestData* d) {
 
 class GLEllipseEffect : public GrGLSLFragmentProcessor {
 public:
-    GLEllipseEffect(const GrProcessor&);
+    GLEllipseEffect() {
+        fPrevRadii.fX = -1.0f;
+    }
 
-    virtual void emitCode(EmitArgs&) override;
+    void emitCode(EmitArgs&) override;
 
     static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*);
 
@@ -283,10 +281,6 @@ private:
     typedef GrGLSLFragmentProcessor INHERITED;
 };
 
-GLEllipseEffect::GLEllipseEffect(const GrProcessor& effect) {
-    fPrevRadii.fX = -1.f;
-}
-
 void GLEllipseEffect::emitCode(EmitArgs& args) {
     const EllipseEffect& ee = args.fFp.cast<EllipseEffect>();
     const char *ellipseName;
@@ -392,7 +386,7 @@ void EllipseEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLSLFragmentProcessor* EllipseEffect::onCreateGLSLInstance() const  {
-    return new GLEllipseEffect(*this);
+    return new GLEllipseEffect;
 }
 
 //////////////////////////////////////////////////////////////////////////////
index 0b492762c2ca8777393336b4ca6ae1a21be0eb74..44bd928d12f81a73312ad520fcd66a6b7518659d 100644 (file)
@@ -129,7 +129,9 @@ const GrFragmentProcessor* CircularRRectEffect::TestCreate(GrProcessorTestData*
 
 class GLCircularRRectEffect : public GrGLSLFragmentProcessor {
 public:
-    GLCircularRRectEffect(const GrProcessor&);
+    GLCircularRRectEffect() {
+        fPrevRRect.setEmpty();
+    }
 
     virtual void emitCode(EmitArgs&) override;
 
@@ -145,10 +147,6 @@ private:
     typedef GrGLSLFragmentProcessor INHERITED;
 };
 
-GLCircularRRectEffect::GLCircularRRectEffect(const GrProcessor& ) {
-    fPrevRRect.setEmpty();
-}
-
 void GLCircularRRectEffect::emitCode(EmitArgs& args) {
     const CircularRRectEffect& crre = args.fFp.cast<CircularRRectEffect>();
     GrGLSLUniformHandler* uniformHandler = args.fUniformHandler;
@@ -382,7 +380,7 @@ void CircularRRectEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLSLFragmentProcessor* CircularRRectEffect::onCreateGLSLInstance() const  {
-    return new GLCircularRRectEffect(*this);
+    return new GLCircularRRectEffect;
 }
 
 //////////////////////////////////////////////////////////////////////////////
@@ -486,9 +484,11 @@ const GrFragmentProcessor* EllipticalRRectEffect::TestCreate(GrProcessorTestData
 
 class GLEllipticalRRectEffect : public GrGLSLFragmentProcessor {
 public:
-    GLEllipticalRRectEffect(const GrProcessor&);
+    GLEllipticalRRectEffect() {
+        fPrevRRect.setEmpty();
+    }
 
-    virtual void emitCode(EmitArgs&) override;
+    void emitCode(EmitArgs&) override;
 
     static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*);
 
@@ -503,10 +503,6 @@ private:
     typedef GrGLSLFragmentProcessor INHERITED;
 };
 
-GLEllipticalRRectEffect::GLEllipticalRRectEffect(const GrProcessor& effect) {
-    fPrevRRect.setEmpty();
-}
-
 void GLEllipticalRRectEffect::emitCode(EmitArgs& args) {
     const EllipticalRRectEffect& erre = args.fFp.cast<EllipticalRRectEffect>();
     GrGLSLUniformHandler* uniformHandler = args.fUniformHandler;
@@ -679,7 +675,7 @@ void EllipticalRRectEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLSLFragmentProcessor* EllipticalRRectEffect::onCreateGLSLInstance() const  {
-    return new GLEllipticalRRectEffect(*this);
+    return new GLEllipticalRRectEffect;
 }
 
 //////////////////////////////////////////////////////////////////////////////
index 74e86249b05585f3bde3057a662ac06e7f09370f..6f47b047009818c457d6bc4160a8196d88181016 100644 (file)
@@ -13,9 +13,7 @@
 
 class GrGLSimpleTextureEffect : public GrGLSLFragmentProcessor {
 public:
-    GrGLSimpleTextureEffect(const GrProcessor&) {}
-
-    virtual void emitCode(EmitArgs& args) override {
+    void emitCode(EmitArgs& args) override {
         GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
         fragBuilder->codeAppendf("\t%s = ", args.fOutputColor);
         fragBuilder->appendTextureLookupAndModulate(args.fInputColor,
@@ -41,7 +39,7 @@ void GrSimpleTextureEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLSLFragmentProcessor* GrSimpleTextureEffect::onCreateGLSLInstance() const  {
-    return new GrGLSimpleTextureEffect(*this);
+    return new GrGLSimpleTextureEffect;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
index 00e8e82c8eba4dad51b0cbe46596ff427cc0329f..2bba9b6ea4a9b72d61faa4bab0bb737fdbaacefc 100644 (file)
@@ -176,9 +176,7 @@ void GrTextureDomain::GLDomain::setData(const GrGLSLProgramDataManager& pdman,
 
 class GrGLTextureDomainEffect : public GrGLSLFragmentProcessor {
 public:
-    GrGLTextureDomainEffect(const GrProcessor&);
-
-    virtual void emitCode(EmitArgs&) override;
+    void emitCode(EmitArgs&) override;
 
     static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*);
 
@@ -190,9 +188,6 @@ private:
     typedef GrGLSLFragmentProcessor INHERITED;
 };
 
-GrGLTextureDomainEffect::GrGLTextureDomainEffect(const GrProcessor&) {
-}
-
 void GrGLTextureDomainEffect::emitCode(EmitArgs& args) {
     const GrTextureDomainEffect& textureDomainEffect = args.fFp.cast<GrTextureDomainEffect>();
     const GrTextureDomain& domain = textureDomainEffect.textureDomain();
@@ -261,7 +256,7 @@ void GrTextureDomainEffect::onGetGLSLProcessorKey(const GrGLSLCaps& caps,
 }
 
 GrGLSLFragmentProcessor* GrTextureDomainEffect::onCreateGLSLInstance() const  {
-    return new GrGLTextureDomainEffect(*this);
+    return new GrGLTextureDomainEffect;
 }
 
 bool GrTextureDomainEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
index c83d6bee55ab7f633da4fe7e88bc020af39a9c1b..7a358d6ef5f2e4b6ff1d82704e4c26717038a308 100644 (file)
@@ -59,8 +59,6 @@ private:
 
 class GLComposeTwoFragmentProcessor : public GrGLSLFragmentProcessor {
 public:
-    GLComposeTwoFragmentProcessor(const GrProcessor& processor) {}
-
     void emitCode(EmitArgs&) override;
 
 private:
@@ -82,7 +80,7 @@ const GrFragmentProcessor* ComposeTwoFragmentProcessor::TestCreate(GrProcessorTe
 }
 
 GrGLSLFragmentProcessor* ComposeTwoFragmentProcessor::onCreateGLSLInstance() const{
-    return new GLComposeTwoFragmentProcessor(*this);
+    return new GLComposeTwoFragmentProcessor;
 }
 
 /////////////////////////////////////////////////////////////////////
@@ -229,8 +227,6 @@ private:
 
 class GLComposeOneFragmentProcessor : public GrGLSLFragmentProcessor {
 public:
-    GLComposeOneFragmentProcessor(const GrProcessor& processor) {}
-
     void emitCode(EmitArgs& args) override {
         GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
         SkXfermode::Mode mode = args.fFp.cast<ComposeOneFragmentProcessor>().mode();
@@ -278,7 +274,7 @@ const GrFragmentProcessor* ComposeOneFragmentProcessor::TestCreate(GrProcessorTe
 }
 
 GrGLSLFragmentProcessor* ComposeOneFragmentProcessor::onCreateGLSLInstance() const {
-    return new GLComposeOneFragmentProcessor(*this);
+    return new GLComposeOneFragmentProcessor;
 }
 
 //////////////////////////////////////////////////////////////////////////////
index e4d9d61bdb5efd695a34a7fc3b15ee90edff68f0..a227e05fdea4858a9c982cae885470b138544a9a 100644 (file)
@@ -98,8 +98,6 @@ public:
         // this class always generates the same code.
         static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*) {}
 
-        GLSLProcessor(const GrProcessor&) {}
-
         void emitCode(EmitArgs& args) override {
             GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
 
@@ -164,7 +162,7 @@ private:
     }
 
     GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
-        return new GLSLProcessor(*this);
+        return new GLSLProcessor;
     }
 
     void onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override {
@@ -225,7 +223,7 @@ public:
 
     class GLSLProcessor : public GrGLSLFragmentProcessor {
     public:
-        GLSLProcessor(const GrProcessor&) : fLastColorSpace(-1), fLastOutputChannels(-1) {}
+        GLSLProcessor() : fLastColorSpace(-1), fLastOutputChannels(-1) {}
 
         void emitCode(EmitArgs& args) override {
             GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
@@ -320,7 +318,7 @@ public:
 
 private:
     GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
-        return new GLSLProcessor(*this);
+        return new GLSLProcessor;
     }
 
     void onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override {
index 22a5f78b1e7511aea270b127c2ccf272ede0bb32..400e58309f0d73c327e7c79177680df4f7d307f4 100644 (file)
@@ -105,10 +105,6 @@ static void add_overdraw_code(GrGLSLFragmentBuilder* fragBuilder,
 
 class GLOverdrawFP : public GrGLSLFragmentProcessor {
 public:
-    GLOverdrawFP(const GrOverdrawFP&) {}
-
-    ~GLOverdrawFP() override {}
-
     void emitCode(EmitArgs& args) override {
         GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
         SkString dstColor("dstColor");
@@ -126,7 +122,7 @@ private:
 ///////////////////////////////////////////////////////////////////////////////
 
 GrGLSLFragmentProcessor* GrOverdrawFP::onCreateGLSLInstance() const {
-    return new GLOverdrawFP(*this);
+    return new GLOverdrawFP;
 }
 
 void GrOverdrawFP::onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const {
index 3933e649d8d6c2a9f9a6657f44fd979da3614b39..81d1013dd0104775a937408f0978d38cae105885 100644 (file)
@@ -45,9 +45,7 @@ static const uint32_t kMaxKeySize = 1024;
 
 class GLBigKeyProcessor : public GrGLSLFragmentProcessor {
 public:
-    GLBigKeyProcessor(const GrProcessor&) {}
-
-    virtual void emitCode(EmitArgs& args) override {
+    void emitCode(EmitArgs& args) override {
         // pass through
         GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
         if (args.fInputColor) {
@@ -76,7 +74,7 @@ public:
     const char* name() const override { return "Big Ole Key"; }
 
     GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
-        return new GLBigKeyProcessor(*this);
+        return new GLBigKeyProcessor;
     }
 
 private: