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
diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp
index dc7a528..f95d1a2 100644
--- a/src/gpu/effects/GrConvexPolyEffect.cpp
+++ b/src/gpu/effects/GrConvexPolyEffect.cpp
@@ -81,9 +81,11 @@
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 @@
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 @@
}
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 @@
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 @@
}
GrGLSLFragmentProcessor* GrConvexPolyEffect::onCreateGLSLInstance() const {
- return new GrGLConvexPolyEffect(*this);
+ return new GrGLConvexPolyEffect;
}
GrConvexPolyEffect::GrConvexPolyEffect(GrPrimitiveEdgeType edgeType, int n, const SkScalar edges[])