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
This commit is contained in:
parent
d32d19a229
commit
9cdb9920fc
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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,
|
||||
|
@ -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)";
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -913,8 +913,6 @@ GrGLGradientEffect::GrGLGradientEffect()
|
||||
: fCachedYCoord(SK_ScalarMax) {
|
||||
}
|
||||
|
||||
GrGLGradientEffect::~GrGLGradientEffect() { }
|
||||
|
||||
void GrGLGradientEffect::emitUniforms(GrGLSLUniformHandler* uniformHandler,
|
||||
const GrGradientEffect& ge) {
|
||||
|
||||
|
@ -404,7 +404,6 @@ private:
|
||||
class GrGLGradientEffect : public GrGLSLFragmentProcessor {
|
||||
public:
|
||||
GrGLGradientEffect();
|
||||
virtual ~GrGLGradientEffect();
|
||||
|
||||
protected:
|
||||
void onSetData(const GrGLSLProgramDataManager&, const GrProcessor&) override;
|
||||
|
@ -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) {
|
||||
|
@ -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 {
|
||||
|
@ -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();
|
||||
|
@ -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[])
|
||||
|
@ -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*);
|
||||
|
||||
|
@ -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(); }
|
||||
|
@ -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*);
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user