GrCustomStage Renaming Part 2

GrSamplerState member rename
GrCustomStageUnitTest rename
some comment updates
Review URL: https://codereview.appspot.com/6771043

git-svn-id: http://skia.googlecode.com/svn/trunk@6078 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/effects/SkBlendImageFilter.cpp b/src/effects/SkBlendImageFilter.cpp
index b658acc..fcda114 100644
--- a/src/effects/SkBlendImageFilter.cpp
+++ b/src/effects/SkBlendImageFilter.cpp
@@ -207,9 +207,9 @@
     backgroundTexMatrix.setIDiv(background->width(), background->height());
     foregroundTexMatrix.setIDiv(foreground->width(), foreground->height());
     GrPaint paint;
-    paint.colorSampler(0)->setCustomStage(
+    paint.colorSampler(0)->setEffect(
         SkNEW_ARGS(GrSingleTextureEffect, (background.get())), backgroundTexMatrix)->unref();
-    paint.colorSampler(1)->setCustomStage(
+    paint.colorSampler(1)->setEffect(
         SkNEW_ARGS(GrBlendEffect, (fMode, foreground.get())), foregroundTexMatrix)->unref();
     context->drawRect(paint, rect);
     return dst;
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index 8e98415..ab962fb 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -1046,7 +1046,7 @@
     SkScalar surfaceScale = random->nextSScalar1();
     SkScalar kd = random->nextUScalar1();
     SkAutoTUnref<SkLight> light(create_random_light(random));
-    return SkNEW_ARGS(GrDiffuseLightingEffect, (textures[GrCustomStageUnitTest::kAlphaTextureIdx],
+    return SkNEW_ARGS(GrDiffuseLightingEffect, (textures[GrEffectUnitTest::kAlphaTextureIdx],
                                                 light, surfaceScale, kd));
 }
 
@@ -1253,7 +1253,7 @@
     SkScalar ks = random->nextUScalar1();
     SkScalar shininess = random->nextUScalar1();
     SkAutoTUnref<SkLight> light(create_random_light(random));
-    return SkNEW_ARGS(GrSpecularLightingEffect, (textures[GrCustomStageUnitTest::kAlphaTextureIdx],
+    return SkNEW_ARGS(GrSpecularLightingEffect, (textures[GrEffectUnitTest::kAlphaTextureIdx],
                                                  light, surfaceScale, ks, shininess));
 }
 
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp
index 3d26189..2f6d71c 100644
--- a/src/effects/SkMatrixConvolutionImageFilter.cpp
+++ b/src/effects/SkMatrixConvolutionImageFilter.cpp
@@ -495,8 +495,8 @@
 GrEffect* GrMatrixConvolutionEffect::TestCreate(SkRandom* random,
                                                 GrContext* context,
                                                 GrTexture* textures[]) {
-    int texIdx = random->nextBool() ? GrCustomStageUnitTest::kSkiaPMTextureIdx :
-                                      GrCustomStageUnitTest::kAlphaTextureIdx;
+    int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx :
+                                      GrEffectUnitTest::kAlphaTextureIdx;
     int width = random->nextRangeU(1, MAX_KERNEL_SIZE);
     int height = random->nextRangeU(1, MAX_KERNEL_SIZE / width);
     SkISize kernelSize = SkISize::Make(width, height);
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index dcd38b7..fb82f4f 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -403,8 +403,8 @@
 GrEffect* GrMorphologyEffect::TestCreate(SkRandom* random,
                                          GrContext* context,
                                          GrTexture* textures[]) {
-    int texIdx = random->nextBool() ? GrCustomStageUnitTest::kSkiaPMTextureIdx :
-                                      GrCustomStageUnitTest::kAlphaTextureIdx;
+    int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx :
+                                      GrEffectUnitTest::kAlphaTextureIdx;
     Direction dir = random->nextBool() ? kX_Direction : kY_Direction;
     static const int kMaxRadius = 10;
     int radius = random->nextRangeU(1, kMaxRadius);
@@ -425,7 +425,7 @@
     GrMatrix sampleM;
     sampleM.setIDiv(texture->width(), texture->height());
     GrPaint paint;
-    paint.colorSampler(0)->setCustomStage(SkNEW_ARGS(GrMorphologyEffect, (texture, direction, radius, morphType)), sampleM)->unref();
+    paint.colorSampler(0)->setEffect(SkNEW_ARGS(GrMorphologyEffect, (texture, direction, radius, morphType)), sampleM)->unref();
     context->drawRect(paint, rect);
 }
 
diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp
index 71d56e2..cbbf7e1 100644
--- a/src/effects/SkTableColorFilter.cpp
+++ b/src/effects/SkTableColorFilter.cpp
@@ -347,7 +347,7 @@
 GrEffect* ColorTableEffect::TestCreate(SkRandom* random,
                                        GrContext* context,
                                        GrTexture* textures[]) {
-    return SkNEW_ARGS(ColorTableEffect, (textures[GrCustomStageUnitTest::kAlphaTextureIdx]));
+    return SkNEW_ARGS(ColorTableEffect, (textures[GrEffectUnitTest::kAlphaTextureIdx]));
 }
 
 GrEffect* SkTable_ColorFilter::asNewCustomStage(GrContext* context) const {
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp
index 5b351d3..21b415d 100644
--- a/src/effects/gradients/SkLinearGradient.cpp
+++ b/src/effects/gradients/SkLinearGradient.cpp
@@ -540,10 +540,10 @@
                                                                  tm));
     GrSamplerState sampler;
     shader->asNewCustomStage(context, &sampler);
-    GrAssert(NULL != sampler.getCustomStage());
+    GrAssert(NULL != sampler.getEffect());
     // const_cast and ref is a hack! Will remove when asNewCustomStage returns GrEffect*
-    sampler.getCustomStage()->ref();
-    return const_cast<GrEffect*>(sampler.getCustomStage());
+    sampler.getEffect()->ref();
+    return const_cast<GrEffect*>(sampler.getEffect());
 }
 
 /////////////////////////////////////////////////////////////////////
@@ -570,9 +570,9 @@
             return false;
         }
         matrix.postConcat(fPtsToUnit);
-        sampler->setCustomStage(stage, matrix);
+        sampler->setEffect(stage, matrix);
     } else {
-        sampler->setCustomStage(stage, fPtsToUnit);
+        sampler->setEffect(stage, fPtsToUnit);
     }
 
     return true;
diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp
index ca8325d..74d16d5 100644
--- a/src/effects/gradients/SkRadialGradient.cpp
+++ b/src/effects/gradients/SkRadialGradient.cpp
@@ -539,10 +539,10 @@
                                                                  tm));
     GrSamplerState sampler;
     shader->asNewCustomStage(context, &sampler);
-    GrAssert(NULL != sampler.getCustomStage());
+    GrAssert(NULL != sampler.getEffect());
     // const_cast and ref is a hack! Will remove when asNewCustomStage returns GrEffect*
-    sampler.getCustomStage()->ref();
-    return const_cast<GrEffect*>(sampler.getCustomStage());
+    sampler.getEffect()->ref();
+    return const_cast<GrEffect*>(sampler.getEffect());
 }
 
 /////////////////////////////////////////////////////////////////////
@@ -568,9 +568,9 @@
             return false;
         }
         matrix.postConcat(fPtsToUnit);
-        sampler->setCustomStage(stage, matrix);
+        sampler->setEffect(stage, matrix);
     } else {
-        sampler->setCustomStage(stage, fPtsToUnit);
+        sampler->setEffect(stage, fPtsToUnit);
     }
 
     return true;
diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp
index 416babc..365507b 100644
--- a/src/effects/gradients/SkSweepGradient.cpp
+++ b/src/effects/gradients/SkSweepGradient.cpp
@@ -445,10 +445,10 @@
                                                                 colors, stops, colorCount));
     GrSamplerState sampler;
     shader->asNewCustomStage(context, &sampler);
-    GrAssert(NULL != sampler.getCustomStage());
+    GrAssert(NULL != sampler.getEffect());
     // const_cast and ref is a hack! Will remove when asNewCustomStage returns GrEffect*
-    sampler.getCustomStage()->ref();
-    return const_cast<GrEffect*>(sampler.getCustomStage());
+    sampler.getEffect()->ref();
+    return const_cast<GrEffect*>(sampler.getEffect());
 }
 
 /////////////////////////////////////////////////////////////////////
@@ -475,9 +475,9 @@
             return false;
         }
         matrix.postConcat(fPtsToUnit);
-        sampler->setCustomStage(stage, matrix);
+        sampler->setEffect(stage, matrix);
     } else {
-        sampler->setCustomStage(stage, fPtsToUnit);
+        sampler->setEffect(stage, fPtsToUnit);
     }
 
     return true;
diff --git a/src/effects/gradients/SkTwoPointConicalGradient.cpp b/src/effects/gradients/SkTwoPointConicalGradient.cpp
index 1b0f58f..4472d03 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient.cpp
@@ -439,10 +439,10 @@
                                                                           tm));
     GrSamplerState sampler;
     shader->asNewCustomStage(context, &sampler);
-    GrAssert(NULL != sampler.getCustomStage());
+    GrAssert(NULL != sampler.getEffect());
     // const_cast and ref is a hack! Will remove when asNewCustomStage returns GrEffect*
-    sampler.getCustomStage()->ref();
-    return const_cast<GrEffect*>(sampler.getCustomStage());
+    sampler.getEffect()->ref();
+    return const_cast<GrEffect*>(sampler.getEffect());
 }
 
 
@@ -693,7 +693,7 @@
         matrix.preConcat(localM);
     }
 
-    sampler->setCustomStage(SkNEW_ARGS(GrConical2Gradient, (context, *this, fTileMode)), matrix)->unref();
+    sampler->setEffect(SkNEW_ARGS(GrConical2Gradient, (context, *this, fTileMode)), matrix)->unref();
 
     return true;
 }
diff --git a/src/effects/gradients/SkTwoPointRadialGradient.cpp b/src/effects/gradients/SkTwoPointRadialGradient.cpp
index 50938f6..78220f8 100644
--- a/src/effects/gradients/SkTwoPointRadialGradient.cpp
+++ b/src/effects/gradients/SkTwoPointRadialGradient.cpp
@@ -473,10 +473,10 @@
                                                                          tm));
     GrSamplerState sampler;
     shader->asNewCustomStage(context, &sampler);
-    GrAssert(NULL != sampler.getCustomStage());
+    GrAssert(NULL != sampler.getEffect());
     // const_cast and ref is a hack! Will remove when asNewCustomStage returns GrEffect*
-    sampler.getCustomStage()->ref();
-    return const_cast<GrEffect*>(sampler.getCustomStage());
+    sampler.getEffect()->ref();
+    return const_cast<GrEffect*>(sampler.getEffect());
 }
 
 /////////////////////////////////////////////////////////////////////
@@ -665,7 +665,7 @@
         matrix.preConcat(localM);
     }
 
-    sampler->setCustomStage(SkNEW_ARGS(GrRadial2Gradient, (context, *this, fTileMode)), matrix)->unref();
+    sampler->setEffect(SkNEW_ARGS(GrRadial2Gradient, (context, *this, fTileMode)), matrix)->unref();
     return true;
 }
 
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 93b8b31..e6d5b4c 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -205,7 +205,7 @@
     SkAutoTUnref<GrConvolutionEffect> conv(SkNEW_ARGS(GrConvolutionEffect,
                                                       (texture, direction, radius,
                                                        sigma)));
-    drawState->sampler(0)->setCustomStage(conv, sampleM);
+    drawState->sampler(0)->setEffect(conv, sampleM);
     target->drawSimpleRect(rect, NULL);
 }
 
@@ -1345,7 +1345,7 @@
                     matrix.setTranslate(SK_Scalar1 *left, SK_Scalar1 *top);
                 }
                 matrix.postIDiv(src->width(), src->height());
-                drawState->sampler(0)->setCustomStage(stage, matrix);
+                drawState->sampler(0)->setEffect(stage, matrix);
                 GrRect rect = GrRect::MakeWH(GrIntToScalar(width), GrIntToScalar(height));
                 fGpu->drawSimpleRect(rect, NULL);
                 // we want to read back from the scratch's origin
@@ -1553,7 +1553,7 @@
     drawState->setRenderTarget(target);
 
     matrix.setIDiv(texture->width(), texture->height());
-    drawState->sampler(0)->setCustomStage(stage, matrix);
+    drawState->sampler(0)->setEffect(stage, matrix);
 
     fGpu->drawSimpleRect(GrRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height)), NULL);
 }
@@ -1817,8 +1817,8 @@
         scale_rect(&dstRect, i < scaleFactorX ? 0.5f : 1.0f,
                              i < scaleFactorY ? 0.5f : 1.0f);
 
-        paint.colorSampler(0)->setCustomStage(SkNEW_ARGS(GrSingleTextureEffect,
-                                                         (srcTexture, true)), matrix)->unref();
+        paint.colorSampler(0)->setEffect(SkNEW_ARGS(GrSingleTextureEffect,
+                                                    (srcTexture, true)), matrix)->unref();
         this->drawRectToRect(paint, dstRect, srcRect);
         srcRect = dstRect;
         srcTexture = dstTexture;
@@ -1875,9 +1875,8 @@
         // FIXME:  This should be mitchell, not bilinear.
         matrix.setIDiv(srcTexture->width(), srcTexture->height());
         this->setRenderTarget(dstTexture->asRenderTarget());
-        paint.colorSampler(0)->setCustomStage(SkNEW_ARGS(GrSingleTextureEffect,
-                                                         (srcTexture, true)),
-                                              matrix)->unref();
+        paint.colorSampler(0)->setEffect(SkNEW_ARGS(GrSingleTextureEffect,(srcTexture, true)),
+                                         matrix)->unref();
         SkRect dstRect(srcRect);
         scale_rect(&dstRect, (float) scaleFactorX, (float) scaleFactorY);
         this->drawRectToRect(paint, dstRect, srcRect);
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h
index 6951d46..f8db4a5 100644
--- a/src/gpu/GrDrawState.h
+++ b/src/gpu/GrDrawState.h
@@ -69,8 +69,7 @@
 
     /**
      * Resets to the default state.
-     * Sampler states *will* be modified: textures or CustomStage objects
-     * will be released.
+     * Sampler states *will* be modified: textures or GrEffect objects will be released.
      */
     void reset() {
 
@@ -190,27 +189,27 @@
      * Creates a GrSingleTextureEffect.
      */
     void createTextureEffect(int stage, GrTexture* texture) {
-        GrAssert(!this->getSampler(stage).getCustomStage());
-        this->sampler(stage)->setCustomStage(
+        GrAssert(!this->getSampler(stage).getEffect());
+        this->sampler(stage)->setEffect(
             SkNEW_ARGS(GrSingleTextureEffect, (texture)))->unref();
     }
     void createTextureEffect(int stage, GrTexture* texture, const GrMatrix& matrix) {
-        GrAssert(!this->getSampler(stage).getCustomStage());
+        GrAssert(!this->getSampler(stage).getEffect());
         GrEffect* customStage = SkNEW_ARGS(GrSingleTextureEffect, (texture));
-        this->sampler(stage)->setCustomStage(customStage, matrix)->unref();
+        this->sampler(stage)->setEffect(customStage, matrix)->unref();
     }
     void createTextureEffect(int stage, GrTexture* texture,
                              const GrMatrix& matrix,
                              const GrTextureParams& params) {
-        GrAssert(!this->getSampler(stage).getCustomStage());
+        GrAssert(!this->getSampler(stage).getEffect());
         GrEffect* customStage = SkNEW_ARGS(GrSingleTextureEffect, (texture, params));
-        this->sampler(stage)->setCustomStage(customStage, matrix)->unref();
+        this->sampler(stage)->setEffect(customStage, matrix)->unref();
     }
 
 
     bool stagesDisabled() {
         for (int i = 0; i < kNumStages; ++i) {
-            if (NULL != fSamplerStates[i].getCustomStage()) {
+            if (NULL != fSamplerStates[i].getEffect()) {
                 return false;
             }
         }
@@ -218,7 +217,7 @@
     }
 
     void disableStage(int index) {
-        fSamplerStates[index].setCustomStage(NULL);
+        fSamplerStates[index].setEffect(NULL);
     }
 
     /**
@@ -825,7 +824,7 @@
 
     bool isStageEnabled(int s) const {
         GrAssert((unsigned)s < kNumStages);
-        return (NULL != fSamplerStates[s].getCustomStage());
+        return (NULL != fSamplerStates[s].getEffect());
     }
 
     // Most stages are usually not used, so conditionals here
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 56dc8d8..d365a89 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -748,7 +748,7 @@
     GrAssert(NULL != drawState.getRenderTarget());
     for (int s = 0; s < GrDrawState::kNumStages; ++s) {
         if (drawState.isStageEnabled(s)) {
-            const GrEffect* stage = drawState.getSampler(s).getCustomStage();
+            const GrEffect* stage = drawState.getSampler(s).getEffect();
             int numTextures = stage->numTextures();
             for (int t = 0; t < numTextures; ++t) {
                 GrTexture* texture = stage->texture(t);
@@ -831,7 +831,7 @@
     // Check if a color stage could create a partial alpha
     for (int s = 0; s < drawState.getFirstCoverageStage(); ++s) {
         if (this->isStageEnabled(s)) {
-            const GrEffect* stage = drawState.getSampler(s).getCustomStage();
+            const GrEffect* stage = drawState.getSampler(s).getEffect();
             // FIXME: The param indicates whether the texture is opaque or not. However, the stage
             // already controls its textures. It really needs to know whether the incoming color
             // (from a uni, per-vertex colors, or previous stage) is opaque or not.
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 74a2888..b87089c 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -441,7 +441,7 @@
 bool SkGpuDevice::bindDeviceAsTexture(GrPaint* paint) {
     GrTexture* texture = fRenderTarget->asTexture();
     if (NULL != texture) {
-        paint->colorSampler(kBitmapTextureIdx)->setCustomStage(
+        paint->colorSampler(kBitmapTextureIdx)->setEffect(
             SkNEW_ARGS(GrSingleTextureEffect, (texture)))->unref();
         return true;
     }
@@ -514,7 +514,7 @@
         } else {
             SkAutoTUnref<GrEffect> stage(colorFilter->asNewCustomStage(dev->context()));
             if (NULL != stage.get()) {
-                grPaint->colorSampler(kColorFilterTextureIdx)->setCustomStage(stage);
+                grPaint->colorSampler(kColorFilterTextureIdx)->setEffect(stage);
             } else {
                 // TODO: rewrite this using asNewCustomStage()
                 SkColor color;
@@ -607,7 +607,7 @@
         GrScalar sy = SkFloatToScalar(1.f / bitmap.height());
         matrix.postScale(sx, sy);
     }
-    sampler->setCustomStage(SkNEW_ARGS(GrSingleTextureEffect, (texture, params)), matrix)->unref();
+    sampler->setEffect(SkNEW_ARGS(GrSingleTextureEffect, (texture, params)), matrix)->unref();
 
     return true;
 }
@@ -874,7 +874,7 @@
             matrix.setIDiv(pathTexture->width(), pathTexture->height());
             // Blend pathTexture over blurTexture.
             context->setRenderTarget(blurTexture->asRenderTarget());
-            paint.colorSampler(0)->setCustomStage(SkNEW_ARGS(GrSingleTextureEffect, (pathTexture)), matrix)->unref();
+            paint.colorSampler(0)->setEffect(SkNEW_ARGS(GrSingleTextureEffect, (pathTexture)), matrix)->unref();
             if (SkMaskFilter::kInner_BlurType == blurType) {
                 // inner:  dst = dst * src
                 paint.setBlendFunc(kDC_GrBlendCoeff, kZero_GrBlendCoeff);
@@ -905,7 +905,7 @@
     matrix.postIDiv(blurTexture->width(), blurTexture->height());
 
     grp->coverageSampler(MASK_IDX)->reset();
-    grp->coverageSampler(MASK_IDX)->setCustomStage(SkNEW_ARGS(GrSingleTextureEffect, (blurTexture)), matrix)->unref();
+    grp->coverageSampler(MASK_IDX)->setEffect(SkNEW_ARGS(GrSingleTextureEffect, (blurTexture)), matrix)->unref();
     context->drawRect(*grp, finalRect);
     return true;
 }
@@ -961,7 +961,7 @@
     m.setTranslate(-dstM.fBounds.fLeft*SK_Scalar1, -dstM.fBounds.fTop*SK_Scalar1);
     m.postIDiv(texture->width(), texture->height());
 
-    grp->coverageSampler(MASK_IDX)->setCustomStage(SkNEW_ARGS(GrSingleTextureEffect, (texture)), m)->unref();
+    grp->coverageSampler(MASK_IDX)->setEffect(SkNEW_ARGS(GrSingleTextureEffect, (texture)), m)->unref();
     GrRect d;
     d.setLTRB(GrIntToScalar(dstM.fBounds.fLeft),
               GrIntToScalar(dstM.fBounds.fTop),
@@ -1438,7 +1438,7 @@
     } else {
         stage.reset(SkNEW_ARGS(GrSingleTextureEffect, (texture, params)));
     }
-    grPaint->colorSampler(kBitmapTextureIdx)->setCustomStage(stage);
+    grPaint->colorSampler(kBitmapTextureIdx)->setEffect(stage);
     fContext->drawRectToRect(*grPaint, dstRect, paintRect, &m);
 }
 
@@ -1458,7 +1458,7 @@
     GrMatrix sampleM;
     sampleM.setIDiv(srcTexture->width(), srcTexture->height());
     GrPaint paint;
-    paint.colorSampler(0)->setCustomStage(stage, sampleM);
+    paint.colorSampler(0)->setEffect(stage, sampleM);
     context->drawRect(paint, rect);
 }
 
@@ -1516,7 +1516,7 @@
     sampler->reset();
     // draw sprite uses the default texture params
     SkAutoCachedTexture act(this, bitmap, NULL, &texture);
-    grPaint.colorSampler(kBitmapTextureIdx)->setCustomStage(SkNEW_ARGS
+    grPaint.colorSampler(kBitmapTextureIdx)->setEffect(SkNEW_ARGS
         (GrSingleTextureEffect, (texture)))->unref();
 
     SkImageFilter* filter = paint.getImageFilter();
@@ -1524,7 +1524,7 @@
         GrTexture* filteredTexture = filter_texture(this, fContext, texture, filter,
                  GrRect::MakeWH(SkIntToScalar(w), SkIntToScalar(h)));
         if (filteredTexture) {
-            grPaint.colorSampler(kBitmapTextureIdx)->setCustomStage(SkNEW_ARGS
+            grPaint.colorSampler(kBitmapTextureIdx)->setEffect(SkNEW_ARGS
                 (GrSingleTextureEffect, (filteredTexture)))->unref();
             texture = filteredTexture;
             filteredTexture->unref();
@@ -1590,7 +1590,7 @@
         return;
     }
 
-    GrTexture* devTex = grPaint.getColorSampler(kBitmapTextureIdx).getCustomStage()->texture(0);
+    GrTexture* devTex = grPaint.getColorSampler(kBitmapTextureIdx).getEffect()->texture(0);
     SkASSERT(NULL != devTex);
 
     SkImageFilter* filter = paint.getImageFilter();
@@ -1599,7 +1599,7 @@
                                      SkIntToScalar(devTex->height()));
         GrTexture* filteredTexture = filter_texture(this, fContext, devTex, filter, rect);
         if (filteredTexture) {
-            grPaint.colorSampler(kBitmapTextureIdx)->setCustomStage(SkNEW_ARGS
+            grPaint.colorSampler(kBitmapTextureIdx)->setEffect(SkNEW_ARGS
                 (GrSingleTextureEffect, (filteredTexture)))->unref();
             devTex = filteredTexture;
             filteredTexture->unref();
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index 9689c0f..1502905 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -109,7 +109,7 @@
         swapRB = random->nextBool();
     }
     return SkNEW_ARGS(GrConfigConversionEffect,
-            (textures[GrCustomStageUnitTest::kSkiaPMTextureIdx], swapRB, pmConv));
+            (textures[GrEffectUnitTest::kSkiaPMTextureIdx], swapRB, pmConv));
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -185,16 +185,16 @@
                                                         (tempTex, false, *pmToUPMRule)));
 
         context->setRenderTarget(readTex->asRenderTarget());
-        paint.colorSampler(0)->setCustomStage(pmToUPMStage1);
+        paint.colorSampler(0)->setEffect(pmToUPMStage1);
         context->drawRectToRect(paint, kDstRect, kSrcRect);
 
         readTex->readPixels(0, 0, 256, 256, kRGBA_8888_GrPixelConfig, firstRead);
 
         context->setRenderTarget(tempTex->asRenderTarget());
-        paint.colorSampler(0)->setCustomStage(upmToPMStage);
+        paint.colorSampler(0)->setEffect(upmToPMStage);
         context->drawRectToRect(paint, kDstRect, kSrcRect);
         context->setRenderTarget(readTex->asRenderTarget());
-        paint.colorSampler(0)->setCustomStage(pmToUPMStage2);
+        paint.colorSampler(0)->setEffect(pmToUPMStage2);
         context->drawRectToRect(paint, kDstRect, kSrcRect);
 
         readTex->readPixels(0, 0, 256, 256, kRGBA_8888_GrPixelConfig, secondRead);
diff --git a/src/gpu/effects/GrConvolutionEffect.cpp b/src/gpu/effects/GrConvolutionEffect.cpp
index 930a0e3..392475f 100644
--- a/src/gpu/effects/GrConvolutionEffect.cpp
+++ b/src/gpu/effects/GrConvolutionEffect.cpp
@@ -177,8 +177,8 @@
 GrEffect* GrConvolutionEffect::TestCreate(SkRandom* random,
                                           GrContext* context,
                                           GrTexture* textures[]) {
-    int texIdx = random->nextBool() ? GrCustomStageUnitTest::kSkiaPMTextureIdx :
-                                      GrCustomStageUnitTest::kAlphaTextureIdx;
+    int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx :
+                                      GrEffectUnitTest::kAlphaTextureIdx;
     Direction dir = random->nextBool() ? kX_Direction : kY_Direction;
     int radius = random->nextRangeU(1, kMaxKernelRadius);
     float kernel[kMaxKernelRadius];
diff --git a/src/gpu/effects/GrSingleTextureEffect.cpp b/src/gpu/effects/GrSingleTextureEffect.cpp
index 52a7448..2f8801c 100644
--- a/src/gpu/effects/GrSingleTextureEffect.cpp
+++ b/src/gpu/effects/GrSingleTextureEffect.cpp
@@ -71,7 +71,7 @@
 GrEffect* GrSingleTextureEffect::TestCreate(SkRandom* random,
                                             GrContext* context,
                                             GrTexture* textures[]) {
-    int texIdx = random->nextBool() ? GrCustomStageUnitTest::kSkiaPMTextureIdx :
-                                      GrCustomStageUnitTest::kAlphaTextureIdx;
+    int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx :
+                                      GrEffectUnitTest::kAlphaTextureIdx;
     return SkNEW_ARGS(GrSingleTextureEffect, (textures[texIdx]));
 }
diff --git a/src/gpu/effects/GrTextureDomainEffect.cpp b/src/gpu/effects/GrTextureDomainEffect.cpp
index 289b621..1319814 100644
--- a/src/gpu/effects/GrTextureDomainEffect.cpp
+++ b/src/gpu/effects/GrTextureDomainEffect.cpp
@@ -117,8 +117,8 @@
 GrEffect* GrTextureDomainEffect::TestCreate(SkRandom* random,
                                             GrContext* context,
                                             GrTexture* textures[]) {
-    int texIdx = random->nextBool() ? GrCustomStageUnitTest::kSkiaPMTextureIdx :
-                                      GrCustomStageUnitTest::kAlphaTextureIdx;
+    int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx :
+                                      GrEffectUnitTest::kAlphaTextureIdx;
     GrRect domain;
     domain.fLeft = random->nextUScalar1();
     domain.fRight = random->nextRangeScalar(domain.fLeft, SK_Scalar1);
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index 847b6ef..08e58e8 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -977,8 +977,8 @@
     for (int s = 0; s < GrDrawState::kNumStages; ++s) {
         if (NULL != fProgramStage[s]) {
             const GrSamplerState& sampler = drawState.getSampler(s);
-            GrAssert(NULL != sampler.getCustomStage());
-            fProgramStage[s]->setData(fUniformManager, *sampler.getCustomStage());
+            GrAssert(NULL != sampler.getEffect());
+            fProgramStage[s]->setData(fUniformManager, *sampler.getEffect());
         }
     }
 }
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index a810d67..858e938 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -2019,7 +2019,7 @@
 void GrGpuGL::flushBoundTextureAndParams(int stage) {
     GrDrawState* drawState = this->drawState();
     // FIXME: Assuming at most one texture per custom stage
-    const GrEffect* customStage = drawState->sampler(stage)->getCustomStage();
+    const GrEffect* customStage = drawState->sampler(stage)->getEffect();
     if (customStage->numTextures() > 0) {
         GrGLTexture* nextTexture =  static_cast<GrGLTexture*>(customStage->texture(0));
         if (NULL != nextTexture) {
diff --git a/src/gpu/gl/GrGpuGL_program.cpp b/src/gpu/gl/GrGpuGL_program.cpp
index 6608c66..b0656b2 100644
--- a/src/gpu/gl/GrGpuGL_program.cpp
+++ b/src/gpu/gl/GrGpuGL_program.cpp
@@ -199,7 +199,7 @@
     const GrDrawState& drawState = this->getDrawState();
 
     // FIXME: Still assuming only a single texture per custom stage
-    const GrEffect* stage = drawState.getSampler(s).getCustomStage();
+    const GrEffect* stage = drawState.getSampler(s).getEffect();
     if (0 == stage->numTextures()) {
         return;
     }
@@ -570,7 +570,7 @@
                         const GrGLCaps& caps,
                         const GrEffect** customStages,
                         GrGLProgram* program, int index) {
-    const GrEffect* customStage = sampler.getCustomStage();
+    const GrEffect* customStage = sampler.getEffect();
     if (customStage) {
         const GrProgramStageFactory& factory = customStage->getFactory();
         stage->fCustomStageKey = factory.glStageKey(*customStage, caps);
@@ -675,7 +675,7 @@
             lastEnabledStage = s;
             const GrSamplerState& sampler = drawState.getSampler(s);
             // FIXME: Still assuming one texture per custom stage
-            const GrEffect* customStage = drawState.getSampler(s).getCustomStage();
+            const GrEffect* customStage = drawState.getSampler(s).getEffect();
 
             if (customStage->numTextures() > 0) {
                 const GrGLTexture* texture =