From 9cdb9920fcad286ecf7875ea19902022b644fbdc Mon Sep 17 00:00:00 2001 From: robertphillips Date: Wed, 3 Feb 2016 12:25:40 -0800 Subject: Clean up GrGLSLFragmentProcessor-derived classes 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 --- src/gpu/effects/GrConvexPolyEffect.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'src/gpu/effects/GrConvexPolyEffect.cpp') diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp index dc7a528501..f95d1a2fb3 100644 --- a/src/gpu/effects/GrConvexPolyEffect.cpp +++ b/src/gpu/effects/GrConvexPolyEffect.cpp @@ -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(); 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(); @@ -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[]) -- cgit v1.2.3