GrGLProgramStage Renaming Part 1.

Renamed cpp and h
s/GrGLProgramStage/GrGLEffect/
Review URL: https://codereview.appspot.com/6759054

git-svn-id: http://skia.googlecode.com/svn/trunk@6090 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gyp/gpu.gypi b/gyp/gpu.gypi
index 1e6605b..79cdecd 100644
--- a/gyp/gpu.gypi
+++ b/gyp/gpu.gypi
@@ -144,6 +144,8 @@
       '<(skia_src_path)/gpu/gl/GrGLCreateNativeInterface_none.cpp',
       '<(skia_src_path)/gpu/gl/GrGLDefaultInterface_none.cpp',
       '<(skia_src_path)/gpu/gl/GrGLDefines.h',
+      '<(skia_src_path)/gpu/gl/GrGLEffect.cpp',
+      '<(skia_src_path)/gpu/gl/GrGLEffect.h',
       '<(skia_src_path)/gpu/gl/GrGLIndexBuffer.cpp',
       '<(skia_src_path)/gpu/gl/GrGLIndexBuffer.h',
       '<(skia_src_path)/gpu/gl/GrGLInterface.cpp',
@@ -152,8 +154,6 @@
       '<(skia_src_path)/gpu/gl/GrGLPath.h',
       '<(skia_src_path)/gpu/gl/GrGLProgram.cpp',
       '<(skia_src_path)/gpu/gl/GrGLProgram.h',
-      '<(skia_src_path)/gpu/gl/GrGLProgramStage.cpp',
-      '<(skia_src_path)/gpu/gl/GrGLProgramStage.h',
       '<(skia_src_path)/gpu/gl/GrGLRenderTarget.cpp',
       '<(skia_src_path)/gpu/gl/GrGLRenderTarget.h',
       '<(skia_src_path)/gpu/gl/GrGLShaderBuilder.cpp',
diff --git a/include/gpu/GrEffect.h b/include/gpu/GrEffect.h
index 4eb8f2a..7f97e92 100644
--- a/include/gpu/GrEffect.h
+++ b/include/gpu/GrEffect.h
@@ -26,7 +26,7 @@
     their fields may not change.  (Immutability isn't actually required
     until they've been used in a draw call, but supporting that would require
     setters and getters that could fail, copy-on-write, or deep copying of these
-    objects when they're stored by a GrGLProgramStage.)
+    objects when they're stored by a GrGLEffect.)
   */
 class GrEffect : public GrRefCnt {
 
@@ -47,7 +47,7 @@
         an instance of templated class, GrTProgramStageFactory. It is templated
         on the subclass of GrEffect. The subclass must have a nested type
         (or typedef) named GLProgramStage which will be the subclass of
-        GrGLProgramStage created by the factory.
+        GrGLEffect created by the factory.
 
         Example:
         class MyCustomEffect : public GrEffect {
diff --git a/include/gpu/GrProgramStageFactory.h b/include/gpu/GrProgramStageFactory.h
index 5779862..96505d6 100644
--- a/include/gpu/GrProgramStageFactory.h
+++ b/include/gpu/GrProgramStageFactory.h
@@ -13,12 +13,12 @@
 #include "GrNoncopyable.h"
 
 /** Given a GrEffect of a particular type, creates the corresponding
-    graphics-backend-specific GrGLProgramStage. Also tracks equivalence
+    graphics-backend-specific GrGLEffect. Also tracks equivalence
     of shaders generated via a key.
  */
 
 class GrEffect;
-class GrGLProgramStage;
+class GrGLEffect;
 class GrGLCaps;
 
 class GrProgramStageFactory : public GrNoncopyable {
@@ -30,7 +30,7 @@
     };
 
     virtual StageKey glStageKey(const GrEffect&, const GrGLCaps&) const = 0;
-    virtual GrGLProgramStage* createGLInstance(const GrEffect&) const = 0;
+    virtual GrGLEffect* createGLInstance(const GrEffect&) const = 0;
 
     bool operator ==(const GrProgramStageFactory& b) const {
         return fEffectClassID == b.fEffectClassID;
@@ -72,7 +72,7 @@
     typedef typename EffectClass::GLProgramStage GLProgramStage;
 
     /** Returns a human-readable name that is accessible via GrEffect or
-        GrGLProgramStage and is consistent between the two of them.
+        GrGLEffect and is consistent between the two of them.
      */
     virtual const char* name() const SK_OVERRIDE { return EffectClass::Name(); }
 
diff --git a/src/effects/SkBlendImageFilter.cpp b/src/effects/SkBlendImageFilter.cpp
index e2dde8b..4f46d60 100644
--- a/src/effects/SkBlendImageFilter.cpp
+++ b/src/effects/SkBlendImageFilter.cpp
@@ -12,7 +12,7 @@
 #if SK_SUPPORT_GPU
 #include "SkGr.h"
 #include "SkGrPixelRef.h"
-#include "gl/GrGLProgramStage.h"
+#include "gl/GrGLEffect.h"
 #endif
 
 namespace {
@@ -275,7 +275,7 @@
     }
 }
 
-GrGLProgramStage::StageKey GrGLBlendEffect::GenKey(const GrEffect& s, const GrGLCaps&) {
+GrGLEffect::StageKey GrGLBlendEffect::GenKey(const GrEffect& s, const GrGLCaps&) {
     return static_cast<const GrBlendEffect&>(s).mode();
 }
 #endif
diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp
index 226aed7..37b3e20 100644
--- a/src/effects/SkColorMatrixFilter.cpp
+++ b/src/effects/SkColorMatrixFilter.cpp
@@ -320,7 +320,7 @@
 
 #if SK_SUPPORT_GPU
 #include "GrEffect.h"
-#include "gl/GrGLProgramStage.h"
+#include "gl/GrGLEffect.h"
 
 class ColorMatrixEffect : public GrEffect {
 public:
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index 4402bde..6dda94d 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -16,7 +16,7 @@
 #if SK_SUPPORT_GPU
 #include "GrProgramStageFactory.h"
 #include "effects/GrSingleTextureEffect.h"
-#include "gl/GrGLProgramStage.h"
+#include "gl/GrGLEffect.h"
 #include "gl/GrGLTexture.h"
 #include "GrEffect.h"
 
@@ -1168,7 +1168,7 @@
     GrGLSLMulVarBy4f(code, 2, outputColor, inputColor);
 }
 
-GrGLProgramStage::StageKey GrGLLightingEffect::GenKey(const GrEffect& s,
+GrGLEffect::StageKey GrGLLightingEffect::GenKey(const GrEffect& s,
                                                       const GrGLCaps& caps) {
     return static_cast<const GrLightingEffect&>(s).light()->type();
 }
diff --git a/src/effects/SkMagnifierImageFilter.cpp b/src/effects/SkMagnifierImageFilter.cpp
index 9f5a675..56991b9 100644
--- a/src/effects/SkMagnifierImageFilter.cpp
+++ b/src/effects/SkMagnifierImageFilter.cpp
@@ -15,7 +15,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 #if SK_SUPPORT_GPU
 #include "effects/GrSingleTextureEffect.h"
-#include "gl/GrGLProgramStage.h"
+#include "gl/GrGLEffect.h"
 #include "gl/GrGLSL.h"
 #include "gl/GrGLTexture.h"
 #include "GrProgramStageFactory.h"
@@ -174,7 +174,7 @@
     uman.set2f(fInsetVar, zoom.x_inset(), zoom.y_inset());
 }
 
-GrGLProgramStage::StageKey GrGLMagnifierEffect::GenKey(const GrEffect& s,
+GrGLEffect::StageKey GrGLMagnifierEffect::GenKey(const GrEffect& s,
                                                        const GrGLCaps& caps) {
     return 0;
 }
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp
index eeb61a7..ddd93ba 100644
--- a/src/effects/SkMatrixConvolutionImageFilter.cpp
+++ b/src/effects/SkMatrixConvolutionImageFilter.cpp
@@ -13,7 +13,7 @@
 #include "SkUnPreMultiply.h"
 
 #if SK_SUPPORT_GPU
-#include "gl/GrGLProgramStage.h"
+#include "gl/GrGLEffect.h"
 #endif
 
 SkMatrixConvolutionImageFilter::SkMatrixConvolutionImageFilter(const SkISize& kernelSize, const SkScalar* kernel, SkScalar gain, SkScalar bias, const SkIPoint& target, TileMode tileMode, bool convolveAlpha, SkImageFilter* input)
@@ -415,7 +415,7 @@
 
 };
 
-GrGLProgramStage::StageKey GrGLMatrixConvolutionEffect::GenKey(const GrEffect& s,
+GrGLEffect::StageKey GrGLMatrixConvolutionEffect::GenKey(const GrEffect& s,
                                                         const GrGLCaps& caps) {
     const GrMatrixConvolutionEffect& m = static_cast<const GrMatrixConvolutionEffect&>(s);
     StageKey key = encodeXY(m.kernelSize().width(), m.kernelSize().height());
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 2348815..8e12b5e 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -14,7 +14,7 @@
 #include "GrContext.h"
 #include "GrTexture.h"
 #include "GrGpu.h"
-#include "gl/GrGLProgramStage.h"
+#include "gl/GrGLEffect.h"
 #include "effects/Gr1DKernelEffect.h"
 #endif
 
@@ -341,7 +341,7 @@
     GrGLSLMulVarBy4f(code, 2, outputColor, inputColor);
 }
 
-GrGLProgramStage::StageKey GrGLMorphologyEffect::GenKey(const GrEffect& s,
+GrGLEffect::StageKey GrGLMorphologyEffect::GenKey(const GrEffect& s,
                                                         const GrGLCaps& caps) {
     const GrMorphologyEffect& m = static_cast<const GrMorphologyEffect&>(s);
     StageKey key = static_cast<StageKey>(m.radius());
diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp
index 076db5d..c9dec55 100644
--- a/src/effects/SkTableColorFilter.cpp
+++ b/src/effects/SkTableColorFilter.cpp
@@ -217,7 +217,7 @@
 #if SK_SUPPORT_GPU
 
 #include "GrEffect.h"
-#include "gl/GrGLProgramStage.h"
+#include "gl/GrGLEffect.h"
 #include "SkGr.h"
 
 class GLColorTableEffect;
@@ -312,7 +312,7 @@
     code->appendf("\t\t%s.rgb *= %s.a;\n", outputColor, outputColor);
 }
 
-GrGLProgramStage::StageKey GLColorTableEffect::GenKey(const GrEffect& s,
+GrGLEffect::StageKey GLColorTableEffect::GenKey(const GrEffect& s,
                                                         const GrGLCaps& caps) {
     return 0;
 }
diff --git a/src/effects/gradients/SkGradientShaderPriv.h b/src/effects/gradients/SkGradientShaderPriv.h
index 36550cd..8417716 100644
--- a/src/effects/gradients/SkGradientShaderPriv.h
+++ b/src/effects/gradients/SkGradientShaderPriv.h
@@ -192,7 +192,7 @@
 
 #if SK_SUPPORT_GPU
 
-#include "gl/GrGLProgramStage.h"
+#include "gl/GrGLEffect.h"
 
 class GrSamplerState;
 class GrProgramStageFactory;
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index 7bc203b..4b288c8 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -6,7 +6,7 @@
  */
 
 #include "GrConfigConversionEffect.h"
-#include "gl/GrGLProgramStage.h"
+#include "gl/GrGLEffect.h"
 
 class GrGLConfigConversionEffect : public GrGLLegacyProgramStage {
 public:
diff --git a/src/gpu/effects/GrConvolutionEffect.cpp b/src/gpu/effects/GrConvolutionEffect.cpp
index e49302e..8713c5b 100644
--- a/src/gpu/effects/GrConvolutionEffect.cpp
+++ b/src/gpu/effects/GrConvolutionEffect.cpp
@@ -6,7 +6,7 @@
  */
 
 #include "GrConvolutionEffect.h"
-#include "gl/GrGLProgramStage.h"
+#include "gl/GrGLEffect.h"
 #include "gl/GrGLSL.h"
 #include "gl/GrGLTexture.h"
 #include "GrProgramStageFactory.h"
@@ -108,7 +108,7 @@
     uman.set1fv(fKernelUni, 0, this->width(), conv.kernel());
 }
 
-GrGLProgramStage::StageKey GrGLConvolutionEffect::GenKey(const GrEffect& s,
+GrGLEffect::StageKey GrGLConvolutionEffect::GenKey(const GrEffect& s,
                                                          const GrGLCaps& caps) {
     return static_cast<const GrConvolutionEffect&>(s).radius();
 }
diff --git a/src/gpu/effects/GrSingleTextureEffect.cpp b/src/gpu/effects/GrSingleTextureEffect.cpp
index 47e26e5..7153030 100644
--- a/src/gpu/effects/GrSingleTextureEffect.cpp
+++ b/src/gpu/effects/GrSingleTextureEffect.cpp
@@ -6,7 +6,7 @@
  */
 
 #include "effects/GrSingleTextureEffect.h"
-#include "gl/GrGLProgramStage.h"
+#include "gl/GrGLEffect.h"
 #include "gl/GrGLSL.h"
 #include "gl/GrGLTexture.h"
 #include "GrProgramStageFactory.h"
diff --git a/src/gpu/effects/GrTextureDomainEffect.cpp b/src/gpu/effects/GrTextureDomainEffect.cpp
index 1203392..ca54794 100644
--- a/src/gpu/effects/GrTextureDomainEffect.cpp
+++ b/src/gpu/effects/GrTextureDomainEffect.cpp
@@ -6,7 +6,7 @@
  */
 
 #include "GrTextureDomainEffect.h"
-#include "gl/GrGLProgramStage.h"
+#include "gl/GrGLEffect.h"
 #include "GrProgramStageFactory.h"
 
 class GrGLTextureDomainEffect : public GrGLLegacyProgramStage {
diff --git a/src/gpu/gl/GrGLProgramStage.cpp b/src/gpu/gl/GrGLEffect.cpp
similarity index 70%
rename from src/gpu/gl/GrGLProgramStage.cpp
rename to src/gpu/gl/GrGLEffect.cpp
index cc4cc91..eb11909 100644
--- a/src/gpu/gl/GrGLProgramStage.cpp
+++ b/src/gpu/gl/GrGLEffect.cpp
@@ -6,21 +6,21 @@
  */
 
 #include "GrGLSL.h"
-#include "GrGLProgramStage.h"
+#include "GrGLEffect.h"
 
-GrGLProgramStage::GrGLProgramStage(const GrProgramStageFactory& factory)
+GrGLEffect::GrGLEffect(const GrProgramStageFactory& factory)
     : fFactory(factory) {
 }
 
-GrGLProgramStage::~GrGLProgramStage() {
+GrGLEffect::~GrGLEffect() {
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 
-void GrGLProgramStage::setData(const GrGLUniformManager&, const GrEffect&) {
+void GrGLEffect::setData(const GrGLUniformManager&, const GrEffect&) {
 }
 
-GrGLProgramStage::StageKey GrGLProgramStage::GenTextureKey(const GrEffect& effect,
+GrGLEffect::StageKey GrGLEffect::GenTextureKey(const GrEffect& effect,
                                                            const GrGLCaps& caps) {
     StageKey key = 0;
     for (int index = 0; index < effect.numTextures(); ++index) {
diff --git a/src/gpu/gl/GrGLProgramStage.h b/src/gpu/gl/GrGLEffect.h
similarity index 89%
rename from src/gpu/gl/GrGLProgramStage.h
rename to src/gpu/gl/GrGLEffect.h
index 190ea8a6..32adcdd 100644
--- a/src/gpu/gl/GrGLProgramStage.h
+++ b/src/gpu/gl/GrGLEffect.h
@@ -20,7 +20,7 @@
 
 /** @file
     This file contains specializations for OpenGL of the shader stages declared in
-    include/gpu/GrEffect.h. Objects of type GrGLProgramStage are responsible for emitting the
+    include/gpu/GrEffect.h. Objects of type GrGLEffect 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 GrEffect&, const GrGLCaps&)
@@ -30,7 +30,7 @@
     These objects are created by the factory object returned by the GrEffect::getFactory().
 */
 
-class GrGLProgramStage {
+class GrGLEffect {
 
 public:
     typedef GrEffect::StageKey StageKey;
@@ -41,9 +41,9 @@
 
     typedef GrGLShaderBuilder::TextureSamplerArray TextureSamplerArray;
 
-    GrGLProgramStage(const GrProgramStageFactory&);
+    GrGLEffect(const GrProgramStageFactory&);
 
-    virtual ~GrGLProgramStage();
+    virtual ~GrGLEffect();
 
     /** Called when the program stage should insert its code into the shaders. The code in each
         shader will be in its own block ({}) and so locally scoped names will not collide across
@@ -63,7 +63,7 @@
                             color is solid white, trans black, known to be opaque, etc.) that allows
                             the effect to communicate back similar known info about its output.
         @param samplers     One entry for each GrTextureAccess of the GrEffect that generated the
-                            GrGLProgramStage. These can be passed to the builder to emit texture
+                            GrGLEffect. These can be passed to the builder to emit texture
                             reads in the generated code.
         */
     virtual void emitCode(GrGLShaderBuilder* builder,
@@ -74,7 +74,7 @@
                           const char* inputColor,
                           const TextureSamplerArray& samplers) = 0;
 
-    /** A GrGLProgramStage instance can be reused with any GrEffect that produces the same stage
+    /** A GrGLEffect 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 GrEffect&);
@@ -89,13 +89,13 @@
 };
 
 /**
- * This allows program stages that implemented an older set of virtual functions on GrGLProgramStage
+ * This allows program stages that implemented an older set of virtual functions on GrGLEffect
  * to continue to work by change their parent class to this class. New program stages should not use
  * this interface. It will be removed once older stages are modified to implement emitCode().
  */
-class GrGLLegacyProgramStage : public GrGLProgramStage {
+class GrGLLegacyProgramStage : public GrGLEffect {
 public:
-    GrGLLegacyProgramStage(const GrProgramStageFactory& factory) : GrGLProgramStage(factory) {}
+    GrGLLegacyProgramStage(const GrProgramStageFactory& factory) : GrGLEffect(factory) {}
 
     virtual void setupVariables(GrGLShaderBuilder* builder) {};
     virtual void emitVS(GrGLShaderBuilder* builder,
diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
index ae957e9..e817c1a 100644
--- a/src/gpu/gl/GrGLProgram.cpp
+++ b/src/gpu/gl/GrGLProgram.cpp
@@ -9,7 +9,7 @@
 
 #include "GrAllocator.h"
 #include "GrEffect.h"
-#include "GrGLProgramStage.h"
+#include "GrGLEffect.h"
 #include "gl/GrGLShaderBuilder.h"
 #include "GrGLShaderVar.h"
 #include "GrProgramStageFactory.h"
@@ -896,7 +896,7 @@
 // Stage code generation
 
 // TODO: Move this function to GrGLShaderBuilder
-GrGLProgramStage* GrGLProgram::GenStageCode(const GrEffect* effect,
+GrGLEffect* GrGLProgram::GenStageCode(const GrEffect* effect,
                                             const StageDesc& desc,
                                             StageUniforms* uniforms,
                                             const char* fsInColor, // NULL means no incoming color
@@ -904,7 +904,7 @@
                                             const char* vsInCoord,
                                             GrGLShaderBuilder* builder) {
 
-    GrGLProgramStage* glStage = effect->getFactory().createGLInstance(*effect);
+    GrGLEffect* glStage = effect->getFactory().createGLInstance(*effect);
 
     /// Vertex Shader Stuff
 
diff --git a/src/gpu/gl/GrGLProgram.h b/src/gpu/gl/GrGLProgram.h
index 056b7ed..91239ac 100644
--- a/src/gpu/gl/GrGLProgram.h
+++ b/src/gpu/gl/GrGLProgram.h
@@ -19,7 +19,7 @@
 #include "SkXfermode.h"
 
 class GrBinHashKeyBuilder;
-class GrGLProgramStage;
+class GrGLEffect;
 class GrGLShaderBuilder;
 
 // optionally compile the experimental GS code. Set to GR_DEBUG
@@ -175,7 +175,7 @@
 
     void genInputColor(GrGLShaderBuilder* builder, SkString* inColor);
 
-    static GrGLProgramStage* GenStageCode(const GrEffect* effect,
+    static GrGLEffect* GenStageCode(const GrEffect* effect,
                                           const StageDesc& desc, // TODO: Eliminate this
                                           StageUniforms* stageUniforms, // TODO: Eliminate this
                                           const char* fsInColor, // NULL means no incoming color
@@ -254,7 +254,7 @@
     GrMatrix                    fTextureMatrices[GrDrawState::kNumStages];
     GrGLTexture::Orientation    fTextureOrientation[GrDrawState::kNumStages];
 
-    GrGLProgramStage*           fProgramStage[GrDrawState::kNumStages];
+    GrGLEffect*           fProgramStage[GrDrawState::kNumStages];
 
     Desc fDesc;
     const GrGLContextInfo&      fContextInfo;
diff --git a/src/gpu/gl/GrGLSL.h b/src/gpu/gl/GrGLSL.h
index af0da29..c0d3d5e 100644
--- a/src/gpu/gl/GrGLSL.h
+++ b/src/gpu/gl/GrGLSL.h
@@ -153,7 +153,7 @@
  * mulFactor may be either "" or NULL. In this case either nothing will be appended (kOnes) or an
  * assignment of vec(0,0,0,0) will be appended (kZeros). The assignment is prepended by tabCnt tabs.
  * A semicolon and newline are added after the assignment. (TODO: Remove tabCnt when we auto-insert
- * tabs to GrGLProgramStage-generated lines.) If a zeros vec is assigned then the return value is
+ * tabs to GrGLEffect-generated lines.) If a zeros vec is assigned then the return value is
  * kZeros, otherwise kNone.
  */
 GrSLConstantVec GrGLSLMulVarBy4f(SkString* outAppend,
diff --git a/src/gpu/gl/GrGpuGL_program.cpp b/src/gpu/gl/GrGpuGL_program.cpp
index 5bc84f8..c6a8e90 100644
--- a/src/gpu/gl/GrGpuGL_program.cpp
+++ b/src/gpu/gl/GrGpuGL_program.cpp
@@ -8,7 +8,7 @@
 #include "GrGpuGL.h"
 
 #include "GrEffect.h"
-#include "GrGLProgramStage.h"
+#include "GrGLEffect.h"
 #include "GrGpuVertex.h"
 
 typedef GrGLUniformManager::UniformHandle UniformHandle;