CustomStage Renaming Part 1

Search and replace:
GrCustomStage->GrEffect
GrCustomStageTestFactory->GrEffectTestFactory

renamed the cpp/h files from customStage->effect

reordered gypi, #includes, forward decls to maintain alphabetical sort.

manually fixed up some whitespace and linewraps

deleted a commented out #include

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

git-svn-id: http://skia.googlecode.com/svn/trunk@6076 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index e729e6d..93b8b31 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -1317,7 +1317,7 @@
         ast.set(this, desc, match);
         GrTexture* texture = ast.texture();
         if (texture) {
-            SkAutoTUnref<GrCustomStage> stage;
+            SkAutoTUnref<GrEffect> stage;
             if (unpremul) {
                 stage.reset(this->createPMToUPMEffect(src, swapRAndB));
             }
@@ -1490,7 +1490,7 @@
         return;
     }
 #endif
-    SkAutoTUnref<GrCustomStage> stage;
+    SkAutoTUnref<GrEffect> stage;
     bool swapRAndB = (fGpu->preferredReadPixelsConfig(config) == GrPixelConfigSwapRAndB(config));
 
     GrPixelConfig textureConfig;
@@ -1736,7 +1736,7 @@
 }
 }
 
-GrCustomStage* GrContext::createPMToUPMEffect(GrTexture* texture, bool swapRAndB) {
+GrEffect* GrContext::createPMToUPMEffect(GrTexture* texture, bool swapRAndB) {
     if (!fDidTestPMConversions) {
         test_pm_conversions(this, &fPMToUPMConversion, &fUPMToPMConversion);
         fDidTestPMConversions = true;
@@ -1750,7 +1750,7 @@
     }
 }
 
-GrCustomStage* GrContext::createUPMToPMEffect(GrTexture* texture, bool swapRAndB) {
+GrEffect* GrContext::createUPMToPMEffect(GrTexture* texture, bool swapRAndB) {
     if (!fDidTestPMConversions) {
         test_pm_conversions(this, &fPMToUPMConversion, &fUPMToPMConversion);
         fDidTestPMConversions = true;
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h
index e3121ea..6951d46 100644
--- a/src/gpu/GrDrawState.h
+++ b/src/gpu/GrDrawState.h
@@ -196,14 +196,14 @@
     }
     void createTextureEffect(int stage, GrTexture* texture, const GrMatrix& matrix) {
         GrAssert(!this->getSampler(stage).getCustomStage());
-        GrCustomStage* customStage = SkNEW_ARGS(GrSingleTextureEffect, (texture));
+        GrEffect* customStage = SkNEW_ARGS(GrSingleTextureEffect, (texture));
         this->sampler(stage)->setCustomStage(customStage, matrix)->unref();
     }
     void createTextureEffect(int stage, GrTexture* texture,
                              const GrMatrix& matrix,
                              const GrTextureParams& params) {
         GrAssert(!this->getSampler(stage).getCustomStage());
-        GrCustomStage* customStage = SkNEW_ARGS(GrSingleTextureEffect, (texture, params));
+        GrEffect* customStage = SkNEW_ARGS(GrSingleTextureEffect, (texture, params));
         this->sampler(stage)->setCustomStage(customStage, matrix)->unref();
     }
 
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 3b27172..56dc8d8 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 GrCustomStage* stage = drawState.getSampler(s).getCustomStage();
+            const GrEffect* stage = drawState.getSampler(s).getCustomStage();
             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 GrCustomStage* stage = drawState.getSampler(s).getCustomStage();
+            const GrEffect* stage = drawState.getSampler(s).getCustomStage();
             // 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/GrCustomStage.cpp b/src/gpu/GrEffect.cpp
similarity index 69%
rename from src/gpu/GrCustomStage.cpp
rename to src/gpu/GrEffect.cpp
index 0000278..7997fb0 100644
--- a/src/gpu/GrCustomStage.cpp
+++ b/src/gpu/GrEffect.cpp
@@ -6,15 +6,15 @@
  */
 
 #include "GrContext.h"
-#include "GrCustomStage.h"
+#include "GrEffect.h"
 #include "GrMemoryPool.h"
 #include "SkTLS.h"
 
-SK_DEFINE_INST_COUNT(GrCustomStage)
+SK_DEFINE_INST_COUNT(GrEffect)
 
 #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
-SkTArray<GrCustomStageTestFactory*, true>* GrCustomStageTestFactory::GetFactories() {
-    static SkTArray<GrCustomStageTestFactory*, true> gFactories;
+SkTArray<GrEffectTestFactory*, true>* GrEffectTestFactory::GetFactories() {
+    static SkTArray<GrEffectTestFactory*, true> gFactories;
     return &gFactories;
 }
 #endif
@@ -38,19 +38,19 @@
 int32_t GrProgramStageFactory::fCurrStageClassID =
                                     GrProgramStageFactory::kIllegalStageClassID;
 
-GrCustomStage::GrCustomStage(int numTextures)
+GrEffect::GrEffect(int numTextures)
     : fNumTextures(numTextures) {
 }
 
-GrCustomStage::~GrCustomStage() {
+GrEffect::~GrEffect() {
 
 }
 
-bool GrCustomStage::isOpaque(bool inputTextureIsOpaque) const {
+bool GrEffect::isOpaque(bool inputTextureIsOpaque) const {
     return false;
 }
 
-bool GrCustomStage::isEqual(const GrCustomStage& s) const {
+bool GrEffect::isEqual(const GrEffect& s) const {
     if (this->numTextures() != s.numTextures()) {
         return false;
     }
@@ -62,16 +62,16 @@
     return true;
 }
 
-const GrTextureAccess& GrCustomStage::textureAccess(int index) const {
+const GrTextureAccess& GrEffect::textureAccess(int index) const {
     GrCrash("We shouldn't be calling this function on the base class.");
     static GrTextureAccess kDummy;
     return kDummy;
 }
 
-void * GrCustomStage::operator new(size_t size) {
+void * GrEffect::operator new(size_t size) {
     return GrCustomStage_Globals::GetTLS()->allocate(size);
 }
 
-void GrCustomStage::operator delete(void* target) {
+void GrEffect::operator delete(void* target) {
     GrCustomStage_Globals::GetTLS()->release(target);
 }
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index fc1f86c..74a2888 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -512,7 +512,7 @@
             SkColor filtered = colorFilter->filterColor(skPaint.getColor());
             grPaint->setColor(SkColor2GrColor(filtered));
         } else {
-            SkAutoTUnref<GrCustomStage> stage(colorFilter->asNewCustomStage(dev->context()));
+            SkAutoTUnref<GrEffect> stage(colorFilter->asNewCustomStage(dev->context()));
             if (NULL != stage.get()) {
                 grPaint->colorSampler(kColorFilterTextureIdx)->setCustomStage(stage);
             } else {
@@ -1415,7 +1415,7 @@
     }
 
     GrRect textureDomain = GrRect::MakeEmpty();
-    SkAutoTUnref<GrCustomStage> stage;
+    SkAutoTUnref<GrEffect> stage;
     if (needsTextureDomain) {
         // Use a constrained texture domain to avoid color bleeding
         GrScalar left, top, right, bottom;
@@ -1448,7 +1448,7 @@
                         GrTexture* srcTexture,
                         GrTexture* dstTexture,
                         const GrRect& rect,
-                        GrCustomStage* stage) {
+                        GrEffect* stage) {
     SkASSERT(srcTexture && srcTexture->getContext() == context);
     GrContext::AutoMatrix am;
     am.setIdentity(context);
@@ -1475,7 +1475,7 @@
     desc.fWidth = SkScalarCeilToInt(rect.width());
     desc.fHeight = SkScalarCeilToInt(rect.height());
     desc.fConfig = kRGBA_8888_GrPixelConfig;
-    GrCustomStage* stage;
+    GrEffect* stage;
 
     if (filter->canFilterImageGPU()) {
         // Save the render target and set it to NULL, so we don't accidentally draw to it in the
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index 9d64350..9689c0f 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -11,7 +11,7 @@
 class GrGLConfigConversionEffect : public GrGLLegacyProgramStage {
 public:
     GrGLConfigConversionEffect(const GrProgramStageFactory& factory,
-                               const GrCustomStage& s) : INHERITED (factory) {
+                               const GrEffect& s) : INHERITED (factory) {
         const GrConfigConversionEffect& stage = static_cast<const GrConfigConversionEffect&>(s);
         fSwapRedAndBlue = stage.swapsRedAndBlue();
         fPMConversion = stage.pmConversion();
@@ -58,7 +58,7 @@
         GrGLSLMulVarBy4f(&builder->fFSCode, 2, outputColor, inputColor);
     }
 
-    static inline StageKey GenKey(const GrCustomStage& s, const GrGLCaps&) {
+    static inline StageKey GenKey(const GrEffect& s, const GrGLCaps&) {
         const GrConfigConversionEffect& stage = static_cast<const GrConfigConversionEffect&>(s);
         return static_cast<int>(stage.swapsRedAndBlue()) | (stage.pmConversion() << 1);
     }
@@ -89,7 +89,7 @@
     return GrTProgramStageFactory<GrConfigConversionEffect>::getInstance();
 }
 
-bool GrConfigConversionEffect::isEqual(const GrCustomStage& s) const {
+bool GrConfigConversionEffect::isEqual(const GrEffect& s) const {
     const GrConfigConversionEffect& other = static_cast<const GrConfigConversionEffect&>(s);
     return other.fSwapRedAndBlue == fSwapRedAndBlue && other.fPMConversion == fPMConversion;
 }
@@ -98,9 +98,9 @@
 
 GR_DEFINE_CUSTOM_STAGE_TEST(GrConfigConversionEffect);
 
-GrCustomStage* GrConfigConversionEffect::TestCreate(SkRandom* random,
-                                                    GrContext* context,
-                                                    GrTexture* textures[]) {
+GrEffect* GrConfigConversionEffect::TestCreate(SkRandom* random,
+                                               GrContext* context,
+                                               GrTexture* textures[]) {
     PMConversion pmConv = static_cast<PMConversion>(random->nextULessThan(kPMConversionCnt));
     bool swapRB;
     if (kNone_PMConversion == pmConv) {
@@ -177,12 +177,12 @@
 
         GrPaint paint;
 
-        SkAutoTUnref<GrCustomStage> pmToUPMStage1(SkNEW_ARGS(GrConfigConversionEffect,
-                                                             (dataTex, false, *pmToUPMRule)));
-        SkAutoTUnref<GrCustomStage> upmToPMStage(SkNEW_ARGS(GrConfigConversionEffect,
-                                                            (readTex, false, *upmToPMRule)));
-        SkAutoTUnref<GrCustomStage> pmToUPMStage2(SkNEW_ARGS(GrConfigConversionEffect,
-                                                             (tempTex, false, *pmToUPMRule)));
+        SkAutoTUnref<GrEffect> pmToUPMStage1(SkNEW_ARGS(GrConfigConversionEffect,
+                                                        (dataTex, false, *pmToUPMRule)));
+        SkAutoTUnref<GrEffect> upmToPMStage(SkNEW_ARGS(GrConfigConversionEffect,
+                                                       (readTex, false, *upmToPMRule)));
+        SkAutoTUnref<GrEffect> pmToUPMStage2(SkNEW_ARGS(GrConfigConversionEffect,
+                                                        (tempTex, false, *pmToUPMRule)));
 
         context->setRenderTarget(readTex->asRenderTarget());
         paint.colorSampler(0)->setCustomStage(pmToUPMStage1);
@@ -215,7 +215,7 @@
     }
 }
 
-GrCustomStage* GrConfigConversionEffect::Create(GrTexture* texture,
+GrEffect* GrConfigConversionEffect::Create(GrTexture* texture,
                                                 bool swapRedAndBlue,
                                                 PMConversion pmConversion) {
     if (!swapRedAndBlue && kNone_PMConversion == pmConversion) {
diff --git a/src/gpu/effects/GrConfigConversionEffect.h b/src/gpu/effects/GrConfigConversionEffect.h
index 9bb7e3a..fb2c770 100644
--- a/src/gpu/effects/GrConfigConversionEffect.h
+++ b/src/gpu/effects/GrConfigConversionEffect.h
@@ -34,7 +34,7 @@
     };
 
     // This will fail if the config is not 8888 and a PM conversion is requested.
-    static GrCustomStage* Create(GrTexture*,
+    static GrEffect* Create(GrTexture*,
                                  bool swapRedAndBlue,
                                  PMConversion pmConversion = kNone_PMConversion);
 
@@ -42,7 +42,7 @@
     typedef GrGLConfigConversionEffect GLProgramStage;
 
     virtual const GrProgramStageFactory& getFactory() const SK_OVERRIDE;
-    virtual bool isEqual(const GrCustomStage&) const SK_OVERRIDE;
+    virtual bool isEqual(const GrEffect&) const SK_OVERRIDE;
 
     bool swapsRedAndBlue() const { return fSwapRedAndBlue; }
     PMConversion  pmConversion() const { return fPMConversion; }
diff --git a/src/gpu/effects/GrConvolutionEffect.cpp b/src/gpu/effects/GrConvolutionEffect.cpp
index 726c2c3..930a0e3 100644
--- a/src/gpu/effects/GrConvolutionEffect.cpp
+++ b/src/gpu/effects/GrConvolutionEffect.cpp
@@ -18,7 +18,7 @@
 class GrGLConvolutionEffect : public GrGLLegacyProgramStage {
 public:
     GrGLConvolutionEffect(const GrProgramStageFactory& factory,
-                          const GrCustomStage& stage);
+                          const GrEffect& stage);
 
     virtual void setupVariables(GrGLShaderBuilder* builder) SK_OVERRIDE;
     virtual void emitVS(GrGLShaderBuilder* builder,
@@ -28,9 +28,9 @@
                         const char* inputColor,
                         const TextureSamplerArray&) SK_OVERRIDE;
 
-    virtual void setData(const GrGLUniformManager& uman, const GrCustomStage&) SK_OVERRIDE;
+    virtual void setData(const GrGLUniformManager& uman, const GrEffect&) SK_OVERRIDE;
 
-    static inline StageKey GenKey(const GrCustomStage&, const GrGLCaps&);
+    static inline StageKey GenKey(const GrEffect&, const GrGLCaps&);
 
 private:
     int width() const { return Gr1DKernelEffect::WidthFromRadius(fRadius); }
@@ -43,7 +43,7 @@
 };
 
 GrGLConvolutionEffect::GrGLConvolutionEffect(const GrProgramStageFactory& factory,
-                                             const GrCustomStage& stage)
+                                             const GrEffect& stage)
     : INHERITED(factory)
     , fKernelUni(kInvalidUniformHandle)
     , fImageIncrementUni(kInvalidUniformHandle) {
@@ -88,7 +88,7 @@
     GrGLSLMulVarBy4f(&builder->fFSCode, 2, outputColor, inputColor);
 }
 
-void GrGLConvolutionEffect::setData(const GrGLUniformManager& uman, const GrCustomStage& data) {
+void GrGLConvolutionEffect::setData(const GrGLUniformManager& uman, const GrEffect& data) {
     const GrConvolutionEffect& conv =
         static_cast<const GrConvolutionEffect&>(data);
     GrTexture& texture = *data.texture(0);
@@ -109,7 +109,7 @@
     uman.set1fv(fKernelUni, 0, this->width(), conv.kernel());
 }
 
-GrGLProgramStage::StageKey GrGLConvolutionEffect::GenKey(const GrCustomStage& s,
+GrGLProgramStage::StageKey GrGLConvolutionEffect::GenKey(const GrEffect& s,
                                                          const GrGLCaps& caps) {
     return static_cast<const GrConvolutionEffect&>(s).radius();
 }
@@ -161,7 +161,7 @@
     return GrTProgramStageFactory<GrConvolutionEffect>::getInstance();
 }
 
-bool GrConvolutionEffect::isEqual(const GrCustomStage& sBase) const {
+bool GrConvolutionEffect::isEqual(const GrEffect& sBase) const {
      const GrConvolutionEffect& s =
         static_cast<const GrConvolutionEffect&>(sBase);
     return (INHERITED::isEqual(sBase) &&
@@ -174,9 +174,9 @@
 
 GR_DEFINE_CUSTOM_STAGE_TEST(GrConvolutionEffect);
 
-GrCustomStage* GrConvolutionEffect::TestCreate(SkRandom* random,
-                                              GrContext* context,
-                                              GrTexture* textures[]) {
+GrEffect* GrConvolutionEffect::TestCreate(SkRandom* random,
+                                          GrContext* context,
+                                          GrTexture* textures[]) {
     int texIdx = random->nextBool() ? GrCustomStageUnitTest::kSkiaPMTextureIdx :
                                       GrCustomStageUnitTest::kAlphaTextureIdx;
     Direction dir = random->nextBool() ? kX_Direction : kY_Direction;
diff --git a/src/gpu/effects/GrConvolutionEffect.h b/src/gpu/effects/GrConvolutionEffect.h
index 4c42a6c..5063994 100644
--- a/src/gpu/effects/GrConvolutionEffect.h
+++ b/src/gpu/effects/GrConvolutionEffect.h
@@ -37,7 +37,7 @@
     typedef GrGLConvolutionEffect GLProgramStage;
 
     virtual const GrProgramStageFactory& getFactory() const SK_OVERRIDE;
-    virtual bool isEqual(const GrCustomStage&) const SK_OVERRIDE;
+    virtual bool isEqual(const GrEffect&) const SK_OVERRIDE;
 
     enum {
         // This was decided based on the min allowed value for the max texture
diff --git a/src/gpu/effects/GrSingleTextureEffect.cpp b/src/gpu/effects/GrSingleTextureEffect.cpp
index 51d3025..52a7448 100644
--- a/src/gpu/effects/GrSingleTextureEffect.cpp
+++ b/src/gpu/effects/GrSingleTextureEffect.cpp
@@ -15,7 +15,7 @@
 class GrGLSingleTextureEffect : public GrGLLegacyProgramStage {
 public:
     GrGLSingleTextureEffect(const GrProgramStageFactory& factory,
-                            const GrCustomStage& stage) : INHERITED (factory) { }
+                            const GrEffect& stage) : INHERITED (factory) { }
 
     virtual void emitVS(GrGLShaderBuilder* builder,
                         const char* vertexCoords) SK_OVERRIDE { }
@@ -28,7 +28,7 @@
         builder->fFSCode.append(";\n");
     }
 
-    static inline StageKey GenKey(const GrCustomStage&, const GrGLCaps&) { return 0; }
+    static inline StageKey GenKey(const GrEffect&, const GrGLCaps&) { return 0; }
 
 private:
 
@@ -68,9 +68,9 @@
 
 GR_DEFINE_CUSTOM_STAGE_TEST(GrSingleTextureEffect);
 
-GrCustomStage* GrSingleTextureEffect::TestCreate(SkRandom* random,
-                                                 GrContext* context,
-                                                 GrTexture* textures[]) {
+GrEffect* GrSingleTextureEffect::TestCreate(SkRandom* random,
+                                            GrContext* context,
+                                            GrTexture* textures[]) {
     int texIdx = random->nextBool() ? GrCustomStageUnitTest::kSkiaPMTextureIdx :
                                       GrCustomStageUnitTest::kAlphaTextureIdx;
     return SkNEW_ARGS(GrSingleTextureEffect, (textures[texIdx]));
diff --git a/src/gpu/effects/GrSingleTextureEffect.h b/src/gpu/effects/GrSingleTextureEffect.h
index ad47eb7..92ab92a 100644
--- a/src/gpu/effects/GrSingleTextureEffect.h
+++ b/src/gpu/effects/GrSingleTextureEffect.h
@@ -8,14 +8,14 @@
 #ifndef GrSingleTextureEffect_DEFINED
 #define GrSingleTextureEffect_DEFINED
 
-#include "GrCustomStage.h"
+#include "GrEffect.h"
 
 class GrGLSingleTextureEffect;
 
 /**
  * An effect that merely blits a single texture; commonly used as a base class.
  */
-class GrSingleTextureEffect : public GrCustomStage {
+class GrSingleTextureEffect : public GrEffect {
 
 public:
     /** Uses default texture params (unfiltered, clamp) */
@@ -41,7 +41,7 @@
 
     GrTextureAccess fTextureAccess;
 
-    typedef GrCustomStage INHERITED;
+    typedef GrEffect INHERITED;
 };
 
 #endif
diff --git a/src/gpu/effects/GrTextureDomainEffect.cpp b/src/gpu/effects/GrTextureDomainEffect.cpp
index f406041..289b621 100644
--- a/src/gpu/effects/GrTextureDomainEffect.cpp
+++ b/src/gpu/effects/GrTextureDomainEffect.cpp
@@ -12,7 +12,7 @@
 class GrGLTextureDomainEffect : public GrGLLegacyProgramStage {
 public:
     GrGLTextureDomainEffect(const GrProgramStageFactory& factory,
-                            const GrCustomStage& stage);
+                            const GrEffect& stage);
 
     virtual void setupVariables(GrGLShaderBuilder* builder) SK_OVERRIDE;
     virtual void emitVS(GrGLShaderBuilder* builder,
@@ -22,9 +22,9 @@
                         const char* inputColor,
                         const TextureSamplerArray&) SK_OVERRIDE;
 
-    virtual void setData(const GrGLUniformManager&, const GrCustomStage&) SK_OVERRIDE;
+    virtual void setData(const GrGLUniformManager&, const GrEffect&) SK_OVERRIDE;
 
-    static inline StageKey GenKey(const GrCustomStage&, const GrGLCaps&) { return 0; }
+    static inline StageKey GenKey(const GrEffect&, const GrGLCaps&) { return 0; }
 
 private:
     GrGLUniformManager::UniformHandle fNameUni;
@@ -33,7 +33,7 @@
 };
 
 GrGLTextureDomainEffect::GrGLTextureDomainEffect(const GrProgramStageFactory& factory,
-                                                 const GrCustomStage& stage)
+                                                 const GrEffect& stage)
     : INHERITED(factory)
     , fNameUni(GrGLUniformManager::kInvalidUniformHandle) {
 }
@@ -60,7 +60,7 @@
     builder->fFSCode.append(";\n");
 }
 
-void GrGLTextureDomainEffect::setData(const GrGLUniformManager& uman, const GrCustomStage& data) {
+void GrGLTextureDomainEffect::setData(const GrGLUniformManager& uman, const GrEffect& data) {
     const GrTextureDomainEffect& effect = static_cast<const GrTextureDomainEffect&>(data);
     const GrRect& domain = effect.domain();
 
@@ -105,7 +105,7 @@
     return GrTProgramStageFactory<GrTextureDomainEffect>::getInstance();
 }
 
-bool GrTextureDomainEffect::isEqual(const GrCustomStage& sBase) const {
+bool GrTextureDomainEffect::isEqual(const GrEffect& sBase) const {
     const GrTextureDomainEffect& s = static_cast<const GrTextureDomainEffect&>(sBase);
     return (INHERITED::isEqual(sBase) && this->fTextureDomain == s.fTextureDomain);
 }
@@ -114,9 +114,9 @@
 
 GR_DEFINE_CUSTOM_STAGE_TEST(GrTextureDomainEffect);
 
-GrCustomStage* GrTextureDomainEffect::TestCreate(SkRandom* random,
-                                                 GrContext* context,
-                                                 GrTexture* textures[]) {
+GrEffect* GrTextureDomainEffect::TestCreate(SkRandom* random,
+                                            GrContext* context,
+                                            GrTexture* textures[]) {
     int texIdx = random->nextBool() ? GrCustomStageUnitTest::kSkiaPMTextureIdx :
                                       GrCustomStageUnitTest::kAlphaTextureIdx;
     GrRect domain;
diff --git a/src/gpu/effects/GrTextureDomainEffect.h b/src/gpu/effects/GrTextureDomainEffect.h
index 872d57d..64a6466 100644
--- a/src/gpu/effects/GrTextureDomainEffect.h
+++ b/src/gpu/effects/GrTextureDomainEffect.h
@@ -8,7 +8,6 @@
 #ifndef GrTextureDomainEffect_DEFINED
 #define GrTextureDomainEffect_DEFINED
 
-//#include "GrCustomStage.h"
 #include "GrSingleTextureEffect.h"
 #include "GrRect.h"
 
@@ -32,7 +31,7 @@
     typedef GrGLTextureDomainEffect GLProgramStage;
 
     virtual const GrProgramStageFactory& getFactory() const SK_OVERRIDE;
-    virtual bool isEqual(const GrCustomStage&) const SK_OVERRIDE;
+    virtual bool isEqual(const GrEffect&) const SK_OVERRIDE;
 
     const GrRect& domain() const { return fTextureDomain; }
 
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index d5ccdac..847b6ef 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -8,7 +8,7 @@
 #include "GrGLProgram.h"
 
 #include "GrAllocator.h"
-#include "GrCustomStage.h"
+#include "GrEffect.h"
 #include "GrGLProgramStage.h"
 #include "gl/GrGLShaderBuilder.h"
 #include "GrGLShaderVar.h"
@@ -53,7 +53,7 @@
 
 GrGLProgram* GrGLProgram::Create(const GrGLContextInfo& gl,
                                  const Desc& desc,
-                                 const GrCustomStage** customStages) {
+                                 const GrEffect** customStages) {
     GrGLProgram* program = SkNEW_ARGS(GrGLProgram, (gl, desc, customStages));
     if (!program->succeeded()) {
         delete program;
@@ -64,7 +64,7 @@
 
 GrGLProgram::GrGLProgram(const GrGLContextInfo& gl,
                          const Desc& desc,
-                         const GrCustomStage** customStages)
+                         const GrEffect** customStages)
 : fContextInfo(gl)
 , fUniformManager(gl) {
     fDesc = desc;
@@ -500,7 +500,7 @@
     return true;
 }
 
-bool GrGLProgram::genProgram(const GrCustomStage** customStages) {
+bool GrGLProgram::genProgram(const GrEffect** customStages) {
     GrAssert(0 == fProgramID);
 
     GrGLShaderBuilder builder(fContextInfo, fUniformManager);
@@ -896,7 +896,7 @@
 // Stage code generation
 
 // TODO: Move this function to GrGLShaderBuilder
-GrGLProgramStage* GrGLProgram::GenStageCode(const GrCustomStage* stage,
+GrGLProgramStage* GrGLProgram::GenStageCode(const GrEffect* stage,
                                             const StageDesc& desc,
                                             StageUniforms* uniforms,
                                             const char* fsInColor, // NULL means no incoming color
diff --git a/src/gpu/gl/GrGLProgram.h b/src/gpu/gl/GrGLProgram.h
index 2500417..c9afc2b 100644
--- a/src/gpu/gl/GrGLProgram.h
+++ b/src/gpu/gl/GrGLProgram.h
@@ -43,7 +43,7 @@
 
     static GrGLProgram* Create(const GrGLContextInfo& gl,
                                const Desc& desc,
-                               const GrCustomStage** customStages);
+                               const GrEffect** customStages);
 
     virtual ~GrGLProgram();
 
@@ -67,8 +67,8 @@
     static int TexCoordAttributeIdx(int tcIdx) { return 4 + tcIdx; }
 
     /**
-     * This function uploads uniforms and calls each GrCustomStage's setData. It is called before a
-     * draw occurs using the program after the program has already been bound.
+     * This function uploads uniforms and calls each GrEffect's setData. It is called before a draw
+     * occurs using the program after the program has already been bound.
      */
     void setData(const GrDrawState& drawState);
 
@@ -164,18 +164,18 @@
 
     GrGLProgram(const GrGLContextInfo& gl,
                 const Desc& desc,
-                const GrCustomStage** customStages);
+                const GrEffect** customStages);
 
     bool succeeded() const { return 0 != fProgramID; }
 
     /**
      *  This is the heavy initialization routine for building a GLProgram.
      */
-    bool genProgram(const GrCustomStage** customStages);
+    bool genProgram(const GrEffect** customStages);
 
     void genInputColor(GrGLShaderBuilder* builder, SkString* inColor);
 
-    static GrGLProgramStage* GenStageCode(const GrCustomStage* stage,
+    static GrGLProgramStage* GenStageCode(const GrEffect* stage,
                                           const StageDesc& desc, // TODO: Eliminate this
                                           StageUniforms* stageUniforms, // TODO: Eliminate this
                                           const char* fsInColor, // NULL means no incoming color
diff --git a/src/gpu/gl/GrGLProgramStage.cpp b/src/gpu/gl/GrGLProgramStage.cpp
index 4702f37..8cbb7c3 100644
--- a/src/gpu/gl/GrGLProgramStage.cpp
+++ b/src/gpu/gl/GrGLProgramStage.cpp
@@ -17,10 +17,10 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-void GrGLProgramStage::setData(const GrGLUniformManager&, const GrCustomStage&) {
+void GrGLProgramStage::setData(const GrGLUniformManager&, const GrEffect&) {
 }
 
-GrGLProgramStage::StageKey GrGLProgramStage::GenTextureKey(const GrCustomStage& stage,
+GrGLProgramStage::StageKey GrGLProgramStage::GenTextureKey(const GrEffect& stage,
                                                            const GrGLCaps& caps) {
     StageKey key = 0;
     for (int index = 0; index < stage.numTextures(); ++index) {
diff --git a/src/gpu/gl/GrGLProgramStage.h b/src/gpu/gl/GrGLProgramStage.h
index fce82d2..3f8afe4 100644
--- a/src/gpu/gl/GrGLProgramStage.h
+++ b/src/gpu/gl/GrGLProgramStage.h
@@ -9,7 +9,7 @@
 #define GrGLCustomStage_DEFINED
 
 #include "GrAllocator.h"
-#include "GrCustomStage.h"
+#include "GrEffect.h"
 #include "GrGLProgram.h"
 #include "GrGLShaderBuilder.h"
 #include "GrGLShaderVar.h"
@@ -20,20 +20,20 @@
 
 /** @file
     This file contains specializations for OpenGL of the shader stages declared in
-    include/gpu/GrCustomStage.h. Objects of type GrGLProgramStage are responsible for emitting the
-    GLSL code that implements a GrCustomStage and for uploading uniforms at draw time. They also
+    include/gpu/GrEffect.h. Objects of type GrGLProgramStage are responsible for emitting the
+    GLSL code that implements a GrEffect and for uploading uniforms at draw time. They also
     must have a function:
-        static inline StageKey GenKey(const GrCustomStage&, const GrGLCaps&)
-    that is used to implement a program cache. When two GrCustomStages produce the same key this
+        static inline StageKey GenKey(const GrEffect&, const GrGLCaps&)
+    that is used to implement a program cache. When two GrCustomEffects produce the same key this
     means that their GrGLProgramStages would emit the same GLSL code.
 
-    These objects are created by the factory object returned by the GrCustomStage::getFactory().
+    These objects are created by the factory object returned by the GrEffect::getFactory().
 */
 
 class GrGLProgramStage {
 
 public:
-    typedef GrCustomStage::StageKey StageKey;
+    typedef GrEffect::StageKey StageKey;
     enum {
         // the number of bits in StageKey available to GenKey
         kProgramStageKeyBits = GrProgramStageFactory::kProgramStageKeyBits,
@@ -51,8 +51,7 @@
 
         @param builder      Interface used to emit code in the shaders.
         @param stage        The custom stage that generated this program stage.
-        @param key          The key that was computed by StageKey() from the generating
-                            GrCustomStage.
+        @param key          The key that was computed by StageKey() from the generating GrEffect.
         @param vertexCoords A vec2 of texture coordinates in the VS, which may be altered. This will
                             be removed soon and stages will be responsible for computing their own
                             coords.
@@ -64,26 +63,26 @@
                             color is solid white, trans black, known to be opaque, etc.) that allows
                             the custom stage to communicate back similar known info about its
                             output.
-        @param samplers     One entry for each GrTextureAccess of the GrCustomStage that generated
-                            the GrGLProgramStage. These can be passed to the builder to emit texture
+        @param samplers     One entry for each GrTextureAccess of the GrEffect that generated the
+                            GrGLProgramStage. These can be passed to the builder to emit texture
                             reads in the generated code.
         */
     virtual void emitCode(GrGLShaderBuilder* builder,
-                          const GrCustomStage& stage,
+                          const GrEffect& stage,
                           StageKey key,
                           const char* vertexCoords,
                           const char* outputColor,
                           const char* inputColor,
                           const TextureSamplerArray& samplers) = 0;
 
-    /** A GrGLProgramStage instance can be reused with any GrCustomStage that produces the same
-        stage key; this function reads data from a stage and uploads any uniform variables required
+    /** A GrGLProgramStage instance can be reused with any GrEffect that produces the same stage
+        key; this function reads data from a stage and uploads any uniform variables required
         by the shaders created in emitCode(). */
-    virtual void setData(const GrGLUniformManager&, const GrCustomStage& stage);
+    virtual void setData(const GrGLUniformManager&, const GrEffect& stage);
 
     const char* name() const { return fFactory.name(); }
 
-    static StageKey GenTextureKey(const GrCustomStage&, const GrGLCaps&);
+    static StageKey GenTextureKey(const GrEffect&, const GrGLCaps&);
 
 protected:
 
@@ -108,7 +107,7 @@
                         const TextureSamplerArray&) = 0;
 
     virtual void emitCode(GrGLShaderBuilder* builder,
-                          const GrCustomStage&,
+                          const GrEffect&,
                           StageKey,
                           const char* vertexCoords,
                           const char* outputColor,
diff --git a/src/gpu/gl/GrGLShaderBuilder.cpp b/src/gpu/gl/GrGLShaderBuilder.cpp
index 04fe63e..f11a8d9 100644
--- a/src/gpu/gl/GrGLShaderBuilder.cpp
+++ b/src/gpu/gl/GrGLShaderBuilder.cpp
@@ -153,9 +153,9 @@
     GrGLSLModulate4f(out, modulation, lookup.c_str());
 }
 
-GrCustomStage::StageKey GrGLShaderBuilder::KeyForTextureAccess(const GrTextureAccess& access,
+GrEffect::StageKey GrGLShaderBuilder::KeyForTextureAccess(const GrTextureAccess& access,
                                                                const GrGLCaps& caps) {
-    GrCustomStage::StageKey key = 0;
+    GrEffect::StageKey key = 0;
 
     // Assume that swizzle support implies that we never have to modify a shader to adjust
     // for texture format/swizzle settings.
diff --git a/src/gpu/gl/GrGLShaderBuilder.h b/src/gpu/gl/GrGLShaderBuilder.h
index aa88cf2..0b5eb17 100644
--- a/src/gpu/gl/GrGLShaderBuilder.h
+++ b/src/gpu/gl/GrGLShaderBuilder.h
@@ -9,7 +9,7 @@
 #define GrGLShaderBuilder_DEFINED
 
 #include "GrAllocator.h"
-#include "GrCustomStage.h"
+#include "GrEffect.h"
 #include "gl/GrGLShaderVar.h"
 #include "gl/GrGLSL.h"
 #include "gl/GrGLUniformManager.h"
@@ -122,7 +122,7 @@
     /** Generates a StageKey for the shader code based on the texture access parameters and the
         capabilities of the GL context.  This is useful for keying the shader programs that may
         have multiple representations, based on the type/format of textures used. */
-    static GrCustomStage::StageKey KeyForTextureAccess(const GrTextureAccess& access,
+    static GrEffect::StageKey KeyForTextureAccess(const GrTextureAccess& access,
                                                        const GrGLCaps& caps);
 
     /** If texture swizzling is available using tex parameters then it is preferred over mangling
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index 4df7a98..a810d67 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 GrCustomStage* customStage = drawState->sampler(stage)->getCustomStage();
+    const GrEffect* customStage = drawState->sampler(stage)->getCustomStage();
     if (customStage->numTextures() > 0) {
         GrGLTexture* nextTexture =  static_cast<GrGLTexture*>(customStage->texture(0));
         if (NULL != nextTexture) {
diff --git a/src/gpu/gl/GrGpuGL.h b/src/gpu/gl/GrGpuGL.h
index 0a0c52b..eab0a77 100644
--- a/src/gpu/gl/GrGpuGL.h
+++ b/src/gpu/gl/GrGpuGL.h
@@ -166,7 +166,7 @@
         ProgramCache(const GrGLContextInfo& gl);
 
         void abandon();
-        GrGLProgram* getProgram(const GrGLProgram::Desc& desc, const GrCustomStage** stages);
+        GrGLProgram* getProgram(const GrGLProgram::Desc& desc, const GrEffect** stages);
     private:
         enum {
             kKeySize = sizeof(ProgramDesc),
@@ -240,7 +240,7 @@
     void buildProgram(bool isPoints,
                       BlendOptFlags blendOpts,
                       GrBlendCoeff dstCoeff,
-                      const GrCustomStage** customStages,
+                      const GrEffect** customStages,
                       ProgramDesc* desc);
 
     // Inits GrDrawTarget::Caps, subclass may enable additional caps.
diff --git a/src/gpu/gl/GrGpuGL_program.cpp b/src/gpu/gl/GrGpuGL_program.cpp
index 3439230..6608c66 100644
--- a/src/gpu/gl/GrGpuGL_program.cpp
+++ b/src/gpu/gl/GrGpuGL_program.cpp
@@ -7,7 +7,7 @@
 
 #include "GrGpuGL.h"
 
-#include "GrCustomStage.h"
+#include "GrEffect.h"
 #include "GrGLProgramStage.h"
 #include "GrGpuVertex.h"
 
@@ -33,7 +33,7 @@
 }
 
 GrGLProgram* GrGpuGL::ProgramCache::getProgram(const ProgramDesc& desc,
-                                               const GrCustomStage** stages) {
+                                               const GrEffect** stages) {
     Entry newEntry;
     newEntry.fKey.setKeyData(desc.asKey());
 
@@ -199,7 +199,7 @@
     const GrDrawState& drawState = this->getDrawState();
 
     // FIXME: Still assuming only a single texture per custom stage
-    const GrCustomStage* stage = drawState.getSampler(s).getCustomStage();
+    const GrEffect* stage = drawState.getSampler(s).getCustomStage();
     if (0 == stage->numTextures()) {
         return;
     }
@@ -350,7 +350,7 @@
             return false;
         }
 
-        const GrCustomStage* customStages [GrDrawState::kNumStages];
+        const GrEffect* customStages [GrDrawState::kNumStages];
         GrGLProgram::Desc desc;
         this->buildProgram(kDrawPoints_DrawType == type, blendOpts, dstCoeff, customStages, &desc);
 
@@ -568,9 +568,9 @@
 void setup_custom_stage(GrGLProgram::Desc::StageDesc* stage,
                         const GrSamplerState& sampler,
                         const GrGLCaps& caps,
-                        const GrCustomStage** customStages,
+                        const GrEffect** customStages,
                         GrGLProgram* program, int index) {
-    const GrCustomStage* customStage = sampler.getCustomStage();
+    const GrEffect* customStage = sampler.getCustomStage();
     if (customStage) {
         const GrProgramStageFactory& factory = customStage->getFactory();
         stage->fCustomStageKey = factory.glStageKey(*customStage, caps);
@@ -586,7 +586,7 @@
 void GrGpuGL::buildProgram(bool isPoints,
                            BlendOptFlags blendOpts,
                            GrBlendCoeff dstCoeff,
-                           const GrCustomStage** customStages,
+                           const GrEffect** customStages,
                            ProgramDesc* desc) {
     const GrDrawState& drawState = this->getDrawState();
 
@@ -675,7 +675,7 @@
             lastEnabledStage = s;
             const GrSamplerState& sampler = drawState.getSampler(s);
             // FIXME: Still assuming one texture per custom stage
-            const GrCustomStage* customStage = drawState.getSampler(s).getCustomStage();
+            const GrEffect* customStage = drawState.getSampler(s).getCustomStage();
 
             if (customStage->numTextures() > 0) {
                 const GrGLTexture* texture =