Adds local coords to GrEffect system.
Effects can ask the builder for local coords which may or may not be distinct from positions.
GrEffectStage tracks changes to relationship between pos and local coords.
GrGLEffectMatrix and GrSingleTextureEffect can use either pos or textures as intput coords
GrSimpleTextureEffect now allows for an explicit texture coords attribute.
Review URL: https://codereview.chromium.org/12531015
git-svn-id: http://skia.googlecode.com/svn/trunk@8264 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/effects/GrSingleTextureEffect.cpp b/src/gpu/effects/GrSingleTextureEffect.cpp
index 7183ba3..0c671f1 100644
--- a/src/gpu/effects/GrSingleTextureEffect.cpp
+++ b/src/gpu/effects/GrSingleTextureEffect.cpp
@@ -7,23 +7,32 @@
#include "effects/GrSingleTextureEffect.h"
-GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture, const SkMatrix& m)
+GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture,
+ const SkMatrix& m,
+ CoordsType coordsType)
: fTextureAccess(texture)
- , fMatrix(m) {
- this->addTextureAccess(&fTextureAccess);
-}
-
-GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture, const SkMatrix& m, bool bilerp)
- : fTextureAccess(texture, bilerp)
- , fMatrix(m) {
+ , fMatrix(m)
+ , fCoordsType(coordsType) {
this->addTextureAccess(&fTextureAccess);
}
GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture,
const SkMatrix& m,
- const GrTextureParams& params)
+ bool bilerp,
+ CoordsType coordsType)
+ : fTextureAccess(texture, bilerp)
+ , fMatrix(m)
+ , fCoordsType(coordsType) {
+ this->addTextureAccess(&fTextureAccess);
+}
+
+GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture,
+ const SkMatrix& m,
+ const GrTextureParams& params,
+ CoordsType coordsType)
: fTextureAccess(texture, params)
- , fMatrix(m) {
+ , fMatrix(m)
+ , fCoordsType(coordsType) {
this->addTextureAccess(&fTextureAccess);
}