GrCustomStage Renaming Part 4
authorbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 24 Oct 2012 20:11:30 +0000 (20:11 +0000)
committerbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 24 Oct 2012 20:11:30 +0000 (20:11 +0000)
Rename a bunch of things found by searching for "custom".
Review URL: https://codereview.appspot.com/6765048

git-svn-id: http://skia.googlecode.com/svn/trunk@6085 2bbb7eff-a529-9590-31e7-b0007b416f81

32 files changed:
include/core/SkColorFilter.h
include/core/SkImageFilter.h
include/core/SkShader.h
include/effects/SkColorMatrixFilter.h
include/effects/SkMagnifierImageFilter.h
include/effects/SkMatrixConvolutionImageFilter.h
include/gpu/GrEffect.h
include/gpu/GrProgramStageFactory.h
src/core/SkColorFilter.cpp
src/core/SkImageFilter.cpp
src/core/SkShader.cpp
src/effects/SkColorMatrixFilter.cpp
src/effects/SkLightingImageFilter.cpp
src/effects/SkMagnifierImageFilter.cpp
src/effects/SkMatrixConvolutionImageFilter.cpp
src/effects/SkTableColorFilter.cpp
src/effects/gradients/SkGradientShaderPriv.h
src/effects/gradients/SkLinearGradient.cpp
src/effects/gradients/SkLinearGradient.h
src/effects/gradients/SkRadialGradient.cpp
src/effects/gradients/SkRadialGradient.h
src/effects/gradients/SkSweepGradient.cpp
src/effects/gradients/SkSweepGradient.h
src/effects/gradients/SkTwoPointConicalGradient.cpp
src/effects/gradients/SkTwoPointConicalGradient.h
src/effects/gradients/SkTwoPointRadialGradient.cpp
src/effects/gradients/SkTwoPointRadialGradient.h
src/gpu/GrEffect.cpp
src/gpu/SkGpuDevice.cpp
src/gpu/gl/GrGLProgramStage.h
src/gpu/gl/GrGLShaderBuilder.cpp
src/gpu/gl/GrGLUniformManager.cpp

index d470672..b54d5f5 100644 (file)
@@ -118,7 +118,7 @@ public:
     /** A subclass may implement this factory function to work with the GPU backend. If the return
         is non-NULL then the caller owns a ref on the returned object.
      */
-    virtual GrEffect* asNewCustomStage(GrContext*) const;
+    virtual GrEffect* asNewEffect(GrContext*) const;
 
     SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP()
 protected:
index f37d5a3..4c75019 100644 (file)
@@ -90,12 +90,12 @@ public:
      *  in it.  The caller assumes ownership of the stage, and it is up to the
      *  caller to unref it.
      */
-    virtual bool asNewCustomStage(GrEffect** stage, GrTexture*) const;
+    virtual bool asNewEffect(GrEffect** stage, GrTexture*) const;
 
     /**
      *  Returns true if the filter can be processed on the GPU.  This is most
      *  often used for multi-pass effects, where intermediate results must be
-     *  rendered to textures.  For single-pass effects, use asNewCustomStage().
+     *  rendered to textures.  For single-pass effects, use asNewEffect().
      *  The default implementation returns false.
      */
     virtual bool canFilterImageGPU() const;
index 23e0950..7329c1b 100644 (file)
@@ -307,12 +307,12 @@ public:
 
     /**
      *  If the shader subclass has a GrEffect implementation, this installs
-     *  a custom stage on the sampler. A GrContext pointer is required since custom
+     *  an effect on the sampler. A GrContext pointer is required since custom
      *  stages may need to create textures. The sampler parameter is necessary to set a
      *  texture matrix. It will eventually be removed and this function will operate as a
      *  GrEffect factory.
      */
-    virtual bool asNewCustomStage(GrContext* context, GrSamplerState* sampler) const;
+    virtual bool asNewEffect(GrContext* context, GrSamplerState* sampler) const;
 
     //////////////////////////////////////////////////////////////////////////
     //  Factory methods for stock shaders
index 3ab253a..799cf8c 100644 (file)
@@ -22,7 +22,7 @@ public:
     virtual uint32_t getFlags() SK_OVERRIDE;
     virtual bool asColorMatrix(SkScalar matrix[20]) SK_OVERRIDE;
 #if SK_SUPPORT_GPU
-    virtual GrEffect* asNewCustomStage(GrContext*) const SK_OVERRIDE;
+    virtual GrEffect* asNewEffect(GrContext*) const SK_OVERRIDE;
 #endif
 
     struct State {
index 26cb1a8..21ab894 100644 (file)
@@ -16,8 +16,8 @@ class SK_API SkMagnifierImageFilter : public SkImageFilter {
 public:
     SkMagnifierImageFilter(SkRect srcRect, SkScalar inset);
 
-    virtual bool asNewCustomStage(GrEffect** stage,
-                                  GrTexture* texture) const SK_OVERRIDE;
+    virtual bool asNewEffect(GrEffect** stage,
+                             GrTexture* texture) const SK_OVERRIDE;
 
     SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkMagnifierImageFilter)
 
index bdeaad3..c0a5fd7 100644 (file)
@@ -62,7 +62,7 @@ protected:
                                SkBitmap* result, SkIPoint* loc) SK_OVERRIDE;
 
 #if SK_SUPPORT_GPU
-    virtual bool asNewCustomStage(GrEffect** stage, GrTexture*) const SK_OVERRIDE;
+    virtual bool asNewEffect(GrEffect** stage, GrTexture*) const SK_OVERRIDE;
 #endif
 
 private:
index c5af2b9..7574958 100644 (file)
@@ -5,8 +5,8 @@
  * found in the LICENSE file.
  */
 
-#ifndef GrCustomStage_DEFINED
-#define GrCustomStage_DEFINED
+#ifndef GrEffect_DEFINED
+#define GrEffect_DEFINED
 
 #include "GrRefCnt.h"
 #include "GrNoncopyable.h"
@@ -50,11 +50,11 @@ public:
         GrGLProgramStage created by the factory.
 
         Example:
-        class MyCustomStage : public GrEffect {
+        class MyCustomEffect : public GrEffect {
         ...
             virtual const GrProgramStageFactory& getFactory() const
                                                             SK_OVERRIDE {
-                return GrTProgramStageFactory<MyCustomStage>::getInstance();
+                return GrTProgramStageFactory<MyCustomEffect>::getInstance();
             }
         ...
         };
index 385ebfe..1a4f078 100644 (file)
@@ -80,7 +80,7 @@ public:
 
     /** Returns a value that idenitifes the GLSL shader code generated by
         a GrEffect. This enables caching of generated shaders. Part of the
-        id identifies the GrCustomShader subclass. The remainder is based
+        id identifies the GrEffect subclass. The remainder is based
         on the aspects of the GrEffect object's configuration that affect
         GLSL code generation. */
     virtual StageKey glStageKey(const GrEffect& stage,
index 6dbaf02..6d9f4ba 100644 (file)
@@ -40,7 +40,7 @@ SkColor SkColorFilter::filterColor(SkColor c) {
     return SkUnPreMultiply::PMColorToColor(dst);
 }
 
-GrEffect* SkColorFilter::asNewCustomStage(GrContext*) const {
+GrEffect* SkColorFilter::asNewEffect(GrContext*) const {
     return NULL;
 }
 
index 81b5b5a..05e682c 100644 (file)
@@ -117,7 +117,7 @@ bool SkImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm,
     return true;
 }
 
-bool SkImageFilter::asNewCustomStage(GrEffect**, GrTexture*) const {
+bool SkImageFilter::asNewEffect(GrEffect**, GrTexture*) const {
     return false;
 }
 
index 7e3a92b..50546ff 100644 (file)
@@ -205,7 +205,7 @@ SkShader::GradientType SkShader::asAGradient(GradientInfo* info) const {
     return kNone_GradientType;
 }
 
-bool SkShader::asNewCustomStage(GrContext*, GrSamplerState*) const {
+bool SkShader::asNewEffect(GrContext*, GrSamplerState*) const {
     return false;
 }
 
index cd7f155..be766f2 100644 (file)
@@ -424,7 +424,7 @@ GrEffect* ColorMatrixEffect::TestCreate(SkRandom* random,
     return SkNEW_ARGS(ColorMatrixEffect, (colorMatrix));
 }
 
-GrEffect* SkColorMatrixFilter::asNewCustomStage(GrContext*) const {
+GrEffect* SkColorMatrixFilter::asNewEffect(GrContext*) const {
     return SkNEW_ARGS(ColorMatrixEffect, (fMatrix));
 }
 
index 267ce99..702fb12 100644 (file)
@@ -264,7 +264,7 @@ public:
                                  SkScalar kd, SkImageFilter* input);
     SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDiffuseLightingImageFilter)
 
-    virtual bool asNewCustomStage(GrEffect** stage, GrTexture*) const SK_OVERRIDE;
+    virtual bool asNewEffect(GrEffect** stage, GrTexture*) const SK_OVERRIDE;
     SkScalar kd() const { return fKD; }
 
 protected:
@@ -284,7 +284,7 @@ public:
     SkSpecularLightingImageFilter(SkLight* light, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, SkImageFilter* input);
     SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkSpecularLightingImageFilter)
 
-    virtual bool asNewCustomStage(GrEffect** stage, GrTexture*) const SK_OVERRIDE;
+    virtual bool asNewEffect(GrEffect** stage, GrTexture*) const SK_OVERRIDE;
     SkScalar ks() const { return fKS; }
     SkScalar shininess() const { return fShininess; }
 
@@ -821,8 +821,8 @@ bool SkDiffuseLightingImageFilter::onFilterImage(Proxy*,
     return true;
 }
 
-bool SkDiffuseLightingImageFilter::asNewCustomStage(GrEffect** stage,
-                                                    GrTexture* texture) const {
+bool SkDiffuseLightingImageFilter::asNewEffect(GrEffect** stage,
+                                               GrTexture* texture) const {
 #if SK_SUPPORT_GPU
     if (stage) {
         SkScalar scale = SkScalarMul(surfaceScale(), SkIntToScalar(255));
@@ -890,8 +890,8 @@ bool SkSpecularLightingImageFilter::onFilterImage(Proxy*,
     return true;
 }
 
-bool SkSpecularLightingImageFilter::asNewCustomStage(GrEffect** stage,
-                                                     GrTexture* texture) const {
+bool SkSpecularLightingImageFilter::asNewEffect(GrEffect** stage,
+                                                GrTexture* texture) const {
 #if SK_SUPPORT_GPU
     if (stage) {
         SkScalar scale = SkScalarMul(surfaceScale(), SkIntToScalar(255));
index c25e951..5a81465 100644 (file)
@@ -202,7 +202,7 @@ GrEffect* GrMagnifierEffect::TestCreate(SkRandom* random,
                 inset));
     GrSamplerState sampler;
     GrEffect* stage;
-    filter->asNewCustomStage(&stage, textures[0]);
+    filter->asNewEffect(&stage, textures[0]);
     GrAssert(NULL != stage);
     return stage;
 }
@@ -243,8 +243,8 @@ SkMagnifierImageFilter::SkMagnifierImageFilter(SkRect srcRect, SkScalar inset)
     SkASSERT(srcRect.x() >= 0 && srcRect.y() >= 0 && inset >= 0);
 }
 
-bool SkMagnifierImageFilter::asNewCustomStage(GrEffect** stage,
-                                              GrTexture* texture) const {
+bool SkMagnifierImageFilter::asNewEffect(GrEffect** stage,
+                                         GrTexture* texture) const {
 #if SK_SUPPORT_GPU
     if (stage) {
       *stage =
index 988c901..ae16aef 100644 (file)
@@ -521,8 +521,8 @@ GrEffect* GrMatrixConvolutionEffect::TestCreate(SkRandom* random,
 
 }
 
-bool SkMatrixConvolutionImageFilter::asNewCustomStage(GrEffect** stage,
-                                                      GrTexture* texture) const {
+bool SkMatrixConvolutionImageFilter::asNewEffect(GrEffect** stage,
+                                                 GrTexture* texture) const {
     bool ok = fKernelSize.width() * fKernelSize.height() <= MAX_KERNEL_SIZE;
     if (ok && stage) {
         *stage = SkNEW_ARGS(GrMatrixConvolutionEffect, (texture,
index 1412952..1e7a8b6 100644 (file)
@@ -41,7 +41,7 @@ public:
     virtual bool asComponentTable(SkBitmap* table) const SK_OVERRIDE;
 
 #if SK_SUPPORT_GPU
-    virtual GrEffect* asNewCustomStage(GrContext* context) const SK_OVERRIDE;
+    virtual GrEffect* asNewEffect(GrContext* context) const SK_OVERRIDE;
 #endif
 
     virtual void filterSpan(const SkPMColor src[], int count,
@@ -350,10 +350,10 @@ GrEffect* ColorTableEffect::TestCreate(SkRandom* random,
     return SkNEW_ARGS(ColorTableEffect, (textures[GrEffectUnitTest::kAlphaTextureIdx]));
 }
 
-GrEffect* SkTable_ColorFilter::asNewCustomStage(GrContext* context) const {
+GrEffect* SkTable_ColorFilter::asNewEffect(GrContext* context) const {
     SkBitmap bitmap;
     this->asComponentTable(&bitmap);
-    // passing NULL because this custom effect does no tiling or filtering.
+    // passing NULL because this effect does no tiling or filtering.
     GrTexture* texture = GrLockCachedBitmapTexture(context, bitmap, NULL);
     GrEffect* stage = SkNEW_ARGS(ColorTableEffect, (texture));
 
index 96709c9..a1b3776 100644 (file)
@@ -270,7 +270,7 @@ private:
 
 ///////////////////////////////////////////////////////////////////////////////
 
-// Base class for GL gradient custom stages
+// Base class for GL gradient effects
 class GrGLGradientStage : public GrGLLegacyProgramStage {
 public:
 
index 2de4fc6..8219388 100644 (file)
@@ -539,9 +539,9 @@ GrEffect* GrLinearGradient::TestCreate(SkRandom* random,
                                                                  colors, stops, colorCount,
                                                                  tm));
     GrSamplerState sampler;
-    shader->asNewCustomStage(context, &sampler);
+    shader->asNewEffect(context, &sampler);
     GrAssert(NULL != sampler.getEffect());
-    // const_cast and ref is a hack! Will remove when asNewCustomStage returns GrEffect*
+    // const_cast and ref is a hack! Will remove when asNewEffect returns GrEffect*
     sampler.getEffect()->ref();
     return const_cast<GrEffect*>(sampler.getEffect());
 }
@@ -559,7 +559,7 @@ void GrGLLinearGradient::emitFS(GrGLShaderBuilder* builder,
 
 /////////////////////////////////////////////////////////////////////
 
-bool SkLinearGradient::asNewCustomStage(GrContext* context, GrSamplerState* sampler) const {
+bool SkLinearGradient::asNewEffect(GrContext* context, GrSamplerState* sampler) const {
     SkASSERT(NULL != context && NULL != sampler);
 
     SkAutoTUnref<GrEffect> stage(SkNEW_ARGS(GrLinearGradient, (context, *this, fTileMode)));
@@ -580,7 +580,7 @@ bool SkLinearGradient::asNewCustomStage(GrContext* context, GrSamplerState* samp
 
 #else
 
-bool SkLinearGradient::asNewCustomStage(GrContext*, GrSamplerState*) const {
+bool SkLinearGradient::asNewEffect(GrContext*, GrSamplerState*) const {
     SkDEBUGFAIL("Should not call in GPU-less build");
     return false;
 }
index fe60543..e0e75b4 100644 (file)
@@ -22,7 +22,7 @@ public:
     virtual void shadeSpan16(int x, int y, uint16_t dstC[], int count) SK_OVERRIDE;
     virtual BitmapType asABitmap(SkBitmap*, SkMatrix*, TileMode*) const SK_OVERRIDE;
     virtual GradientType asAGradient(GradientInfo* info) const SK_OVERRIDE;
-    virtual bool asNewCustomStage(GrContext* context, GrSamplerState* sampler) const SK_OVERRIDE;
+    virtual bool asNewEffect(GrContext* context, GrSamplerState* sampler) const SK_OVERRIDE;
 
     SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLinearGradient)
 
index dbf5e7e..1008c87 100644 (file)
@@ -538,9 +538,9 @@ GrEffect* GrRadialGradient::TestCreate(SkRandom* random,
                                                                  colors, stops, colorCount,
                                                                  tm));
     GrSamplerState sampler;
-    shader->asNewCustomStage(context, &sampler);
+    shader->asNewEffect(context, &sampler);
     GrAssert(NULL != sampler.getEffect());
-    // const_cast and ref is a hack! Will remove when asNewCustomStage returns GrEffect*
+    // const_cast and ref is a hack! Will remove when asNewEffect returns GrEffect*
     sampler.getEffect()->ref();
     return const_cast<GrEffect*>(sampler.getEffect());
 }
@@ -558,7 +558,7 @@ void GrGLRadialGradient::emitFS(GrGLShaderBuilder* builder,
 
 /////////////////////////////////////////////////////////////////////
 
-bool SkRadialGradient::asNewCustomStage(GrContext* context, GrSamplerState* sampler) const {
+bool SkRadialGradient::asNewEffect(GrContext* context, GrSamplerState* sampler) const {
     SkASSERT(NULL != context && NULL != sampler);
     SkAutoTUnref<GrEffect> stage(SkNEW_ARGS(GrRadialGradient, (context, *this, fTileMode)));
 
@@ -578,7 +578,7 @@ bool SkRadialGradient::asNewCustomStage(GrContext* context, GrSamplerState* samp
 
 #else
 
-bool SkRadialGradient::asNewCustomStage(GrContext*, GrSamplerState*) const {
+bool SkRadialGradient::asNewEffect(GrContext*, GrSamplerState*) const {
     SkDEBUGFAIL("Should not call in GPU-less build");
     return false;
 }
index fc17520..9384793 100644 (file)
@@ -24,7 +24,7 @@ public:
                                  SkMatrix* matrix,
                                  TileMode* xy) const SK_OVERRIDE;
     virtual GradientType asAGradient(GradientInfo* info) const SK_OVERRIDE;
-    virtual bool asNewCustomStage(GrContext* context, GrSamplerState* sampler) const SK_OVERRIDE;
+    virtual bool asNewEffect(GrContext* context, GrSamplerState* sampler) const SK_OVERRIDE;
 
     SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkRadialGradient)
 
index 11e1a78..0678f3b 100644 (file)
@@ -444,9 +444,9 @@ GrEffect* GrSweepGradient::TestCreate(SkRandom* random,
     SkAutoTUnref<SkShader> shader(SkGradientShader::CreateSweep(center.fX, center.fY,
                                                                 colors, stops, colorCount));
     GrSamplerState sampler;
-    shader->asNewCustomStage(context, &sampler);
+    shader->asNewEffect(context, &sampler);
     GrAssert(NULL != sampler.getEffect());
-    // const_cast and ref is a hack! Will remove when asNewCustomStage returns GrEffect*
+    // const_cast and ref is a hack! Will remove when asNewEffect returns GrEffect*
     sampler.getEffect()->ref();
     return const_cast<GrEffect*>(sampler.getEffect());
 }
@@ -465,7 +465,7 @@ void GrGLSweepGradient::emitFS(GrGLShaderBuilder* builder,
 
 /////////////////////////////////////////////////////////////////////
 
-bool SkSweepGradient::asNewCustomStage(GrContext* context, GrSamplerState* sampler) const {
+bool SkSweepGradient::asNewEffect(GrContext* context, GrSamplerState* sampler) const {
     SkAutoTUnref<GrEffect> stage(SkNEW_ARGS(GrSweepGradient, (context, *this)));
 
 
@@ -485,7 +485,7 @@ bool SkSweepGradient::asNewCustomStage(GrContext* context, GrSamplerState* sampl
 
 #else
 
-bool SkSweepGradient::asNewCustomStage(GrContext*, GrSamplerState*) const {
+bool SkSweepGradient::asNewEffect(GrContext*, GrSamplerState*) const {
     SkDEBUGFAIL("Should not call in GPU-less build");
     return false;
 }
index 8e42be0..c685cd9 100644 (file)
@@ -24,7 +24,7 @@ public:
 
     virtual GradientType asAGradient(GradientInfo* info) const SK_OVERRIDE;
 
-    virtual bool asNewCustomStage(GrContext* context, GrSamplerState* sampler) const SK_OVERRIDE;
+    virtual bool asNewEffect(GrContext* context, GrSamplerState* sampler) const SK_OVERRIDE;
 
     SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkSweepGradient)
 
index 4e85c73..13f3dbb 100644 (file)
@@ -438,9 +438,9 @@ GrEffect* GrConical2Gradient::TestCreate(SkRandom* random,
                                                                           colors, stops, colorCount,
                                                                           tm));
     GrSamplerState sampler;
-    shader->asNewCustomStage(context, &sampler);
+    shader->asNewEffect(context, &sampler);
     GrAssert(NULL != sampler.getEffect());
-    // const_cast and ref is a hack! Will remove when asNewCustomStage returns GrEffect*
+    // const_cast and ref is a hack! Will remove when asNewEffect returns GrEffect*
     sampler.getEffect()->ref();
     return const_cast<GrEffect*>(sampler.getEffect());
 }
@@ -669,8 +669,8 @@ GrEffect::StageKey GrGLConical2Gradient::GenKey(const GrEffect& s, const GrGLCap
 
 /////////////////////////////////////////////////////////////////////
 
-bool SkTwoPointConicalGradient::asNewCustomStage(GrContext* context,
-                                                 GrSamplerState* sampler) const {
+bool SkTwoPointConicalGradient::asNewEffect(GrContext* context,
+                                            GrSamplerState* sampler) const {
     SkASSERT(NULL != context && NULL != sampler);
 
     SkMatrix matrix;
@@ -700,7 +700,7 @@ bool SkTwoPointConicalGradient::asNewCustomStage(GrContext* context,
 
 #else
 
-bool SkTwoPointConicalGradient::asNewCustomStage(GrContext*, GrSamplerState*) const {
+bool SkTwoPointConicalGradient::asNewEffect(GrContext*, GrSamplerState*) const {
     SkDEBUGFAIL("Should not call in GPU-less build");
     return false;
 }
index 4054491..398735d 100644 (file)
@@ -61,7 +61,7 @@ public:
                                  SkMatrix* matrix,
                                  TileMode* xy) const;
     virtual SkShader::GradientType asAGradient(GradientInfo* info) const  SK_OVERRIDE;
-    virtual bool asNewCustomStage(GrContext* context, GrSamplerState* sampler) const SK_OVERRIDE;
+    virtual bool asNewEffect(GrContext* context, GrSamplerState* sampler) const SK_OVERRIDE;
 
     SkScalar getCenterX1() const { return SkPoint::Distance(fCenter1, fCenter2); }
     SkScalar getStartRadius() const { return fRadius1; }
index d4ce9fa..d7651ff 100644 (file)
@@ -472,9 +472,9 @@ GrEffect* GrRadial2Gradient::TestCreate(SkRandom* random,
                                                                          colors, stops, colorCount,
                                                                          tm));
     GrSamplerState sampler;
-    shader->asNewCustomStage(context, &sampler);
+    shader->asNewEffect(context, &sampler);
     GrAssert(NULL != sampler.getEffect());
-    // const_cast and ref is a hack! Will remove when asNewCustomStage returns GrEffect*
+    // const_cast and ref is a hack! Will remove when asNewEffect returns GrEffect*
     sampler.getEffect()->ref();
     return const_cast<GrEffect*>(sampler.getEffect());
 }
@@ -642,8 +642,8 @@ GrEffect::StageKey GrGLRadial2Gradient::GenKey(const GrEffect& s, const GrGLCaps
 
 /////////////////////////////////////////////////////////////////////
 
-bool SkTwoPointRadialGradient::asNewCustomStage(GrContext* context,
-                                                GrSamplerState* sampler) const {
+bool SkTwoPointRadialGradient::asNewEffect(GrContext* context,
+                                           GrSamplerState* sampler) const {
     SkASSERT(NULL != context && NULL != sampler);
     SkScalar diffLen = fDiff.length();
     SkMatrix matrix;
@@ -671,7 +671,7 @@ bool SkTwoPointRadialGradient::asNewCustomStage(GrContext* context,
 
 #else
 
-bool SkTwoPointRadialGradient::asNewCustomStage(GrContext*, GrSamplerState*) const {
+bool SkTwoPointRadialGradient::asNewEffect(GrContext*, GrSamplerState*) const {
     SkDEBUGFAIL("Should not call in GPU-less build");
     return false;
 }
index adbb602..2810f43 100644 (file)
@@ -23,7 +23,7 @@ public:
                                  SkMatrix* matrix,
                                  TileMode* xy) const SK_OVERRIDE;
     virtual GradientType asAGradient(GradientInfo* info) const SK_OVERRIDE;
-    virtual bool asNewCustomStage(GrContext* context, GrSamplerState* sampler) const SK_OVERRIDE;
+    virtual bool asNewEffect(GrContext* context, GrSamplerState* sampler) const SK_OVERRIDE;
 
     virtual void shadeSpan(int x, int y, SkPMColor* dstCParam,
                            int count) SK_OVERRIDE;
index 7997fb0..352d43c 100644 (file)
@@ -19,7 +19,7 @@ SkTArray<GrEffectTestFactory*, true>* GrEffectTestFactory::GetFactories() {
 }
 #endif
 
-class GrCustomStage_Globals {
+class GrEffect_Globals {
 public:
     static GrMemoryPool* GetTLS() {
         return (GrMemoryPool*)SkTLS::Get(CreateTLS, DeleteTLS);
@@ -69,9 +69,9 @@ const GrTextureAccess& GrEffect::textureAccess(int index) const {
 }
 
 void * GrEffect::operator new(size_t size) {
-    return GrCustomStage_Globals::GetTLS()->allocate(size);
+    return GrEffect_Globals::GetTLS()->allocate(size);
 }
 
 void GrEffect::operator delete(void* target) {
-    GrCustomStage_Globals::GetTLS()->release(target);
+    GrEffect_Globals::GetTLS()->release(target);
 }
index eae8ce8..5cdecdb 100644 (file)
@@ -512,11 +512,11 @@ inline bool skPaint2GrPaintNoShader(SkGpuDevice* dev,
             SkColor filtered = colorFilter->filterColor(skPaint.getColor());
             grPaint->setColor(SkColor2GrColor(filtered));
         } else {
-            SkAutoTUnref<GrEffect> stage(colorFilter->asNewCustomStage(dev->context()));
+            SkAutoTUnref<GrEffect> stage(colorFilter->asNewEffect(dev->context()));
             if (NULL != stage.get()) {
                 grPaint->colorSampler(kColorFilterTextureIdx)->setEffect(stage);
             } else {
-                // TODO: rewrite this using asNewCustomStage()
+                // TODO: rewrite this using asNewEffect()
                 SkColor color;
                 SkXfermode::Mode filterMode;
                 if (colorFilter->asColorMode(&color, &filterMode)) {
@@ -552,7 +552,7 @@ inline bool skPaint2GrPaintShader(SkGpuDevice* dev,
     }
 
     GrSamplerState* sampler = grPaint->colorSampler(kShaderTextureIdx);
-    if (shader->asNewCustomStage(dev->context(), sampler)) {
+    if (shader->asNewEffect(dev->context(), sampler)) {
         return true;
     }
 
@@ -1482,7 +1482,7 @@ static GrTexture* filter_texture(SkDevice* device, GrContext* context,
         // filter.  Also set the clip wide open and the matrix to identity.
         GrContext::AutoWideOpenIdentityDraw awo(context, NULL);
         texture = filter->onFilterImageGPU(&proxy, texture, rect);
-    } else if (filter->asNewCustomStage(&stage, texture)) {
+    } else if (filter->asNewEffect(&stage, texture)) {
         GrAutoScratchTexture dst(context, desc);
         apply_effect(context, texture, dst.texture(), rect, stage);
         texture = dst.detach();
@@ -1624,7 +1624,7 @@ void SkGpuDevice::drawDevice(const SkDraw& draw, SkDevice* device,
 }
 
 bool SkGpuDevice::canHandleImageFilter(SkImageFilter* filter) {
-    if (!filter->asNewCustomStage(NULL, NULL) &&
+    if (!filter->asNewEffect(NULL, NULL) &&
         !filter->canFilterImageGPU()) {
         return false;
     }
index 37d0b03..300e6f1 100644 (file)
@@ -5,8 +5,8 @@
  * found in the LICENSE file.
  */
 
-#ifndef GrGLCustomStage_DEFINED
-#define GrGLCustomStage_DEFINED
+#ifndef GrGLProgramStage_DEFINED
+#define GrGLProgramStage_DEFINED
 
 #include "GrAllocator.h"
 #include "GrEffect.h"
@@ -24,8 +24,8 @@ class GrGLTexture;
     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&)
-    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.
+    that is used to implement a program cache. When two GrEffects 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 GrEffect::getFactory().
 */
index 217b874..394b42f 100644 (file)
@@ -100,8 +100,8 @@ GrGLShaderBuilder::GrGLShaderBuilder(const GrGLContextInfo& ctx, GrGLUniformMana
 
 void GrGLShaderBuilder::setupTextureAccess(const char* varyingFSName, GrSLType varyingType) {
     // FIXME: We don't know how the effect will manipulate the coords. So we give up on using
-    // projective texturing and always give the stage 2D coords. This will be fixed when custom
-    // stages are responsible for setting up their own tex coords / tex matrices.
+    // projective texturing and always give the stage 2D coords. This will be fixed when effects
+    // are responsible for setting up their own tex coords / tex matrices.
     switch (varyingType) {
         case kVec2f_GrSLType:
             fDefaultTexCoordsName = varyingFSName;
index 06ce2db..684ef8c 100644 (file)
@@ -170,7 +170,7 @@ void GrGLUniformManager::setMatrix3f(UniformHandle u, const GrGLfloat matrix[])
     const Uniform& uni = fUniforms[handle_to_index(u)];
     GrAssert(uni.fType == kMat33f_GrSLType);
     GrAssert(GrGLShaderVar::kNonArray == uni.fArrayCount);
-    // TODO: Re-enable this assert once texture matrices aren't forced on all custom effects
+    // TODO: Re-enable this assert once texture matrices aren't forced on all effects
     // GrAssert(kUnusedUniform != uni.fFSLocation || kUnusedUniform != uni.fVSLocation);
     if (kUnusedUniform != uni.fFSLocation) {
         GR_GL_CALL(fContext.interface(), UniformMatrix3fv(uni.fFSLocation, 1, false, matrix));