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/core/SkColorMatrixFilterRowMajor255.cpp b/src/core/SkColorMatrixFilterRowMajor255.cpp
index 9106a27..b9508ff 100644
--- a/src/core/SkColorMatrixFilterRowMajor255.cpp
+++ b/src/core/SkColorMatrixFilterRowMajor255.cpp
@@ -253,11 +253,9 @@
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 @@
}
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 @@
}
GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
- return new GLSLProcessor(*this);
+ return new GLSLProcessor;
}
virtual void onGetGLSLProcessorKey(const GrGLSLCaps& caps,
diff --git a/src/effects/GrCircleBlurFragmentProcessor.cpp b/src/effects/GrCircleBlurFragmentProcessor.cpp
index 83faa86..decb3c2 100644
--- a/src/effects/GrCircleBlurFragmentProcessor.cpp
+++ b/src/effects/GrCircleBlurFragmentProcessor.cpp
@@ -21,7 +21,6 @@
class GrGLCircleBlurFragmentProcessor : public GrGLSLFragmentProcessor {
public:
- GrGLCircleBlurFragmentProcessor(const GrProcessor&) {}
void emitCode(EmitArgs&) override;
protected:
@@ -100,7 +99,7 @@
}
GrGLSLFragmentProcessor* GrCircleBlurFragmentProcessor::onCreateGLSLInstance() const {
- return new GrGLCircleBlurFragmentProcessor(*this);
+ return new GrGLCircleBlurFragmentProcessor;
}
void GrCircleBlurFragmentProcessor::onGetGLSLProcessorKey(const GrGLSLCaps& caps,
diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp
index 6cadbc3..71d9aa2 100644
--- a/src/effects/SkAlphaThresholdFilter.cpp
+++ b/src/effects/SkAlphaThresholdFilter.cpp
@@ -143,9 +143,7 @@
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 @@
}
GrGLSLFragmentProcessor* AlphaThresholdEffect::onCreateGLSLInstance() const {
- return new GrGLAlphaThresholdEffect(*this);
+ return new GrGLAlphaThresholdEffect;
}
bool AlphaThresholdEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
diff --git a/src/effects/SkArithmeticMode_gpu.cpp b/src/effects/SkArithmeticMode_gpu.cpp
index 29c6602..709f59d 100644
--- a/src/effects/SkArithmeticMode_gpu.cpp
+++ b/src/effects/SkArithmeticMode_gpu.cpp
@@ -55,12 +55,9 @@
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 @@
dstColor.c_str(),
args.fOutputColor,
kUni,
- fEnforcePMColor);
+ arith.enforcePMColor());
}
static void GenKey(const GrProcessor& proc, const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) {
@@ -88,12 +85,10 @@
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 @@
}
GrGLSLFragmentProcessor* GrArithmeticFP::onCreateGLSLInstance() const {
- return new GLArithmeticFP(*this);
+ return new GLArithmeticFP;
}
bool GrArithmeticFP::onIsEqual(const GrFragmentProcessor& fpBase) const {
diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp
index be0c816..d55c669 100644
--- a/src/effects/SkBlurMaskFilter.cpp
+++ b/src/effects/SkBlurMaskFilter.cpp
@@ -1043,9 +1043,7 @@
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 @@
}
GrGLSLFragmentProcessor* GrRRectBlurEffect::onCreateGLSLInstance() const {
- return new GrGLRRectBlurEffect(*this);
+ return new GrGLRRectBlurEffect;
}
bool SkBlurMaskFilterImpl::directFilterRRectMaskGPU(GrTextureProvider* texProvider,
diff --git a/src/effects/SkColorCubeFilter.cpp b/src/effects/SkColorCubeFilter.cpp
index 5f1f10d..255c590 100644
--- a/src/effects/SkColorCubeFilter.cpp
+++ b/src/effects/SkColorCubeFilter.cpp
@@ -177,10 +177,7 @@
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 @@
}
GrGLSLFragmentProcessor* GrColorCubeEffect::onCreateGLSLInstance() const {
- return new GLSLProcessor(*this);
+ return new GLSLProcessor;
}
void GrColorCubeEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const {
@@ -235,12 +232,6 @@
///////////////////////////////////////////////////////////////////////////////
-GrColorCubeEffect::GLSLProcessor::GLSLProcessor(const GrProcessor&) {
-}
-
-GrColorCubeEffect::GLSLProcessor::~GLSLProcessor() {
-}
-
void GrColorCubeEffect::GLSLProcessor::emitCode(EmitArgs& args) {
if (nullptr == args.fInputColor) {
args.fInputColor = "vec4(1)";
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index 41f1a6d..e861d58 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -313,9 +313,8 @@
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 @@
, fYChannelSelector(proc.cast<GrDisplacementMapEffect>().yChannelSelector()) {
}
-GrGLDisplacementMapEffect::~GrGLDisplacementMapEffect() {
-}
-
void GrGLDisplacementMapEffect::emitCode(EmitArgs& args) {
const GrTextureDomain& domain = args.fFp.cast<GrDisplacementMapEffect>().domain();
diff --git a/src/effects/SkLumaColorFilter.cpp b/src/effects/SkLumaColorFilter.cpp
index acdebf8..46d02aa 100644
--- a/src/effects/SkLumaColorFilter.cpp
+++ b/src/effects/SkLumaColorFilter.cpp
@@ -62,11 +62,9 @@
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 @@
}
GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
- return new GLSLProcessor(*this);
+ return new GLSLProcessor;
}
virtual void onGetGLSLProcessorKey(const GrGLSLCaps& caps,
diff --git a/src/effects/SkMagnifierImageFilter.cpp b/src/effects/SkMagnifierImageFilter.cpp
index 45f630a..734002d 100644
--- a/src/effects/SkMagnifierImageFilter.cpp
+++ b/src/effects/SkMagnifierImageFilter.cpp
@@ -100,9 +100,7 @@
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 @@
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 @@
}
GrGLSLFragmentProcessor* GrMagnifierEffect::onCreateGLSLInstance() const {
- return new GrGLMagnifierEffect(*this);
+ return new GrGLMagnifierEffect;
}
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrMagnifierEffect);
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 3f6bc94..0a4bc2a 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -255,7 +255,7 @@
public:
GrGLMorphologyEffect(const GrProcessor&);
- virtual void emitCode(EmitArgs&) override;
+ void emitCode(EmitArgs&) override;
static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder* b);
diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp
index 60e9601..f66655c 100644
--- a/src/effects/SkPerlinNoiseShader.cpp
+++ b/src/effects/SkPerlinNoiseShader.cpp
@@ -473,9 +473,8 @@
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 @@
int fNumOctaves;
GrGLSLProgramDataManager::UniformHandle fBaseFrequencyUni;
-private:
typedef GrGLSLFragmentProcessor INHERITED;
};
diff --git a/src/effects/SkPixelXorXfermode.cpp b/src/effects/SkPixelXorXfermode.cpp
index 2eb4294..833eecd 100644
--- a/src/effects/SkPixelXorXfermode.cpp
+++ b/src/effects/SkPixelXorXfermode.cpp
@@ -171,10 +171,6 @@
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 @@
///////////////////////////////////////////////////////////////////////////////
GrGLSLFragmentProcessor* PixelXorFP::onCreateGLSLInstance() const {
- return new GLPixelXorFP(*this);
+ return new GLPixelXorFP;
}
void PixelXorFP::onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const {
diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp
index d9c07e2..c06e436 100644
--- a/src/effects/SkTableColorFilter.cpp
+++ b/src/effects/SkTableColorFilter.cpp
@@ -377,9 +377,7 @@
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 @@
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 @@
}
GrGLSLFragmentProcessor* ColorTableEffect::onCreateGLSLInstance() const {
- return new GLColorTableEffect(*this);
+ return new GLColorTableEffect;
}
bool ColorTableEffect::onIsEqual(const GrFragmentProcessor& other) const {
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp
index ac70bc2..03ebfd6 100644
--- a/src/effects/gradients/SkGradientShader.cpp
+++ b/src/effects/gradients/SkGradientShader.cpp
@@ -913,8 +913,6 @@
: fCachedYCoord(SK_ScalarMax) {
}
-GrGLGradientEffect::~GrGLGradientEffect() { }
-
void GrGLGradientEffect::emitUniforms(GrGLSLUniformHandler* uniformHandler,
const GrGradientEffect& ge) {
diff --git a/src/effects/gradients/SkGradientShaderPriv.h b/src/effects/gradients/SkGradientShaderPriv.h
index f8a968d..601ac02 100644
--- a/src/effects/gradients/SkGradientShaderPriv.h
+++ b/src/effects/gradients/SkGradientShaderPriv.h
@@ -404,7 +404,6 @@
class GrGLGradientEffect : public GrGLSLFragmentProcessor {
public:
GrGLGradientEffect();
- virtual ~GrGLGradientEffect();
protected:
void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) override;
diff --git a/src/gpu/GrFragmentProcessor.cpp b/src/gpu/GrFragmentProcessor.cpp
index f05b7aa..ca2298c 100644
--- a/src/gpu/GrFragmentProcessor.cpp
+++ b/src/gpu/GrFragmentProcessor.cpp
@@ -152,8 +152,6 @@
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 @@
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) {
diff --git a/src/gpu/effects/GrBicubicEffect.cpp b/src/gpu/effects/GrBicubicEffect.cpp
index 37ac4ab..cc38d62 100644
--- a/src/gpu/effects/GrBicubicEffect.cpp
+++ b/src/gpu/effects/GrBicubicEffect.cpp
@@ -23,9 +23,7 @@
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 @@
typedef GrGLSLFragmentProcessor INHERITED;
};
-GrGLBicubicEffect::GrGLBicubicEffect(const GrProcessor&) {
-}
-
void GrGLBicubicEffect::emitCode(EmitArgs& args) {
const GrTextureDomain& domain = args.fFp.cast<GrBicubicEffect>().domain();
@@ -168,7 +163,7 @@
}
GrGLSLFragmentProcessor* GrBicubicEffect::onCreateGLSLInstance() const {
- return new GrGLBicubicEffect(*this);
+ return new GrGLBicubicEffect;
}
bool GrBicubicEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index 5ac86a9..ace736c 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -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();
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[])
diff --git a/src/gpu/effects/GrConvolutionEffect.cpp b/src/gpu/effects/GrConvolutionEffect.cpp
index fb68a29..adb62ae 100644
--- a/src/gpu/effects/GrConvolutionEffect.cpp
+++ b/src/gpu/effects/GrConvolutionEffect.cpp
@@ -18,7 +18,7 @@
public:
GrGLConvolutionEffect(const GrProcessor&);
- virtual void emitCode(EmitArgs&) override;
+ void emitCode(EmitArgs&) override;
static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*);
diff --git a/src/gpu/effects/GrDitherEffect.cpp b/src/gpu/effects/GrDitherEffect.cpp
index 44aacfc..43fe937 100644
--- a/src/gpu/effects/GrDitherEffect.cpp
+++ b/src/gpu/effects/GrDitherEffect.cpp
@@ -60,17 +60,12 @@
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 @@
}
GrGLSLFragmentProcessor* DitherEffect::onCreateGLSLInstance() const {
- return new GLDitherEffect(*this);
+ return new GLDitherEffect;
}
GrFragmentProcessor* GrDitherEffect::Create() { return DitherEffect::Create(); }
diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.cpp b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
index 8867ab9..6d411c4 100644
--- a/src/gpu/effects/GrMatrixConvolutionEffect.cpp
+++ b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
@@ -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*);
diff --git a/src/gpu/effects/GrOvalEffect.cpp b/src/gpu/effects/GrOvalEffect.cpp
index c7e685f..150b5b3 100644
--- a/src/gpu/effects/GrOvalEffect.cpp
+++ b/src/gpu/effects/GrOvalEffect.cpp
@@ -93,7 +93,7 @@
class GLCircleEffect : public GrGLSLFragmentProcessor {
public:
- GLCircleEffect(const GrProcessor&);
+ GLCircleEffect() : fPrevRadius(-1.0f) { }
virtual void emitCode(EmitArgs&) override;
@@ -110,10 +110,6 @@
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 @@
}
GrGLSLFragmentProcessor* CircleEffect::onCreateGLSLInstance() const {
- return new GLCircleEffect(*this);
+ return new GLCircleEffect;
}
//////////////////////////////////////////////////////////////////////////////
@@ -265,9 +261,11 @@
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 @@
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 @@
}
GrGLSLFragmentProcessor* EllipseEffect::onCreateGLSLInstance() const {
- return new GLEllipseEffect(*this);
+ return new GLEllipseEffect;
}
//////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/effects/GrRRectEffect.cpp b/src/gpu/effects/GrRRectEffect.cpp
index 0b49276..44bd928 100644
--- a/src/gpu/effects/GrRRectEffect.cpp
+++ b/src/gpu/effects/GrRRectEffect.cpp
@@ -129,7 +129,9 @@
class GLCircularRRectEffect : public GrGLSLFragmentProcessor {
public:
- GLCircularRRectEffect(const GrProcessor&);
+ GLCircularRRectEffect() {
+ fPrevRRect.setEmpty();
+ }
virtual void emitCode(EmitArgs&) override;
@@ -145,10 +147,6 @@
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 @@
}
GrGLSLFragmentProcessor* CircularRRectEffect::onCreateGLSLInstance() const {
- return new GLCircularRRectEffect(*this);
+ return new GLCircularRRectEffect;
}
//////////////////////////////////////////////////////////////////////////////
@@ -486,9 +484,11 @@
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 @@
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 @@
}
GrGLSLFragmentProcessor* EllipticalRRectEffect::onCreateGLSLInstance() const {
- return new GLEllipticalRRectEffect(*this);
+ return new GLEllipticalRRectEffect;
}
//////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/effects/GrSimpleTextureEffect.cpp b/src/gpu/effects/GrSimpleTextureEffect.cpp
index 74e8624..6f47b04 100644
--- a/src/gpu/effects/GrSimpleTextureEffect.cpp
+++ b/src/gpu/effects/GrSimpleTextureEffect.cpp
@@ -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 @@
}
GrGLSLFragmentProcessor* GrSimpleTextureEffect::onCreateGLSLInstance() const {
- return new GrGLSimpleTextureEffect(*this);
+ return new GrGLSimpleTextureEffect;
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp
index 00e8e82..2bba9b6 100644
--- a/src/gpu/effects/GrTextureDomain.cpp
+++ b/src/gpu/effects/GrTextureDomain.cpp
@@ -176,9 +176,7 @@
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 @@
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 @@
}
GrGLSLFragmentProcessor* GrTextureDomainEffect::onCreateGLSLInstance() const {
- return new GrGLTextureDomainEffect(*this);
+ return new GrGLTextureDomainEffect;
}
bool GrTextureDomainEffect::onIsEqual(const GrFragmentProcessor& sBase) const {
diff --git a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
index c83d6be..7a358d6 100644
--- a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
+++ b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
@@ -59,8 +59,6 @@
class GLComposeTwoFragmentProcessor : public GrGLSLFragmentProcessor {
public:
- GLComposeTwoFragmentProcessor(const GrProcessor& processor) {}
-
void emitCode(EmitArgs&) override;
private:
@@ -82,7 +80,7 @@
}
GrGLSLFragmentProcessor* ComposeTwoFragmentProcessor::onCreateGLSLInstance() const{
- return new GLComposeTwoFragmentProcessor(*this);
+ return new GLComposeTwoFragmentProcessor;
}
/////////////////////////////////////////////////////////////////////
@@ -229,8 +227,6 @@
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 @@
}
GrGLSLFragmentProcessor* ComposeOneFragmentProcessor::onCreateGLSLInstance() const {
- return new GLComposeOneFragmentProcessor(*this);
+ return new GLComposeOneFragmentProcessor;
}
//////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/effects/GrYUVEffect.cpp b/src/gpu/effects/GrYUVEffect.cpp
index e4d9d61..a227e05 100644
--- a/src/gpu/effects/GrYUVEffect.cpp
+++ b/src/gpu/effects/GrYUVEffect.cpp
@@ -98,8 +98,6 @@
// 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 @@
}
GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
- return new GLSLProcessor(*this);
+ return new GLSLProcessor;
}
void onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override {
@@ -225,7 +223,7 @@
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 @@
private:
GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
- return new GLSLProcessor(*this);
+ return new GLSLProcessor;
}
void onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override {
diff --git a/src/utils/debugger/SkOverdrawMode.cpp b/src/utils/debugger/SkOverdrawMode.cpp
index 22a5f78..400e583 100644
--- a/src/utils/debugger/SkOverdrawMode.cpp
+++ b/src/utils/debugger/SkOverdrawMode.cpp
@@ -105,10 +105,6 @@
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 @@
///////////////////////////////////////////////////////////////////////////////
GrGLSLFragmentProcessor* GrOverdrawFP::onCreateGLSLInstance() const {
- return new GLOverdrawFP(*this);
+ return new GLOverdrawFP;
}
void GrOverdrawFP::onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const {
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index 3933e64..81d1013 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -45,9 +45,7 @@
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 @@
const char* name() const override { return "Big Ole Key"; }
GrGLSLFragmentProcessor* onCreateGLSLInstance() const override {
- return new GLBigKeyProcessor(*this);
+ return new GLBigKeyProcessor;
}
private: