diff options
Diffstat (limited to 'src/gpu/effects/GrSingleTextureEffect.cpp')
-rw-r--r-- | src/gpu/effects/GrSingleTextureEffect.cpp | 55 |
1 files changed, 6 insertions, 49 deletions
diff --git a/src/gpu/effects/GrSingleTextureEffect.cpp b/src/gpu/effects/GrSingleTextureEffect.cpp index 0f3b614dd7..8866153962 100644 --- a/src/gpu/effects/GrSingleTextureEffect.cpp +++ b/src/gpu/effects/GrSingleTextureEffect.cpp @@ -7,7 +7,6 @@ #include "effects/GrSingleTextureEffect.h" #include "gl/GrGLEffect.h" -#include "gl/GrGLEffectMatrix.h" #include "gl/GrGLSL.h" #include "gl/GrGLTexture.h" #include "GrTBackendEffectFactory.h" @@ -17,43 +16,25 @@ class GrGLSingleTextureEffect : public GrGLEffect { public: GrGLSingleTextureEffect(const GrBackendEffectFactory& factory, const GrEffect&) : INHERITED (factory) { - fRequiresTextureMatrix = false; } virtual void emitCode(GrGLShaderBuilder* builder, const GrEffectStage&, - EffectKey key, + EffectKey, const char* vertexCoords, const char* outputColor, const char* inputColor, const TextureSamplerArray& samplers) SK_OVERRIDE { - const char* coordName; - GrSLType coordType = fEffectMatrix.emitCode(builder, key, vertexCoords, &coordName); + builder->fFSCode.appendf("\t%s = ", outputColor); - builder->appendTextureLookupAndModulate(&builder->fFSCode, - inputColor, - samplers[0], - coordName, - coordType); + builder->appendTextureLookupAndModulate(&builder->fFSCode, inputColor, samplers[0]); builder->fFSCode.append(";\n"); } - static inline EffectKey GenKey(const GrEffectStage& stage, const GrGLCaps&) { - const GrSingleTextureEffect& ste = - static_cast<const GrSingleTextureEffect&>(*stage.getEffect()); - return GrGLEffectMatrix::GenKey(ste.getMatrix(), - stage.getCoordChangeMatrix(), - ste.texture(0)); - } - - virtual void setData(const GrGLUniformManager& uman, const GrEffectStage& stage) SK_OVERRIDE { - const GrSingleTextureEffect& ste = - static_cast<const GrSingleTextureEffect&>(*stage.getEffect()); - fEffectMatrix.setData(uman, ste.getMatrix(), stage.getCoordChangeMatrix(), ste.texture(0)); - } + static inline EffectKey GenKey(const GrEffectStage&, const GrGLCaps&) { return 0; } private: - GrGLEffectMatrix fEffectMatrix; + typedef GrGLEffect INHERITED; }; @@ -62,39 +43,16 @@ private: GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture) : INHERITED(1) , fTextureAccess(texture) { - fMatrix.reset(); } GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture, bool bilerp) : INHERITED(1) , fTextureAccess(texture, bilerp) { - fMatrix.reset(); } GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture, const GrTextureParams& params) : INHERITED(1) , fTextureAccess(texture, params) { - fMatrix.reset(); -} - -GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture, const GrMatrix& m) - : INHERITED(1) - , fTextureAccess(texture) - , fMatrix(m) { -} - -GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture, const GrMatrix& m, bool bilerp) - : INHERITED(1) - , fTextureAccess(texture, bilerp) - , fMatrix(m) { -} - -GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture, - const GrMatrix& m, - const GrTextureParams& params) - : INHERITED(1) - , fTextureAccess(texture, params) - , fMatrix(m) { } GrSingleTextureEffect::~GrSingleTextureEffect() { @@ -118,6 +76,5 @@ GrEffect* GrSingleTextureEffect::TestCreate(SkRandom* random, GrTexture* textures[]) { int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : GrEffectUnitTest::kAlphaTextureIdx; - const SkMatrix& matrix = GrEffectUnitTest::TestMatrix(random); - return SkNEW_ARGS(GrSingleTextureEffect, (textures[texIdx], matrix)); + return SkNEW_ARGS(GrSingleTextureEffect, (textures[texIdx])); } |