aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrSingleTextureEffect.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-01 15:47:55 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-11-01 15:47:55 +0000
commit115b06f3d51902a122621e897360ba80153527b3 (patch)
tree82a6e178b304838e1a5e26d77c9476c547128f6e /src/gpu/effects/GrSingleTextureEffect.cpp
parentc3a58f345de16c185db3a20578c7ddf52bc89d38 (diff)
Re-revert r6233.
git-svn-id: http://skia.googlecode.com/svn/trunk@6239 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/effects/GrSingleTextureEffect.cpp')
-rw-r--r--src/gpu/effects/GrSingleTextureEffect.cpp55
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]));
}