Change some function/vars from EffectPtr to EffectRef to reflect GrEffectPtr->GrEffectRef renaming.



git-svn-id: http://skia.googlecode.com/svn/trunk@7226 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/gpu/GrEffect.h b/include/gpu/GrEffect.h
index 99a26ee..1e0ce79 100644
--- a/include/gpu/GrEffect.h
+++ b/include/gpu/GrEffect.h
@@ -153,28 +153,28 @@
      */
     void addTextureAccess(const GrTextureAccess* textureAccess);
 
-    GrEffect() : fEffectPtr(NULL) {};
+    GrEffect() : fEffectRef(NULL) {};
 
     /** This should be called by GrEffect subclass factories */
-    static GrEffectRef* CreateEffectPtr(GrEffect* effect) {
-        if (NULL == effect->fEffectPtr) {
-            effect->fEffectPtr = SkNEW_ARGS(GrEffectRef, (effect));
+    static GrEffectRef* CreateEffectRef(GrEffect* effect) {
+        if (NULL == effect->fEffectRef) {
+            effect->fEffectRef = SkNEW_ARGS(GrEffectRef, (effect));
         } else {
-            effect->fEffectPtr->ref();
+            effect->fEffectRef->ref();
             GrCrash("This function should only be called once per effect currently.");
         }
-        return effect->fEffectPtr;
+        return effect->fEffectRef;
     }
 
 private:
-    void effectPtrDestroyed() {
-        fEffectPtr = NULL;
+    void EffectRefDestroyed() {
+        fEffectRef = NULL;
     }
 
     friend class GrEffectRef; // to call GrEffectRef destroyed
 
     SkSTArray<4, const GrTextureAccess*, true>  fTextureAccesses;
-    GrEffectRef*                                fEffectPtr;
+    GrEffectRef*                                fEffectRef;
 
     typedef GrRefCnt INHERITED;
 };
diff --git a/include/gpu/GrEffectStage.h b/include/gpu/GrEffectStage.h
index 0b532d6..597ea49 100644
--- a/include/gpu/GrEffectStage.h
+++ b/include/gpu/GrEffectStage.h
@@ -22,20 +22,20 @@
 public:
 
     GrEffectStage()
-    : fEffectPtr (NULL) {
+    : fEffectRef (NULL) {
         GR_DEBUGCODE(fSavedCoordChangeCnt = 0;)
     }
 
     ~GrEffectStage() {
-        GrSafeUnref(fEffectPtr);
+        GrSafeUnref(fEffectRef);
         GrAssert(0 == fSavedCoordChangeCnt);
     }
 
     bool operator ==(const GrEffectStage& other) const {
         // first handle cases where one or the other has no effect
-        if (NULL == fEffectPtr) {
-            return NULL == other.fEffectPtr;
-        } else if (NULL == other.fEffectPtr) {
+        if (NULL == fEffectRef) {
+            return NULL == other.fEffectRef;
+        } else if (NULL == other.fEffectRef) {
             return false;
         }
 
@@ -53,8 +53,8 @@
     bool operator !=(const GrEffectStage& s) const { return !(*this == s); }
 
     GrEffectStage& operator =(const GrEffectStage& other) {
-        GrSafeAssign(fEffectPtr, other.fEffectPtr);
-        if (NULL != fEffectPtr) {
+        GrSafeAssign(fEffectRef, other.fEffectRef);
+        if (NULL != fEffectRef) {
             fCoordChangeMatrix = other.fCoordChangeMatrix;
         }
         return *this;
@@ -70,7 +70,7 @@
     class SavedCoordChange {
     private:
         SkMatrix fCoordChangeMatrix;
-        GR_DEBUGCODE(mutable SkAutoTUnref<const GrEffectRef> fEffectPtr;)
+        GR_DEBUGCODE(mutable SkAutoTUnref<const GrEffectRef> fEffectRef;)
 
         friend class GrEffectStage;
     };
@@ -83,9 +83,9 @@
      */
     void saveCoordChange(SavedCoordChange* savedCoordChange) const {
         savedCoordChange->fCoordChangeMatrix = fCoordChangeMatrix;
-        GrAssert(NULL == savedCoordChange->fEffectPtr.get());
-        GR_DEBUGCODE(GrSafeRef(fEffectPtr);)
-        GR_DEBUGCODE(savedCoordChange->fEffectPtr.reset(fEffectPtr);)
+        GrAssert(NULL == savedCoordChange->fEffectRef.get());
+        GR_DEBUGCODE(GrSafeRef(fEffectRef);)
+        GR_DEBUGCODE(savedCoordChange->fEffectRef.reset(fEffectRef);)
         GR_DEBUGCODE(++fSavedCoordChangeCnt);
     }
 
@@ -94,9 +94,9 @@
      */
     void restoreCoordChange(const SavedCoordChange& savedCoordChange) {
         fCoordChangeMatrix = savedCoordChange.fCoordChangeMatrix;
-        GrAssert(savedCoordChange.fEffectPtr.get() == fEffectPtr);
+        GrAssert(savedCoordChange.fEffectRef.get() == fEffectRef);
         GR_DEBUGCODE(--fSavedCoordChangeCnt);
-        GR_DEBUGCODE(savedCoordChange.fEffectPtr.reset(NULL);)
+        GR_DEBUGCODE(savedCoordChange.fEffectRef.reset(NULL);)
     }
 
     /**
@@ -106,20 +106,20 @@
     const SkMatrix& getCoordChangeMatrix() const { return fCoordChangeMatrix; }
 
     void reset() {
-        GrSafeSetNull(fEffectPtr);
+        GrSafeSetNull(fEffectRef);
     }
 
-    const GrEffectRef* setEffect(const GrEffectRef* effectPtr) {
+    const GrEffectRef* setEffect(const GrEffectRef* EffectRef) {
         GrAssert(0 == fSavedCoordChangeCnt);
-        GrSafeAssign(fEffectPtr, effectPtr);
+        GrSafeAssign(fEffectRef, EffectRef);
         fCoordChangeMatrix.reset();
-        return effectPtr;
+        return EffectRef;
     }
 
     // TODO: Push GrEffectRef deeper and make this getter return it rather than GrEffect.
     const GrEffect* getEffect() const {
-        if (NULL != fEffectPtr) {
-            return fEffectPtr->get();
+        if (NULL != fEffectRef) {
+            return fEffectRef->get();
         } else {
             return NULL;
         }
@@ -127,7 +127,7 @@
 
 private:
     SkMatrix            fCoordChangeMatrix;
-    const GrEffectRef*  fEffectPtr;
+    const GrEffectRef*  fEffectRef;
 
     GR_DEBUGCODE(mutable int fSavedCoordChangeCnt;)
 };
diff --git a/src/effects/SkBlendImageFilter.cpp b/src/effects/SkBlendImageFilter.cpp
index d9fb320..5a93b47 100644
--- a/src/effects/SkBlendImageFilter.cpp
+++ b/src/effects/SkBlendImageFilter.cpp
@@ -147,7 +147,7 @@
                                GrTexture* foreground,
                                GrTexture* background) {
         SkAutoTUnref<GrEffect> effect(SkNEW_ARGS(GrBlendEffect, (mode, foreground, background)));
-        return CreateEffectPtr(effect);
+        return CreateEffectRef(effect);
     }
 
     virtual ~GrBlendEffect();
diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp
index 85f6ccd..0fb438d 100644
--- a/src/effects/SkColorMatrixFilter.cpp
+++ b/src/effects/SkColorMatrixFilter.cpp
@@ -327,7 +327,7 @@
 public:
     static GrEffectRef* Create(const SkColorMatrix& matrix) {
         SkAutoTUnref<GrEffect> effect(SkNEW_ARGS(ColorMatrixEffect, (matrix)));
-        return CreateEffectPtr(effect);
+        return CreateEffectRef(effect);
     }
 
     static const char* Name() { return "Color Matrix"; }
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index 36ca6af..9a67ac3 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -240,7 +240,7 @@
                                                                            scale,
                                                                            displacement,
                                                                            color)));
-        return CreateEffectPtr(effect);
+        return CreateEffectRef(effect);
     }
 
     virtual ~GrDisplacementMapEffect();
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index 337e8834..ddb033d 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -334,7 +334,7 @@
                                                                            light,
                                                                            surfaceScale,
                                                                            kd)));
-        return CreateEffectPtr(effect);
+        return CreateEffectRef(effect);
     }
 
     static const char* Name() { return "DiffuseLighting"; }
@@ -367,7 +367,7 @@
                                                                             surfaceScale,
                                                                             ks,
                                                                             shininess)));
-        return CreateEffectPtr(effect);
+        return CreateEffectRef(effect);
     }
     static const char* Name() { return "SpecularLighting"; }
 
diff --git a/src/effects/SkMagnifierImageFilter.cpp b/src/effects/SkMagnifierImageFilter.cpp
index 9b57bdc..e7f266e 100644
--- a/src/effects/SkMagnifierImageFilter.cpp
+++ b/src/effects/SkMagnifierImageFilter.cpp
@@ -40,7 +40,7 @@
                                                                      yZoom,
                                                                      xInset,
                                                                      yInset)));
-        return CreateEffectPtr(effect);
+        return CreateEffectRef(effect);
     }
 
     virtual ~GrMagnifierEffect() {};
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp
index 690cdd8..03b10be 100644
--- a/src/effects/SkMatrixConvolutionImageFilter.cpp
+++ b/src/effects/SkMatrixConvolutionImageFilter.cpp
@@ -263,7 +263,7 @@
                                                                              target,
                                                                              tileMode,
                                                                              convolveAlpha)));
-        return CreateEffectPtr(effect);
+        return CreateEffectRef(effect);
     }
     virtual ~GrMatrixConvolutionEffect();
 
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 7ce76c8..ed30aca 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -245,7 +245,7 @@
 
     static GrEffectRef* Create(GrTexture* tex, Direction dir, int radius, MorphologyType type) {
         SkAutoTUnref<GrEffect> effect(SkNEW_ARGS(GrMorphologyEffect, (tex, dir, radius, type)));
-        return CreateEffectPtr(effect);
+        return CreateEffectRef(effect);
     }
 
     virtual ~GrMorphologyEffect();
diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp
index 7c2b4df..0a922e7 100644
--- a/src/effects/SkTableColorFilter.cpp
+++ b/src/effects/SkTableColorFilter.cpp
@@ -228,7 +228,7 @@
 public:
     static GrEffectRef* Create(GrTexture* texture, unsigned flags) {
         SkAutoTUnref<GrEffect> effect(SkNEW_ARGS(ColorTableEffect, (texture, flags)));
-        return CreateEffectPtr(effect);
+        return CreateEffectRef(effect);
     }
 
     virtual ~ColorTableEffect();
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp
index 8daa5ca..6bb0329 100644
--- a/src/effects/gradients/SkLinearGradient.cpp
+++ b/src/effects/gradients/SkLinearGradient.cpp
@@ -489,7 +489,7 @@
                                const SkMatrix& matrix,
                                SkShader::TileMode tm) {
         SkAutoTUnref<GrEffect> effect(SkNEW_ARGS(GrLinearGradient, (ctx, shader, matrix, tm)));
-        return CreateEffectPtr(effect);
+        return CreateEffectRef(effect);
     }
 
     virtual ~GrLinearGradient() { }
diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp
index dea1322..c380ec1 100644
--- a/src/effects/gradients/SkRadialGradient.cpp
+++ b/src/effects/gradients/SkRadialGradient.cpp
@@ -509,7 +509,7 @@
                                const SkMatrix& matrix,
                                SkShader::TileMode tm) {
         SkAutoTUnref<GrEffect> effect(SkNEW_ARGS(GrRadialGradient, (ctx, shader, matrix, tm)));
-        return CreateEffectPtr(effect);
+        return CreateEffectRef(effect);
     }
 
     virtual ~GrRadialGradient() { }
diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp
index 810c9de..3a1a599 100644
--- a/src/effects/gradients/SkSweepGradient.cpp
+++ b/src/effects/gradients/SkSweepGradient.cpp
@@ -417,7 +417,7 @@
                                const SkSweepGradient& shader,
                                const SkMatrix& matrix) {
         SkAutoTUnref<GrEffect> effect(SkNEW_ARGS(GrSweepGradient, (ctx, shader, matrix)));
-        return CreateEffectPtr(effect);
+        return CreateEffectRef(effect);
     }
     virtual ~GrSweepGradient() { }
 
diff --git a/src/effects/gradients/SkTwoPointConicalGradient.cpp b/src/effects/gradients/SkTwoPointConicalGradient.cpp
index 1552149..0a15424 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient.cpp
@@ -374,7 +374,7 @@
                                const SkMatrix& matrix,
                                SkShader::TileMode tm) {
         SkAutoTUnref<GrEffect> effect(SkNEW_ARGS(GrConical2Gradient, (ctx, shader, matrix, tm)));
-        return CreateEffectPtr(effect);
+        return CreateEffectRef(effect);
     }
 
     virtual ~GrConical2Gradient() { }
diff --git a/src/effects/gradients/SkTwoPointRadialGradient.cpp b/src/effects/gradients/SkTwoPointRadialGradient.cpp
index bfc067f..0f79a2b 100644
--- a/src/effects/gradients/SkTwoPointRadialGradient.cpp
+++ b/src/effects/gradients/SkTwoPointRadialGradient.cpp
@@ -433,7 +433,7 @@
                                const SkMatrix& matrix,
                                SkShader::TileMode tm) {
         SkAutoTUnref<GrEffect> effect(SkNEW_ARGS(GrRadial2Gradient, (ctx, shader, matrix, tm)));
-        return CreateEffectPtr(effect);
+        return CreateEffectRef(effect);
     }
 
     virtual ~GrRadial2Gradient() { }
diff --git a/src/gpu/GrEffect.cpp b/src/gpu/GrEffect.cpp
index 6db44f4..d1ef4b7 100644
--- a/src/gpu/GrEffect.cpp
+++ b/src/gpu/GrEffect.cpp
@@ -64,7 +64,7 @@
 
 GrEffectRef::~GrEffectRef() {
     GrAssert(1 == this->getRefCnt());
-    fEffect->effectPtrDestroyed();
+    fEffect->EffectRefDestroyed();
     fEffect->unref();
 }
 
@@ -79,7 +79,7 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 GrEffect::~GrEffect() {
-    GrAssert(NULL == fEffectPtr);
+    GrAssert(NULL == fEffectRef);
 }
 
 const char* GrEffect::name() const {
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index a547c1a..5e99dad 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -139,7 +139,7 @@
                                               swapRB,
                                               pmConv,
                                               GrEffectUnitTest::TestMatrix(random))));
-    return CreateEffectPtr(effect);
+    return CreateEffectRef(effect);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -219,9 +219,9 @@
                                                                               *pmToUPMRule,
                                                                               SkMatrix::I())));
 
-        SkAutoTUnref<GrEffectRef> pmToUPMEffect1(CreateEffectPtr(pmToUPM1));
-        SkAutoTUnref<GrEffectRef> upmToPMEffect(CreateEffectPtr(upmToPM));
-        SkAutoTUnref<GrEffectRef> pmToUPMEffect2(CreateEffectPtr(pmToUPM2));
+        SkAutoTUnref<GrEffectRef> pmToUPMEffect1(CreateEffectRef(pmToUPM1));
+        SkAutoTUnref<GrEffectRef> upmToPMEffect(CreateEffectRef(upmToPM));
+        SkAutoTUnref<GrEffectRef> pmToUPMEffect2(CreateEffectRef(pmToUPM2));
 
         context->setRenderTarget(readTex->asRenderTarget());
         paint.colorStage(0)->setEffect(pmToUPMEffect1);
@@ -276,7 +276,7 @@
                                                                             swapRedAndBlue,
                                                                             pmConversion,
                                                                             matrix)));
-        stage->setEffect(CreateEffectPtr(effect))->unref();
+        stage->setEffect(CreateEffectRef(effect))->unref();
         return true;
     }
 }
diff --git a/src/gpu/effects/GrConvolutionEffect.h b/src/gpu/effects/GrConvolutionEffect.h
index ff661b2..4f0c9ec 100644
--- a/src/gpu/effects/GrConvolutionEffect.h
+++ b/src/gpu/effects/GrConvolutionEffect.h
@@ -27,7 +27,7 @@
                                                                        dir,
                                                                        halfWidth,
                                                                        kernel)));
-        return CreateEffectPtr(effect);
+        return CreateEffectRef(effect);
     }
 
     /// Convolve with a Gaussian kernel
@@ -39,7 +39,7 @@
                                                                        dir,
                                                                        halfWidth,
                                                                        gaussianSigma)));
-        return CreateEffectPtr(effect);
+        return CreateEffectRef(effect);
     }
 
     virtual ~GrConvolutionEffect();
diff --git a/src/gpu/effects/GrSingleTextureEffect.h b/src/gpu/effects/GrSingleTextureEffect.h
index fad2c21..e475cb5 100644
--- a/src/gpu/effects/GrSingleTextureEffect.h
+++ b/src/gpu/effects/GrSingleTextureEffect.h
@@ -23,18 +23,18 @@
     /* unfiltered, clamp mode */
     static GrEffectRef* Create(GrTexture* tex, const SkMatrix& matrix) {
         SkAutoTUnref<GrEffect> effect(SkNEW_ARGS(GrSingleTextureEffect, (tex, matrix)));
-        return CreateEffectPtr(effect);
+        return CreateEffectRef(effect);
     }
 
     /* clamp mode */
     static GrEffectRef* Create(GrTexture* tex, const SkMatrix& matrix, bool bilerp) {
         SkAutoTUnref<GrEffect> effect(SkNEW_ARGS(GrSingleTextureEffect, (tex, matrix, bilerp)));
-        return CreateEffectPtr(effect);
+        return CreateEffectRef(effect);
     }
 
     static GrEffectRef* Create(GrTexture* tex, const SkMatrix& matrix, const GrTextureParams& p) {
         SkAutoTUnref<GrEffect> effect(SkNEW_ARGS(GrSingleTextureEffect, (tex, matrix, p)));
-        return CreateEffectPtr(effect);
+        return CreateEffectRef(effect);
     }
 
     virtual ~GrSingleTextureEffect();
diff --git a/src/gpu/effects/GrTextureDomainEffect.cpp b/src/gpu/effects/GrTextureDomainEffect.cpp
index 74727a0..f82c62f 100644
--- a/src/gpu/effects/GrTextureDomainEffect.cpp
+++ b/src/gpu/effects/GrTextureDomainEffect.cpp
@@ -148,7 +148,7 @@
                                                                          clippedDomain,
                                                                          wrapMode,
                                                                          bilerp)));
-        return CreateEffectPtr(effect);
+        return CreateEffectRef(effect);
 
     }
 }