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/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 6fdc3a0..cd4d4d2 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -529,11 +529,9 @@
 
 void GrDrawTarget::drawRect(const GrRect& rect,
                             const SkMatrix* matrix,
-                            const GrRect* srcRect,
-                            const SkMatrix* srcMatrix,
-                            int stage) {
+                            const GrRect* localRect,
+                            const SkMatrix* localMatrix) {
     GrAttribBindings bindings = 0;
-    uint32_t explicitCoordMask = 0;
     // position + (optional) texture coord
     static const GrVertexAttrib kAttribs[] = {
         {kVec2f_GrVertexAttribType, 0},
@@ -541,16 +539,15 @@
     };
     int attribCount = 1;
 
-    if (NULL != srcRect) {
-        bindings |= GrDrawState::ExplicitTexCoordAttribBindingsBit(stage);
+    if (NULL != localRect) {
+        bindings |= GrDrawState::kLocalCoords_AttribBindingsBit;
         attribCount = 2;
-        this->drawState()->setAttribIndex(GrDrawState::kTexCoord_AttribIndex, 1);
-        explicitCoordMask = (1 << stage);
+        this->drawState()->setAttribIndex(GrDrawState::kLocalCoords_AttribIndex, 1);
     }
 
     GrDrawState::AutoViewMatrixRestore avmr;
     if (NULL != matrix) {
-        avmr.set(this->drawState(), *matrix, explicitCoordMask);
+        avmr.set(this->drawState(), *matrix);
     }
 
     this->drawState()->setVertexAttribs(kAttribs, attribCount);
@@ -564,15 +561,15 @@
 
     size_t vsize = this->drawState()->getVertexSize();
     geo.positions()->setRectFan(rect.fLeft, rect.fTop, rect.fRight, rect.fBottom, vsize);
-    if (NULL != srcRect) {
+    if (NULL != localRect) {
         GrAssert(attribCount == 2);
         GrPoint* coords = GrTCast<GrPoint*>(GrTCast<intptr_t>(geo.vertices()) +
                                             kAttribs[1].fOffset);
-        coords->setRectFan(srcRect->fLeft, srcRect->fTop,
-                            srcRect->fRight, srcRect->fBottom,
-                            vsize);
-        if (NULL != srcMatrix) {
-            srcMatrix->mapPointsWithStride(coords, vsize, 4);
+        coords->setRectFan(localRect->fLeft, localRect->fTop,
+                           localRect->fRight, localRect->fBottom,
+                           vsize);
+        if (NULL != localMatrix) {
+            localMatrix->mapPointsWithStride(coords, vsize, 4);
         }
     }