Reland r6233 with fix for config conversion texture matrices.
git-svn-id: http://skia.googlecode.com/svn/trunk@6238 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/effects/GrSingleTextureEffect.h b/src/gpu/effects/GrSingleTextureEffect.h
index 346a6f4..23b416d 100644
--- a/src/gpu/effects/GrSingleTextureEffect.h
+++ b/src/gpu/effects/GrSingleTextureEffect.h
@@ -9,6 +9,7 @@
#define GrSingleTextureEffect_DEFINED
#include "GrEffect.h"
+#include "GrMatrix.h"
class GrGLSingleTextureEffect;
@@ -18,28 +19,37 @@
class GrSingleTextureEffect : public GrEffect {
public:
- /** Uses default texture params (unfiltered, clamp) */
- GrSingleTextureEffect(GrTexture* texture);
-
- /** Uses default tile mode (clamp) */
- GrSingleTextureEffect(GrTexture* texture, bool bilerp);
-
+ /** These three constructors assume an identity matrix */
+ GrSingleTextureEffect(GrTexture* texture); /* unfiltered, clamp mode */
+ GrSingleTextureEffect(GrTexture* texture, bool bilerp); /* clamp mode */
GrSingleTextureEffect(GrTexture* texture, const GrTextureParams&);
+ /** These three constructors take an explicit matrix */
+ GrSingleTextureEffect(GrTexture*, const GrMatrix&); /* unfiltered, clamp mode */
+ GrSingleTextureEffect(GrTexture*, const GrMatrix&, bool bilerp); /* clamp mode */
+ GrSingleTextureEffect(GrTexture*, const GrMatrix&, const GrTextureParams&);
+
virtual ~GrSingleTextureEffect();
virtual const GrTextureAccess& textureAccess(int index) const SK_OVERRIDE;
static const char* Name() { return "Single Texture"; }
+ const GrMatrix& getMatrix() const { return fMatrix; }
+
typedef GrGLSingleTextureEffect GLEffect;
virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE;
+ virtual bool isEqual(const GrEffect& effect) const SK_OVERRIDE {
+ const GrSingleTextureEffect& ste = static_cast<const GrSingleTextureEffect&>(effect);
+ return INHERITED::isEqual(effect) && fMatrix.cheapEqualTo(ste.getMatrix());
+ }
private:
GR_DECLARE_EFFECT_TEST;
GrTextureAccess fTextureAccess;
+ GrMatrix fMatrix;
typedef GrEffect INHERITED;
};