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/GrConfigConversionEffect.cpp | |
parent | e109145bf31d63963b3f78c6af6e404d5464a55b (diff) |
Remove backend factories
BUG=skia:
Review URL: https://codereview.chromium.org/778453002
Diffstat (limited to 'src/gpu/effects/GrConfigConversionEffect.cpp')
-rw-r--r-- | src/gpu/effects/GrConfigConversionEffect.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp index d487841789..e146411e32 100644 --- a/src/gpu/effects/GrConfigConversionEffect.cpp +++ b/src/gpu/effects/GrConfigConversionEffect.cpp @@ -8,17 +8,14 @@ #include "GrConfigConversionEffect.h" #include "GrContext.h" #include "GrInvariantOutput.h" -#include "GrTBackendProcessorFactory.h" #include "GrSimpleTextureEffect.h" +#include "SkMatrix.h" #include "gl/GrGLProcessor.h" #include "gl/builders/GrGLProgramBuilder.h" -#include "SkMatrix.h" class GrGLConfigConversionEffect : public GrGLFragmentProcessor { public: - GrGLConfigConversionEffect(const GrBackendProcessorFactory& factory, - const GrProcessor& processor) - : INHERITED (factory) { + GrGLConfigConversionEffect(const GrProcessor& processor) { const GrConfigConversionEffect& configConversionEffect = processor.cast<GrConfigConversionEffect>(); fSwapRedAndBlue = configConversionEffect.swapsRedAndBlue(); @@ -109,16 +106,13 @@ GrConfigConversionEffect::GrConfigConversionEffect(GrTexture* texture, : GrSingleTextureEffect(texture, matrix) , fSwapRedAndBlue(swapRedAndBlue) , fPMConversion(pmConversion) { + this->initClassID<GrConfigConversionEffect>(); SkASSERT(kRGBA_8888_GrPixelConfig == texture->config() || kBGRA_8888_GrPixelConfig == texture->config()); // Why did we pollute our texture cache instead of using a GrSingleTextureEffect? SkASSERT(swapRedAndBlue || kNone_PMConversion != pmConversion); } -const GrBackendFragmentProcessorFactory& GrConfigConversionEffect::getFactory() const { - return GrTBackendFragmentProcessorFactory<GrConfigConversionEffect>::getInstance(); -} - bool GrConfigConversionEffect::onIsEqual(const GrFragmentProcessor& s) const { const GrConfigConversionEffect& other = s.cast<GrConfigConversionEffect>(); return other.fSwapRedAndBlue == fSwapRedAndBlue && @@ -152,6 +146,16 @@ GrFragmentProcessor* GrConfigConversionEffect::TestCreate(SkRandom* random, } /////////////////////////////////////////////////////////////////////////////// + +void GrConfigConversionEffect::getGLProcessorKey(const GrGLCaps& caps, + GrProcessorKeyBuilder* b) const { + GrGLConfigConversionEffect::GenKey(*this, caps, b); +} + +GrGLFragmentProcessor* GrConfigConversionEffect::createGLInstance() const { + return SkNEW_ARGS(GrGLConfigConversionEffect, (*this)); +} + void GrConfigConversionEffect::TestForPreservingPMConversions(GrContext* context, PMConversion* pmToUPMRule, PMConversion* upmToPMRule) { |