Rename GrPaint fields/enums/members texture->color mask->coverage.

R=robertphillips@google.com
Review URL: https://codereview.appspot.com/6615046

git-svn-id: http://skia.googlecode.com/svn/trunk@5827 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/texdata.cpp b/gm/texdata.cpp
index cf1a701..a87be45 100644
--- a/gm/texdata.cpp
+++ b/gm/texdata.cpp
@@ -115,10 +115,10 @@
                 ctx->setMatrix(vm);
                 GrMatrix tm;
                 tm = vm;
-                GrMatrix* sampleMat = paint.textureSampler(0)->matrix();
+                GrMatrix* sampleMat = paint.colorSampler(0)->matrix();
                 *sampleMat = vm;
                 sampleMat->postIDiv(2*S, 2*S);
-                paint.textureSampler(0)->setCustomStage(
+                paint.colorSampler(0)->setCustomStage(
                     SkNEW_ARGS(GrSingleTextureEffect, (texture)))->unref();
 
 
diff --git a/include/gpu/GrPaint.h b/include/gpu/GrPaint.h
index f9573bb..9b07a4b 100644
--- a/include/gpu/GrPaint.h
+++ b/include/gpu/GrPaint.h
@@ -24,8 +24,8 @@
 class GrPaint {
 public:
     enum {
-        kMaxTextures = 2,
-        kMaxMasks    = 1,
+        kMaxColorStages     = 2,
+        kMaxCoverageStages  = 1,
     };
 
     // All the paint fields are public except textures/samplers
@@ -42,58 +42,57 @@
     SkXfermode::Mode            fColorFilterXfermode;
     float                       fColorMatrix[20];
 
-    GrSamplerState* textureSampler(int i) {
-        GrAssert((unsigned)i < kMaxTextures);
-        return fTextureSamplers + i;
+    GrSamplerState* colorSampler(int i) {
+        GrAssert((unsigned)i < kMaxColorStages);
+        return fColorSamplers + i;
     }
 
-    const GrSamplerState& getTextureSampler(int i) const {
-        GrAssert((unsigned)i < kMaxTextures);
-        return fTextureSamplers[i];
+    const GrSamplerState& getColorSampler(int i) const {
+        GrAssert((unsigned)i < kMaxColorStages);
+        return fColorSamplers[i];
     }
 
-    bool isTextureStageEnabled(int i) const {
-        GrAssert((unsigned)i < kMaxTextures);
-        return (NULL != fTextureSamplers[i].getCustomStage());
+    bool isColorStageEnabled(int i) const {
+        GrAssert((unsigned)i < kMaxColorStages);
+        return (NULL != fColorSamplers[i].getCustomStage());
     }
 
-
-    // mask's sampler matrix is always applied to the positions
+    // The coverage stage's sampler matrix is always applied to the positions
     // (i.e. no explicit texture coordinates)
-    GrSamplerState* maskSampler(int i) {
-        GrAssert((unsigned)i < kMaxMasks);
-        return fMaskSamplers + i;
+    GrSamplerState* coverageSampler(int i) {
+        GrAssert((unsigned)i < kMaxCoverageStages);
+        return fCoverageSamplers + i;
     }
 
-    const GrSamplerState& getMaskSampler(int i) const {
-        GrAssert((unsigned)i < kMaxMasks);
-        return fMaskSamplers[i];
+    const GrSamplerState& getCoverageSampler(int i) const {
+        GrAssert((unsigned)i < kMaxCoverageStages);
+        return fCoverageSamplers[i];
     }
 
-    bool isMaskStageEnabled(int i) const {
-        GrAssert((unsigned)i < kMaxTextures);
-        return (NULL != fMaskSamplers[i].getCustomStage());
+    bool isCoverageStageEnabled(int i) const {
+        GrAssert((unsigned)i < kMaxCoverageStages);
+        return (NULL != fCoverageSamplers[i].getCustomStage());
     }
 
-    bool hasMask() const {
-        for (int i = 0; i < kMaxMasks; ++i) {
-            if (this->isMaskStageEnabled(i)) {
+    bool hasCoverageStage() const {
+        for (int i = 0; i < kMaxCoverageStages; ++i) {
+            if (this->isCoverageStageEnabled(i)) {
                 return true;
             }
         }
         return false;
     }
 
-    bool hasTexture() const {
-        for (int i = 0; i < kMaxTextures; ++i) {
-            if (this->isTextureStageEnabled(i)) {
+    bool hasColorStage() const {
+        for (int i = 0; i < kMaxColorStages; ++i) {
+            if (this->isColorStageEnabled(i)) {
                 return true;
             }
         }
         return false;
     }
 
-    bool hasTextureOrMask() const { return this->hasTexture() || this->hasMask(); }
+    bool hasStage() const { return this->hasColorStage() || this->hasCoverageStage(); }
 
     /**
      * Preconcats the matrix of all samplers in the mask with the inverse of a
@@ -103,24 +102,24 @@
     bool preConcatSamplerMatricesWithInverse(const GrMatrix& matrix) {
         GrMatrix inv;
         bool computed = false;
-        for (int i = 0; i < kMaxTextures; ++i) {
-            if (this->isTextureStageEnabled(i)) {
+        for (int i = 0; i < kMaxColorStages; ++i) {
+            if (this->isColorStageEnabled(i)) {
                 if (!computed && !matrix.invert(&inv)) {
                     return false;
                 } else {
                     computed = true;
                 }
-                fTextureSamplers[i].preConcatMatrix(inv);
+                fColorSamplers[i].preConcatMatrix(inv);
             }
         }
-        for (int i = 0; i < kMaxMasks; ++i) {
-            if (this->isMaskStageEnabled(i)) {
+        for (int i = 0; i < kMaxCoverageStages; ++i) {
+            if (this->isCoverageStageEnabled(i)) {
                 if (!computed && !matrix.invert(&inv)) {
                     return false;
                 } else {
                     computed = true;
                 }
-                fMaskSamplers[i].preConcatMatrix(inv);
+                fCoverageSamplers[i].preConcatMatrix(inv);
             }
         }
         return true;
@@ -152,14 +151,14 @@
             memcpy(fColorMatrix, paint.fColorMatrix, sizeof(fColorMatrix));
         }
 
-        for (int i = 0; i < kMaxTextures; ++i) {
-            if (paint.isTextureStageEnabled(i)) {
-                fTextureSamplers[i] = paint.fTextureSamplers[i];
+        for (int i = 0; i < kMaxColorStages; ++i) {
+            if (paint.isColorStageEnabled(i)) {
+                fColorSamplers[i] = paint.fColorSamplers[i];
             }
         }
-        for (int i = 0; i < kMaxMasks; ++i) {
-            if (paint.isMaskStageEnabled(i)) {
-                fMaskSamplers[i] = paint.fMaskSamplers[i];
+        for (int i = 0; i < kMaxCoverageStages; ++i) {
+            if (paint.isCoverageStageEnabled(i)) {
+                fCoverageSamplers[i] = paint.fCoverageSamplers[i];
             }
         }
         return *this;
@@ -186,15 +185,15 @@
     // GrPaint's textures and masks map to the first N stages
     // of GrDrawTarget in that order (textures followed by masks)
     enum {
-        kFirstTextureStage = 0,
-        kFirstMaskStage = kMaxTextures,
-        kTotalStages = kMaxTextures + kMaxMasks,
+        kFirstColorStage = 0,
+        kFirstCoverageStage = kMaxColorStages,
+        kTotalStages = kFirstColorStage + kMaxColorStages + kMaxCoverageStages,
     };
 
 private:
 
-    GrSamplerState              fTextureSamplers[kMaxTextures];
-    GrSamplerState              fMaskSamplers[kMaxMasks];
+    GrSamplerState              fColorSamplers[kMaxColorStages];
+    GrSamplerState              fCoverageSamplers[kMaxCoverageStages];
 
     void resetBlend() {
         fSrcBlendCoeff = kOne_GrBlendCoeff;
@@ -215,14 +214,14 @@
     }
 
     void resetTextures() {
-        for (int i = 0; i < kMaxTextures; ++i) {
-            fTextureSamplers[i].reset();
+        for (int i = 0; i < kMaxColorStages; ++i) {
+            fColorSamplers[i].reset();
         }
     }
 
     void resetMasks() {
-        for (int i = 0; i < kMaxMasks; ++i) {
-            fMaskSamplers[i].reset();
+        for (int i = 0; i < kMaxCoverageStages; ++i) {
+            fCoverageSamplers[i].reset();
         }
     }
 };
diff --git a/src/effects/SkBlendImageFilter.cpp b/src/effects/SkBlendImageFilter.cpp
index b604bc2..f171400 100644
--- a/src/effects/SkBlendImageFilter.cpp
+++ b/src/effects/SkBlendImageFilter.cpp
@@ -218,10 +218,10 @@
     sampleM.setIDiv(background->width(), background->height());
     GrPaint paint;
     paint.reset();
-    paint.textureSampler(0)->reset(sampleM);
-    paint.textureSampler(0)->setCustomStage(SkNEW_ARGS(GrSingleTextureEffect, (background.get())))->unref();
-    paint.textureSampler(1)->reset(sampleM);
-    paint.textureSampler(1)->setCustomStage(SkNEW_ARGS(GrBlendEffect, (fMode, foreground.get())))->unref();
+    paint.colorSampler(0)->reset(sampleM);
+    paint.colorSampler(0)->setCustomStage(SkNEW_ARGS(GrSingleTextureEffect, (background.get())))->unref();
+    paint.colorSampler(1)->reset(sampleM);
+    paint.colorSampler(1)->setCustomStage(SkNEW_ARGS(GrBlendEffect, (fMode, foreground.get())))->unref();
     context->drawRect(paint, rect);
     return dst;
 }
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 1d83417..7a4f5a9 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -432,8 +432,8 @@
     sampleM.setIDiv(texture->width(), texture->height());
     GrPaint paint;
     paint.reset();
-    paint.textureSampler(0)->reset(sampleM);
-    paint.textureSampler(0)->setCustomStage(SkNEW_ARGS(GrMorphologyEffect, (texture, direction, radius, morphType)))->unref();
+    paint.colorSampler(0)->reset(sampleM);
+    paint.colorSampler(0)->setCustomStage(SkNEW_ARGS(GrMorphologyEffect, (texture, direction, radius, morphType)))->unref();
     context->drawRect(paint, rect);
 }
 
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index b113ca3..400d6ff 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -603,7 +603,7 @@
         }
         inverse.mapRect(&r);
     } else {
-        if (paint.hasTextureOrMask()) {
+        if (paint.hasStage()) {
             tmpPaint.set(paint);
             p = tmpPaint.get();
             if (!tmpPaint.get()->preConcatSamplerMatricesWithInverse(fDrawState->getViewMatrix())) {
@@ -841,8 +841,8 @@
                                const GrMatrix* srcMatrix) {
     SK_TRACE_EVENT0("GrContext::drawRectToRect");
 
-    // srcRect refers to paint's first texture
-    if (!paint.isTextureStageEnabled(0)) {
+    // srcRect refers to paint's first color stage
+    if (!paint.isColorStageEnabled(0)) {
         drawRect(paint, dstRect, -1, dstMatrix);
         return;
     }
@@ -1830,13 +1830,13 @@
     paint.reset();
 
     for (int i = 1; i < scaleFactorX || i < scaleFactorY; i *= 2) {
-        paint.textureSampler(0)->matrix()->setIDiv(srcTexture->width(),
+        paint.colorSampler(0)->matrix()->setIDiv(srcTexture->width(),
                                                    srcTexture->height());
         this->setRenderTarget(dstTexture->asRenderTarget());
         SkRect dstRect(srcRect);
         scale_rect(&dstRect, i < scaleFactorX ? 0.5f : 1.0f,
                             i < scaleFactorY ? 0.5f : 1.0f);
-        paint.textureSampler(0)->setCustomStage(SkNEW_ARGS(GrSingleTextureEffect,
+        paint.colorSampler(0)->setCustomStage(SkNEW_ARGS(GrSingleTextureEffect,
                                                            (srcTexture, true)))->unref();
         this->drawRectToRect(paint, dstRect, srcRect);
         srcRect = dstRect;
@@ -1891,10 +1891,10 @@
                                       1, srcIRect.height());
         this->clear(&clearRect, 0x0);
         // FIXME:  This should be mitchell, not bilinear.
-        paint.textureSampler(0)->matrix()->setIDiv(srcTexture->width(),
+        paint.colorSampler(0)->matrix()->setIDiv(srcTexture->width(),
                                                    srcTexture->height());
         this->setRenderTarget(dstTexture->asRenderTarget());
-        paint.textureSampler(0)->setCustomStage(SkNEW_ARGS(GrSingleTextureEffect,
+        paint.colorSampler(0)->setCustomStage(SkNEW_ARGS(GrSingleTextureEffect,
                                                            (srcTexture, true)))->unref();
         SkRect dstRect(srcRect);
         scale_rect(&dstRect, (float) scaleFactorX, (float) scaleFactorY);
diff --git a/src/gpu/GrDrawState.cpp b/src/gpu/GrDrawState.cpp
index 2d2dc1a..bd6e268 100644
--- a/src/gpu/GrDrawState.cpp
+++ b/src/gpu/GrDrawState.cpp
@@ -10,19 +10,19 @@
 #include "GrPaint.h"
 
 void GrDrawState::setFromPaint(const GrPaint& paint) {
-    for (int i = 0; i < GrPaint::kMaxTextures; ++i) {
-        int s = i + GrPaint::kFirstTextureStage;
-        if (paint.isTextureStageEnabled(i)) {
-            *this->sampler(s) = paint.getTextureSampler(i);
+    for (int i = 0; i < GrPaint::kMaxColorStages; ++i) {
+        int s = i + GrPaint::kFirstColorStage;
+        if (paint.isColorStageEnabled(i)) {
+            *this->sampler(s) = paint.getColorSampler(i);
         }
     }
 
-    this->setFirstCoverageStage(GrPaint::kFirstMaskStage);
+    this->setFirstCoverageStage(GrPaint::kFirstCoverageStage);
 
-    for (int i = 0; i < GrPaint::kMaxMasks; ++i) {
-        int s = i + GrPaint::kFirstMaskStage;
-        if (paint.isMaskStageEnabled(i)) {
-            *this->sampler(s) = paint.getMaskSampler(i);
+    for (int i = 0; i < GrPaint::kMaxCoverageStages; ++i) {
+        int s = i + GrPaint::kFirstCoverageStage;
+        if (paint.isCoverageStageEnabled(i)) {
+            *this->sampler(s) = paint.getCoverageSampler(i);
         }
     }
 
diff --git a/src/gpu/GrTextContext.cpp b/src/gpu/GrTextContext.cpp
index 109fc6b..5c8b9e5 100644
--- a/src/gpu/GrTextContext.cpp
+++ b/src/gpu/GrTextContext.cpp
@@ -40,7 +40,7 @@
         if (!GrPixelConfigIsAlphaOnly(fCurrTexture->config())) {
             if (kOne_GrBlendCoeff != fPaint.fSrcBlendCoeff ||
                 kISA_GrBlendCoeff != fPaint.fDstBlendCoeff ||
-                fPaint.hasTexture()) {
+                fPaint.hasColorStage()) {
                 GrPrintf("LCD Text will not draw correctly.\n");
             }
             // setup blend so that we get mask * paintColor + (1-mask)*dstColor
@@ -121,19 +121,19 @@
     */
     bool invVMComputed = false;
     GrMatrix invVM;
-    for (int t = 0; t < GrPaint::kMaxTextures; ++t) {
-        if (fPaint.isTextureStageEnabled(t)) {
+    for (int t = 0; t < GrPaint::kMaxColorStages; ++t) {
+        if (fPaint.isColorStageEnabled(t)) {
             if (invVMComputed || fOrigViewMatrix.invert(&invVM)) {
                 invVMComputed = true;
-                fPaint.textureSampler(t)->preConcatMatrix(invVM);
+                fPaint.colorSampler(t)->preConcatMatrix(invVM);
             }
         }
     }
-    for (int m = 0; m < GrPaint::kMaxMasks; ++m) {
-        if (fPaint.isMaskStageEnabled(m)) {
+    for (int m = 0; m < GrPaint::kMaxCoverageStages; ++m) {
+        if (fPaint.isCoverageStageEnabled(m)) {
             if (invVMComputed || fOrigViewMatrix.invert(&invVM)) {
                 invVMComputed = true;
-                fPaint.maskSampler(m)->preConcatMatrix(invVM);
+                fPaint.coverageSampler(m)->preConcatMatrix(invVM);
             }
         }
     }
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index c712a0d..a792977 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -475,7 +475,7 @@
 bool SkGpuDevice::bindDeviceAsTexture(GrPaint* paint) {
     GrTexture* texture = fRenderTarget->asTexture();
     if (NULL != texture) {
-        paint->textureSampler(kBitmapTextureIdx)->setCustomStage(
+        paint->colorSampler(kBitmapTextureIdx)->setCustomStage(
             SkNEW_ARGS(GrSingleTextureEffect, (texture)))->unref();
         return true;
     }
@@ -537,7 +537,7 @@
         GrAssert(!constantColor);
     } else {
         grPaint->fColor = SkColor2GrColor(skPaint.getColor());
-        GrAssert(!grPaint->isTextureStageEnabled(kShaderTextureIdx));
+        GrAssert(!grPaint->isColorStageEnabled(kShaderTextureIdx));
     }
     SkColorFilter* colorFilter = skPaint.getColorFilter();
     SkColor color;
@@ -564,7 +564,7 @@
 
         // pass NULL because the color table effect doesn't use tiling or filtering.
         GrTexture* texture = act->set(dev, colorTransformTable, NULL);
-        GrSamplerState* colorSampler = grPaint->textureSampler(kColorFilterTextureIdx);
+        GrSamplerState* colorSampler = grPaint->colorSampler(kColorFilterTextureIdx);
         colorSampler->reset();
         colorSampler->setCustomStage(SkNEW_ARGS(GrColorTableEffect, (texture)))->unref();
     }
@@ -578,7 +578,7 @@
 inline bool skPaint2GrPaintShader(SkGpuDevice* dev,
                                   const SkPaint& skPaint,
                                   bool constantColor,
-                                  SkGpuDevice::SkAutoCachedTexture textures[GrPaint::kMaxTextures],
+                                  SkGpuDevice::SkAutoCachedTexture textures[GrPaint::kMaxColorStages],
                                   GrPaint* grPaint) {
     SkShader* shader = skPaint.getShader();
     if (NULL == shader) {
@@ -593,7 +593,7 @@
         return false;
     }
 
-    GrSamplerState* sampler = grPaint->textureSampler(kShaderTextureIdx);
+    GrSamplerState* sampler = grPaint->colorSampler(kShaderTextureIdx);
     GrCustomStage* stage = shader->asNewCustomStage(dev->context(), sampler);
 
     if (NULL != stage) {
@@ -677,7 +677,7 @@
     CHECK_SHOULD_DRAW(draw);
 
     GrPaint grPaint;
-    SkAutoCachedTexture textures[GrPaint::kMaxTextures];
+    SkAutoCachedTexture textures[GrPaint::kMaxColorStages];
     if (!skPaint2GrPaintShader(this,
                                paint,
                                true,
@@ -713,7 +713,7 @@
     }
 
     GrPaint grPaint;
-    SkAutoCachedTexture textures[GrPaint::kMaxTextures];
+    SkAutoCachedTexture textures[GrPaint::kMaxColorStages];
     if (!skPaint2GrPaintShader(this,
                                paint,
                                true,
@@ -775,7 +775,7 @@
     }
 
     GrPaint grPaint;
-    SkAutoCachedTexture textures[GrPaint::kMaxTextures];
+    SkAutoCachedTexture textures[GrPaint::kMaxColorStages];
     if (!skPaint2GrPaintShader(this,
                                paint,
                                true,
@@ -920,11 +920,11 @@
         if (!isNormalBlur) {
             GrPaint paint;
             paint.reset();
-            paint.textureSampler(0)->matrix()->setIDiv(pathTexture->width(),
+            paint.colorSampler(0)->matrix()->setIDiv(pathTexture->width(),
                                                        pathTexture->height());
             // Blend pathTexture over blurTexture.
             context->setRenderTarget(blurTexture->asRenderTarget());
-            paint.textureSampler(0)->setCustomStage(SkNEW_ARGS
+            paint.colorSampler(0)->setCustomStage(SkNEW_ARGS
                 (GrSingleTextureEffect, (pathTexture)))->unref();
             if (SkMaskFilter::kInner_BlurType == blurType) {
                 // inner:  dst = dst * src
@@ -949,15 +949,15 @@
         return false;
     }
 
-    static const int MASK_IDX = GrPaint::kMaxMasks - 1;
+    static const int MASK_IDX = GrPaint::kMaxCoverageStages - 1;
     // we assume the last mask index is available for use
-    GrAssert(!grp->isMaskStageEnabled(MASK_IDX));
-    grp->maskSampler(MASK_IDX)->reset();
-    grp->maskSampler(MASK_IDX)->setCustomStage(
+    GrAssert(!grp->isCoverageStageEnabled(MASK_IDX));
+    grp->coverageSampler(MASK_IDX)->reset();
+    grp->coverageSampler(MASK_IDX)->setCustomStage(
         SkNEW_ARGS(GrSingleTextureEffect, (blurTexture)))->unref();
-    grp->maskSampler(MASK_IDX)->matrix()->setTranslate(-finalRect.fLeft,
+    grp->coverageSampler(MASK_IDX)->matrix()->setTranslate(-finalRect.fLeft,
                                                        -finalRect.fTop);
-    grp->maskSampler(MASK_IDX)->matrix()->postIDiv(blurTexture->width(),
+    grp->coverageSampler(MASK_IDX)->matrix()->postIDiv(blurTexture->width(),
                                                    blurTexture->height());
     context->drawRect(*grp, finalRect);
     return true;
@@ -1012,11 +1012,11 @@
     texture->writePixels(0, 0, desc.fWidth, desc.fHeight, desc.fConfig,
                                dstM.fImage, dstM.fRowBytes);
 
-    static const int MASK_IDX = GrPaint::kMaxMasks - 1;
+    static const int MASK_IDX = GrPaint::kMaxCoverageStages - 1;
     // we assume the last mask index is available for use
-    GrAssert(!grp->isMaskStageEnabled(MASK_IDX));
-    grp->maskSampler(MASK_IDX)->reset();
-    grp->maskSampler(MASK_IDX)->setCustomStage(
+    GrAssert(!grp->isCoverageStageEnabled(MASK_IDX));
+    grp->coverageSampler(MASK_IDX)->reset();
+    grp->coverageSampler(MASK_IDX)->setCustomStage(
         SkNEW_ARGS(GrSingleTextureEffect, (texture)))->unref();
     GrRect d;
     d.setLTRB(GrIntToScalar(dstM.fBounds.fLeft),
@@ -1024,7 +1024,7 @@
               GrIntToScalar(dstM.fBounds.fRight),
               GrIntToScalar(dstM.fBounds.fBottom));
 
-    GrMatrix* m = grp->maskSampler(MASK_IDX)->matrix();
+    GrMatrix* m = grp->coverageSampler(MASK_IDX)->matrix();
     m->setTranslate(-dstM.fBounds.fLeft*SK_Scalar1,
                          -dstM.fBounds.fTop*SK_Scalar1);
     m->postIDiv(texture->width(), texture->height());
@@ -1045,7 +1045,7 @@
     bool             doFill = true;
 
     GrPaint grPaint;
-    SkAutoCachedTexture textures[GrPaint::kMaxTextures];
+    SkAutoCachedTexture textures[GrPaint::kMaxColorStages];
     if (!skPaint2GrPaintShader(this,
                                paint,
                                true,
@@ -1435,7 +1435,7 @@
         return;
     }
 
-    GrSamplerState* sampler = grPaint->textureSampler(kBitmapTextureIdx);
+    GrSamplerState* sampler = grPaint->colorSampler(kBitmapTextureIdx);
 
     sampler->matrix()->reset();
 
@@ -1501,7 +1501,7 @@
     } else {
         stage.reset(SkNEW_ARGS(GrSingleTextureEffect, (texture, params)));
     }
-    grPaint->textureSampler(kBitmapTextureIdx)->setCustomStage(stage);
+    grPaint->colorSampler(kBitmapTextureIdx)->setCustomStage(stage);
     fContext->drawRectToRect(*grPaint, dstRect, paintRect, &m);
 }
 
@@ -1521,8 +1521,8 @@
     sampleM.setIDiv(srcTexture->width(), srcTexture->height());
     GrPaint paint;
     paint.reset();
-    paint.textureSampler(0)->reset(sampleM);
-    paint.textureSampler(0)->setCustomStage(stage);
+    paint.colorSampler(0)->reset(sampleM);
+    paint.colorSampler(0)->setCustomStage(stage);
     context->drawRect(paint, rect);
 }
 
@@ -1572,13 +1572,13 @@
 
     GrContext::AutoMatrix avm(fContext, GrMatrix::I());
 
-    GrSamplerState* sampler = grPaint.textureSampler(kBitmapTextureIdx);
+    GrSamplerState* sampler = grPaint.colorSampler(kBitmapTextureIdx);
 
     GrTexture* texture;
     sampler->reset();
     // draw sprite uses the default texture params
     SkAutoCachedTexture act(this, bitmap, NULL, &texture);
-    grPaint.textureSampler(kBitmapTextureIdx)->setCustomStage(SkNEW_ARGS
+    grPaint.colorSampler(kBitmapTextureIdx)->setCustomStage(SkNEW_ARGS
         (GrSingleTextureEffect, (texture)))->unref();
 
     SkImageFilter* filter = paint.getImageFilter();
@@ -1586,7 +1586,7 @@
         GrTexture* filteredTexture = filter_texture(this, fContext, texture, filter,
                  GrRect::MakeWH(SkIntToScalar(w), SkIntToScalar(h)));
         if (filteredTexture) {
-            grPaint.textureSampler(kBitmapTextureIdx)->setCustomStage(SkNEW_ARGS
+            grPaint.colorSampler(kBitmapTextureIdx)->setCustomStage(SkNEW_ARGS
                 (GrSingleTextureEffect, (filteredTexture)))->unref();
             texture = filteredTexture;
             filteredTexture->unref();
@@ -1645,13 +1645,13 @@
 
     GrPaint grPaint;
     SkAutoCachedTexture colorLutTexture;
-    grPaint.textureSampler(kBitmapTextureIdx)->reset();
+    grPaint.colorSampler(kBitmapTextureIdx)->reset();
     if (!dev->bindDeviceAsTexture(&grPaint) ||
         !skPaint2GrPaintNoShader(this, paint, true, false, &colorLutTexture, &grPaint)) {
         return;
     }
 
-    GrTexture* devTex = grPaint.getTextureSampler(kBitmapTextureIdx).getCustomStage()->texture(0);
+    GrTexture* devTex = grPaint.getColorSampler(kBitmapTextureIdx).getCustomStage()->texture(0);
     SkASSERT(NULL != devTex);
 
     SkImageFilter* filter = paint.getImageFilter();
@@ -1660,7 +1660,7 @@
                                      SkIntToScalar(devTex->height()));
         GrTexture* filteredTexture = filter_texture(this, fContext, devTex, filter, rect);
         if (filteredTexture) {
-            grPaint.textureSampler(kBitmapTextureIdx)->setCustomStage(SkNEW_ARGS
+            grPaint.colorSampler(kBitmapTextureIdx)->setCustomStage(SkNEW_ARGS
                 (GrSingleTextureEffect, (filteredTexture)))->unref();
             devTex = filteredTexture;
             filteredTexture->unref();
@@ -1744,7 +1744,7 @@
     CHECK_SHOULD_DRAW(draw);
 
     GrPaint grPaint;
-    SkAutoCachedTexture textures[GrPaint::kMaxTextures];
+    SkAutoCachedTexture textures[GrPaint::kMaxColorStages];
     // we ignore the shader if texs is null.
     if (NULL == texs) {
         if (!skPaint2GrPaintNoShader(this,
@@ -1859,7 +1859,7 @@
         SkDraw myDraw(draw);
 
         GrPaint grPaint;
-        SkAutoCachedTexture textures[GrPaint::kMaxTextures];
+        SkAutoCachedTexture textures[GrPaint::kMaxColorStages];
         if (!skPaint2GrPaintShader(this,
                                    paint,
                                    true,
@@ -1887,7 +1887,7 @@
         SkDraw myDraw(draw);
 
         GrPaint grPaint;
-        SkAutoCachedTexture textures[GrPaint::kMaxTextures];
+        SkAutoCachedTexture textures[GrPaint::kMaxColorStages];
         if (!skPaint2GrPaintShader(this,
                                    paint,
                                    true,
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index 6852f91..3af0979 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -186,16 +186,16 @@
                                                              (tempTex, false, *pmToUPMRule)));
 
         context->setRenderTarget(readTex->asRenderTarget());
-        paint.textureSampler(0)->setCustomStage(pmToUPMStage1);
+        paint.colorSampler(0)->setCustomStage(pmToUPMStage1);
         context->drawRectToRect(paint, kDstRect, kSrcRect);
 
         readTex->readPixels(0, 0, 256, 256, kRGBA_8888_GrPixelConfig, firstRead);
 
         context->setRenderTarget(tempTex->asRenderTarget());
-        paint.textureSampler(0)->setCustomStage(upmToPMStage);
+        paint.colorSampler(0)->setCustomStage(upmToPMStage);
         context->drawRectToRect(paint, kDstRect, kSrcRect);
         context->setRenderTarget(readTex->asRenderTarget());
-        paint.textureSampler(0)->setCustomStage(pmToUPMStage2);
+        paint.colorSampler(0)->setCustomStage(pmToUPMStage2);
         context->drawRectToRect(paint, kDstRect, kSrcRect);
 
         readTex->readPixels(0, 0, 256, 256, kRGBA_8888_GrPixelConfig, secondRead);