diff options
author | 2014-12-04 11:35:33 -0800 | |
---|---|---|
committer | 2014-12-04 11:35:34 -0800 | |
commit | eb2a6761654307e8aeeeaabdd63c6bf9ab0411e9 (patch) | |
tree | 9567dc32598c1c0df5f5cf4a3d6594c61b95fd93 /src/gpu/effects/GrMatrixConvolutionEffect.cpp | |
parent | e109145bf31d63963b3f78c6af6e404d5464a55b (diff) |
Remove backend factories
BUG=skia:
Review URL: https://codereview.chromium.org/778453002
Diffstat (limited to 'src/gpu/effects/GrMatrixConvolutionEffect.cpp')
-rw-r--r-- | src/gpu/effects/GrMatrixConvolutionEffect.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.cpp b/src/gpu/effects/GrMatrixConvolutionEffect.cpp index 698b7050ef..3cd3588a4c 100644 --- a/src/gpu/effects/GrMatrixConvolutionEffect.cpp +++ b/src/gpu/effects/GrMatrixConvolutionEffect.cpp @@ -4,17 +4,15 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -#include "gl/builders/GrGLProgramBuilder.h" #include "GrMatrixConvolutionEffect.h" #include "gl/GrGLProcessor.h" #include "gl/GrGLSL.h" #include "gl/GrGLTexture.h" -#include "GrTBackendProcessorFactory.h" +#include "gl/builders/GrGLProgramBuilder.h" class GrGLMatrixConvolutionEffect : public GrGLFragmentProcessor { public: - GrGLMatrixConvolutionEffect(const GrBackendProcessorFactory& factory, - const GrProcessor&); + GrGLMatrixConvolutionEffect(const GrProcessor&); virtual void emitCode(GrGLFPBuilder*, const GrFragmentProcessor&, const char* outputColor, @@ -42,9 +40,7 @@ private: typedef GrGLFragmentProcessor INHERITED; }; -GrGLMatrixConvolutionEffect::GrGLMatrixConvolutionEffect(const GrBackendProcessorFactory& factory, - const GrProcessor& processor) - : INHERITED(factory) { +GrGLMatrixConvolutionEffect::GrGLMatrixConvolutionEffect(const GrProcessor& processor) { const GrMatrixConvolutionEffect& m = processor.cast<GrMatrixConvolutionEffect>(); fKernelSize = m.kernelSize(); fConvolveAlpha = m.convolveAlpha(); @@ -160,6 +156,7 @@ GrMatrixConvolutionEffect::GrMatrixConvolutionEffect(GrTexture* texture, fBias(SkScalarToFloat(bias) / 255.0f), fConvolveAlpha(convolveAlpha), fDomain(GrTextureDomain::MakeTexelDomain(texture, bounds), tileMode) { + this->initClassID<GrMatrixConvolutionEffect>(); for (int i = 0; i < kernelSize.width() * kernelSize.height(); i++) { fKernel[i] = SkScalarToFloat(kernel[i]); } @@ -170,8 +167,13 @@ GrMatrixConvolutionEffect::GrMatrixConvolutionEffect(GrTexture* texture, GrMatrixConvolutionEffect::~GrMatrixConvolutionEffect() { } -const GrBackendFragmentProcessorFactory& GrMatrixConvolutionEffect::getFactory() const { - return GrTBackendFragmentProcessorFactory<GrMatrixConvolutionEffect>::getInstance(); +void GrMatrixConvolutionEffect::getGLProcessorKey(const GrGLCaps& caps, + GrProcessorKeyBuilder* b) const { + GrGLMatrixConvolutionEffect::GenKey(*this, caps, b); +} + +GrGLFragmentProcessor* GrMatrixConvolutionEffect::createGLInstance() const { + return SkNEW_ARGS(GrGLMatrixConvolutionEffect, (*this)); } bool GrMatrixConvolutionEffect::onIsEqual(const GrFragmentProcessor& sBase) const { |