diff options
Diffstat (limited to 'src/gpu/effects')
23 files changed, 179 insertions, 187 deletions
diff --git a/src/gpu/effects/GrBezierEffect.cpp b/src/gpu/effects/GrBezierEffect.cpp index 862c1d2c17..0736b5a22b 100644 --- a/src/gpu/effects/GrBezierEffect.cpp +++ b/src/gpu/effects/GrBezierEffect.cpp @@ -143,11 +143,11 @@ bool GrConicEffect::onIsEqual(const GrEffect& other) const { GR_DEFINE_EFFECT_TEST(GrConicEffect); -GrEffectRef* GrConicEffect::TestCreate(SkRandom* random, - GrContext*, - const GrDrawTargetCaps& caps, - GrTexture*[]) { - GrEffectRef* effect; +GrEffect* GrConicEffect::TestCreate(SkRandom* random, + GrContext*, + const GrDrawTargetCaps& caps, + GrTexture*[]) { + GrEffect* effect; do { GrEffectEdgeType edgeType = static_cast<GrEffectEdgeType>( random->nextULessThan(kGrEffectEdgeTypeCnt)); @@ -281,11 +281,11 @@ bool GrQuadEffect::onIsEqual(const GrEffect& other) const { GR_DEFINE_EFFECT_TEST(GrQuadEffect); -GrEffectRef* GrQuadEffect::TestCreate(SkRandom* random, - GrContext*, - const GrDrawTargetCaps& caps, - GrTexture*[]) { - GrEffectRef* effect; +GrEffect* GrQuadEffect::TestCreate(SkRandom* random, + GrContext*, + const GrDrawTargetCaps& caps, + GrTexture*[]) { + GrEffect* effect; do { GrEffectEdgeType edgeType = static_cast<GrEffectEdgeType>( random->nextULessThan(kGrEffectEdgeTypeCnt)); @@ -429,11 +429,11 @@ bool GrCubicEffect::onIsEqual(const GrEffect& other) const { GR_DEFINE_EFFECT_TEST(GrCubicEffect); -GrEffectRef* GrCubicEffect::TestCreate(SkRandom* random, - GrContext*, - const GrDrawTargetCaps& caps, - GrTexture*[]) { - GrEffectRef* effect; +GrEffect* GrCubicEffect::TestCreate(SkRandom* random, + GrContext*, + const GrDrawTargetCaps& caps, + GrTexture*[]) { + GrEffect* effect; do { GrEffectEdgeType edgeType = static_cast<GrEffectEdgeType>( random->nextULessThan(kGrEffectEdgeTypeCnt)); diff --git a/src/gpu/effects/GrBezierEffect.h b/src/gpu/effects/GrBezierEffect.h index e2fc592bdc..b8d8f7b2e4 100644 --- a/src/gpu/effects/GrBezierEffect.h +++ b/src/gpu/effects/GrBezierEffect.h @@ -57,7 +57,7 @@ class GrGLConicEffect; class GrConicEffect : public GrVertexEffect { public: - static GrEffectRef* Create(const GrEffectEdgeType edgeType, const GrDrawTargetCaps& caps) { + static GrEffect* Create(const GrEffectEdgeType edgeType, const GrDrawTargetCaps& caps) { GR_CREATE_STATIC_EFFECT(gConicFillAA, GrConicEffect, (kFillAA_GrEffectEdgeType)); GR_CREATE_STATIC_EFFECT(gConicHairAA, GrConicEffect, (kHairlineAA_GrEffectEdgeType)); GR_CREATE_STATIC_EFFECT(gConicFillBW, GrConicEffect, (kFillBW_GrEffectEdgeType)); @@ -124,7 +124,7 @@ class GrGLQuadEffect; class GrQuadEffect : public GrVertexEffect { public: - static GrEffectRef* Create(const GrEffectEdgeType edgeType, const GrDrawTargetCaps& caps) { + static GrEffect* Create(const GrEffectEdgeType edgeType, const GrDrawTargetCaps& caps) { GR_CREATE_STATIC_EFFECT(gQuadFillAA, GrQuadEffect, (kFillAA_GrEffectEdgeType)); GR_CREATE_STATIC_EFFECT(gQuadHairAA, GrQuadEffect, (kHairlineAA_GrEffectEdgeType)); GR_CREATE_STATIC_EFFECT(gQuadFillBW, GrQuadEffect, (kFillBW_GrEffectEdgeType)); @@ -193,7 +193,7 @@ class GrGLCubicEffect; class GrCubicEffect : public GrVertexEffect { public: - static GrEffectRef* Create(const GrEffectEdgeType edgeType, const GrDrawTargetCaps& caps) { + static GrEffect* Create(const GrEffectEdgeType edgeType, const GrDrawTargetCaps& caps) { GR_CREATE_STATIC_EFFECT(gCubicFillAA, GrCubicEffect, (kFillAA_GrEffectEdgeType)); GR_CREATE_STATIC_EFFECT(gCubicHairAA, GrCubicEffect, (kHairlineAA_GrEffectEdgeType)); GR_CREATE_STATIC_EFFECT(gCubicFillBW, GrCubicEffect, (kFillBW_GrEffectEdgeType)); diff --git a/src/gpu/effects/GrBicubicEffect.cpp b/src/gpu/effects/GrBicubicEffect.cpp index 9c6d1a3f8c..132d2f4a0b 100644 --- a/src/gpu/effects/GrBicubicEffect.cpp +++ b/src/gpu/effects/GrBicubicEffect.cpp @@ -165,10 +165,10 @@ void GrBicubicEffect::getConstantColorComponents(GrColor* color, uint32_t* valid GR_DEFINE_EFFECT_TEST(GrBicubicEffect); -GrEffectRef* GrBicubicEffect::TestCreate(SkRandom* random, - GrContext* context, - const GrDrawTargetCaps&, - GrTexture* textures[]) { +GrEffect* GrBicubicEffect::TestCreate(SkRandom* random, + GrContext* context, + const GrDrawTargetCaps&, + GrTexture* textures[]) { int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : GrEffectUnitTest::kAlphaTextureIdx; SkScalar coefficients[16]; diff --git a/src/gpu/effects/GrBicubicEffect.h b/src/gpu/effects/GrBicubicEffect.h index eea4d4e883..6cfb827415 100644 --- a/src/gpu/effects/GrBicubicEffect.h +++ b/src/gpu/effects/GrBicubicEffect.h @@ -37,8 +37,8 @@ public: /** * Create a simple filter effect with custom bicubic coefficients and optional domain. */ - static GrEffectRef* Create(GrTexture* tex, const SkScalar coefficients[16], - const SkRect* domain = NULL) { + static GrEffect* Create(GrTexture* tex, const SkScalar coefficients[16], + const SkRect* domain = NULL) { if (NULL == domain) { static const SkShader::TileMode kTileModes[] = { SkShader::kClamp_TileMode, SkShader::kClamp_TileMode }; @@ -52,8 +52,8 @@ public: /** * Create a Mitchell filter effect with specified texture matrix and x/y tile modes. */ - static GrEffectRef* Create(GrTexture* tex, const SkMatrix& matrix, - SkShader::TileMode tileModes[2]) { + static GrEffect* Create(GrTexture* tex, const SkMatrix& matrix, + SkShader::TileMode tileModes[2]) { return Create(tex, gMitchellCoefficients, matrix, tileModes); } @@ -61,15 +61,15 @@ public: * Create a filter effect with custom bicubic coefficients, the texture matrix, and the x/y * tilemodes. */ - static GrEffectRef* Create(GrTexture* tex, const SkScalar coefficients[16], - const SkMatrix& matrix, const SkShader::TileMode tileModes[2]) { + static GrEffect* Create(GrTexture* tex, const SkScalar coefficients[16], + const SkMatrix& matrix, const SkShader::TileMode tileModes[2]) { return SkNEW_ARGS(GrBicubicEffect, (tex, coefficients, matrix, tileModes)); } /** * Create a Mitchell filter effect with a texture matrix and a domain. */ - static GrEffectRef* Create(GrTexture* tex, const SkMatrix& matrix, const SkRect& domain) { + static GrEffect* Create(GrTexture* tex, const SkMatrix& matrix, const SkRect& domain) { return SkNEW_ARGS(GrBicubicEffect, (tex, gMitchellCoefficients, matrix, domain)); } diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp index 260008c1e5..ff18ef266d 100644 --- a/src/gpu/effects/GrConfigConversionEffect.cpp +++ b/src/gpu/effects/GrConfigConversionEffect.cpp @@ -118,10 +118,10 @@ void GrConfigConversionEffect::getConstantColorComponents(GrColor* color, GR_DEFINE_EFFECT_TEST(GrConfigConversionEffect); -GrEffectRef* GrConfigConversionEffect::TestCreate(SkRandom* random, - GrContext*, - const GrDrawTargetCaps&, - GrTexture* textures[]) { +GrEffect* GrConfigConversionEffect::TestCreate(SkRandom* random, + GrContext*, + const GrDrawTargetCaps&, + GrTexture* textures[]) { PMConversion pmConv = static_cast<PMConversion>(random->nextULessThan(kPMConversionCnt)); bool swapRB; if (kNone_PMConversion == pmConv) { @@ -247,10 +247,10 @@ void GrConfigConversionEffect::TestForPreservingPMConversions(GrContext* context } } -const GrEffectRef* GrConfigConversionEffect::Create(GrTexture* texture, - bool swapRedAndBlue, - PMConversion pmConversion, - const SkMatrix& matrix) { +const GrEffect* GrConfigConversionEffect::Create(GrTexture* texture, + bool swapRedAndBlue, + PMConversion pmConversion, + const SkMatrix& matrix) { if (!swapRedAndBlue && kNone_PMConversion == pmConversion) { // If we returned a GrConfigConversionEffect that was equivalent to a GrSimpleTextureEffect // then we may pollute our texture cache with redundant shaders. So in the case that no diff --git a/src/gpu/effects/GrConfigConversionEffect.h b/src/gpu/effects/GrConfigConversionEffect.h index 169c3d7db8..4416d05452 100644 --- a/src/gpu/effects/GrConfigConversionEffect.h +++ b/src/gpu/effects/GrConfigConversionEffect.h @@ -35,10 +35,10 @@ public: }; // Installs an effect in the GrEffectStage to perform a config conversion. - static const GrEffectRef* Create(GrTexture*, - bool swapRedAndBlue, - PMConversion pmConversion, - const SkMatrix& matrix); + static const GrEffect* Create(GrTexture*, + bool swapRedAndBlue, + PMConversion pmConversion, + const SkMatrix& matrix); static const char* Name() { return "Config Conversion"; } typedef GrGLConfigConversionEffect GLEffect; diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp index aebd5b0b89..49521ca13b 100644 --- a/src/gpu/effects/GrConvexPolyEffect.cpp +++ b/src/gpu/effects/GrConvexPolyEffect.cpp @@ -24,7 +24,7 @@ public: static const char* Name() { return "AARect"; } - static GrEffectRef* Create(GrEffectEdgeType edgeType, const SkRect& rect) { + static GrEffect* Create(GrEffectEdgeType edgeType, const SkRect& rect) { return SkNEW_ARGS(AARectEffect, (edgeType, rect)); } @@ -64,15 +64,15 @@ private: GR_DEFINE_EFFECT_TEST(AARectEffect); -GrEffectRef* AARectEffect::TestCreate(SkRandom* random, - GrContext*, - const GrDrawTargetCaps& caps, - GrTexture*[]) { +GrEffect* AARectEffect::TestCreate(SkRandom* random, + GrContext*, + const GrDrawTargetCaps& caps, + GrTexture*[]) { SkRect rect = SkRect::MakeLTRB(random->nextSScalar1(), random->nextSScalar1(), random->nextSScalar1(), random->nextSScalar1()); - GrEffectRef* effect; + GrEffect* effect; do { GrEffectEdgeType edgeType = static_cast<GrEffectEdgeType>(random->nextULessThan( kGrEffectEdgeTypeCnt)); @@ -262,7 +262,8 @@ GrGLEffect::EffectKey GrGLConvexPolyEffect::GenKey(const GrDrawEffect& drawEffec ////////////////////////////////////////////////////////////////////////////// -GrEffectRef* GrConvexPolyEffect::Create(GrEffectEdgeType type, const SkPath& path, const SkVector* offset) { +GrEffect* GrConvexPolyEffect::Create(GrEffectEdgeType type, const SkPath& path, + const SkVector* offset) { if (kHairlineAA_GrEffectEdgeType == type) { return NULL; } @@ -312,7 +313,7 @@ GrEffectRef* GrConvexPolyEffect::Create(GrEffectEdgeType type, const SkPath& pat return Create(type, n, edges); } -GrEffectRef* GrConvexPolyEffect::Create(GrEffectEdgeType edgeType, const SkRect& rect) { +GrEffect* GrConvexPolyEffect::Create(GrEffectEdgeType edgeType, const SkRect& rect) { if (kHairlineAA_GrEffectEdgeType == edgeType){ return NULL; } @@ -354,17 +355,17 @@ bool GrConvexPolyEffect::onIsEqual(const GrEffect& other) const { GR_DEFINE_EFFECT_TEST(GrConvexPolyEffect); -GrEffectRef* GrConvexPolyEffect::TestCreate(SkRandom* random, - GrContext*, - const GrDrawTargetCaps& caps, - GrTexture*[]) { +GrEffect* GrConvexPolyEffect::TestCreate(SkRandom* random, + GrContext*, + const GrDrawTargetCaps& caps, + GrTexture*[]) { int count = random->nextULessThan(kMaxEdges) + 1; SkScalar edges[kMaxEdges * 3]; for (int i = 0; i < 3 * count; ++i) { edges[i] = random->nextSScalar1(); } - GrEffectRef* effect; + GrEffect* effect; do { GrEffectEdgeType edgeType = static_cast<GrEffectEdgeType>( random->nextULessThan(kGrEffectEdgeTypeCnt)); diff --git a/src/gpu/effects/GrConvexPolyEffect.h b/src/gpu/effects/GrConvexPolyEffect.h index 1a00f12d8a..9164b3ecf2 100644 --- a/src/gpu/effects/GrConvexPolyEffect.h +++ b/src/gpu/effects/GrConvexPolyEffect.h @@ -37,7 +37,7 @@ public: * have to modify the effect/shaderbuilder interface to make it possible (e.g. give access * to the view matrix or untransformed positions in the fragment shader). */ - static GrEffectRef* Create(GrEffectEdgeType edgeType, int n, const SkScalar edges[]) { + static GrEffect* Create(GrEffectEdgeType edgeType, int n, const SkScalar edges[]) { if (n <= 0 || n > kMaxEdges || kHairlineAA_GrEffectEdgeType == edgeType) { return NULL; } @@ -49,12 +49,12 @@ public: * inverse filled, or has too many edges, this will return NULL. If offset is non-NULL, then * the path is translated by the vector. */ - static GrEffectRef* Create(GrEffectEdgeType, const SkPath&, const SkVector* offset = NULL); + static GrEffect* Create(GrEffectEdgeType, const SkPath&, const SkVector* offset = NULL); /** * Creates an effect that fills inside the rect with AA edges.. */ - static GrEffectRef* Create(GrEffectEdgeType, const SkRect&); + static GrEffect* Create(GrEffectEdgeType, const SkRect&); virtual ~GrConvexPolyEffect(); diff --git a/src/gpu/effects/GrConvolutionEffect.cpp b/src/gpu/effects/GrConvolutionEffect.cpp index aad7c878c9..14ba4d7116 100644 --- a/src/gpu/effects/GrConvolutionEffect.cpp +++ b/src/gpu/effects/GrConvolutionEffect.cpp @@ -211,10 +211,10 @@ bool GrConvolutionEffect::onIsEqual(const GrEffect& sBase) const { GR_DEFINE_EFFECT_TEST(GrConvolutionEffect); -GrEffectRef* GrConvolutionEffect::TestCreate(SkRandom* random, - GrContext*, - const GrDrawTargetCaps&, - GrTexture* textures[]) { +GrEffect* GrConvolutionEffect::TestCreate(SkRandom* random, + GrContext*, + const GrDrawTargetCaps&, + GrTexture* textures[]) { int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : GrEffectUnitTest::kAlphaTextureIdx; Direction dir = random->nextBool() ? kX_Direction : kY_Direction; diff --git a/src/gpu/effects/GrConvolutionEffect.h b/src/gpu/effects/GrConvolutionEffect.h index 77c2d347c6..a96ea7be86 100644 --- a/src/gpu/effects/GrConvolutionEffect.h +++ b/src/gpu/effects/GrConvolutionEffect.h @@ -22,12 +22,12 @@ class GrConvolutionEffect : public Gr1DKernelEffect { public: /// Convolve with an arbitrary user-specified kernel - static GrEffectRef* Create(GrTexture* tex, - Direction dir, - int halfWidth, - const float* kernel, - bool useBounds, - float bounds[2]) { + static GrEffect* Create(GrTexture* tex, + Direction dir, + int halfWidth, + const float* kernel, + bool useBounds, + float bounds[2]) { return SkNEW_ARGS(GrConvolutionEffect, (tex, dir, halfWidth, @@ -37,12 +37,12 @@ public: } /// Convolve with a Gaussian kernel - static GrEffectRef* CreateGaussian(GrTexture* tex, - Direction dir, - int halfWidth, - float gaussianSigma, - bool useBounds, - float bounds[2]) { + static GrEffect* CreateGaussian(GrTexture* tex, + Direction dir, + int halfWidth, + float gaussianSigma, + bool useBounds, + float bounds[2]) { return SkNEW_ARGS(GrConvolutionEffect, (tex, dir, halfWidth, diff --git a/src/gpu/effects/GrCustomCoordsTextureEffect.cpp b/src/gpu/effects/GrCustomCoordsTextureEffect.cpp index f85a927aba..62326b91bc 100644 --- a/src/gpu/effects/GrCustomCoordsTextureEffect.cpp +++ b/src/gpu/effects/GrCustomCoordsTextureEffect.cpp @@ -84,10 +84,10 @@ const GrBackendEffectFactory& GrCustomCoordsTextureEffect::getFactory() const { GR_DEFINE_EFFECT_TEST(GrCustomCoordsTextureEffect); -GrEffectRef* GrCustomCoordsTextureEffect::TestCreate(SkRandom* random, - GrContext*, - const GrDrawTargetCaps&, - GrTexture* textures[]) { +GrEffect* GrCustomCoordsTextureEffect::TestCreate(SkRandom* random, + GrContext*, + const GrDrawTargetCaps&, + GrTexture* textures[]) { int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : GrEffectUnitTest::kAlphaTextureIdx; static const SkShader::TileMode kTileModes[] = { diff --git a/src/gpu/effects/GrCustomCoordsTextureEffect.h b/src/gpu/effects/GrCustomCoordsTextureEffect.h index 5dc830aed1..95e0fbba14 100644 --- a/src/gpu/effects/GrCustomCoordsTextureEffect.h +++ b/src/gpu/effects/GrCustomCoordsTextureEffect.h @@ -20,7 +20,7 @@ class GrGLCustomCoordsTextureEffect; */ class GrCustomCoordsTextureEffect : public GrVertexEffect { public: - static GrEffectRef* Create(GrTexture* tex, const GrTextureParams& p) { + static GrEffect* Create(GrTexture* tex, const GrTextureParams& p) { return SkNEW_ARGS(GrCustomCoordsTextureEffect, (tex, p)); } diff --git a/src/gpu/effects/GrDashingEffect.cpp b/src/gpu/effects/GrDashingEffect.cpp index fb58b84bc3..723f59d4f4 100644 --- a/src/gpu/effects/GrDashingEffect.cpp +++ b/src/gpu/effects/GrDashingEffect.cpp @@ -426,8 +426,7 @@ class DashingCircleEffect : public GrVertexEffect { public: typedef SkPathEffect::DashInfo DashInfo; - static GrEffectRef* Create(GrEffectEdgeType edgeType, const DashInfo& info, - SkScalar radius); + static GrEffect* Create(GrEffectEdgeType edgeType, const DashInfo& info, SkScalar radius); virtual ~DashingCircleEffect(); @@ -557,8 +556,8 @@ GrGLEffect::EffectKey GLDashingCircleEffect::GenKey(const GrDrawEffect& drawEffe ////////////////////////////////////////////////////////////////////////////// -GrEffectRef* DashingCircleEffect::Create(GrEffectEdgeType edgeType, const DashInfo& info, - SkScalar radius) { +GrEffect* DashingCircleEffect::Create(GrEffectEdgeType edgeType, const DashInfo& info, + SkScalar radius) { if (info.fCount != 2 || info.fIntervals[0] != 0) { return NULL; } @@ -598,11 +597,11 @@ bool DashingCircleEffect::onIsEqual(const GrEffect& other) const { GR_DEFINE_EFFECT_TEST(DashingCircleEffect); -GrEffectRef* DashingCircleEffect::TestCreate(SkRandom* random, - GrContext*, - const GrDrawTargetCaps& caps, - GrTexture*[]) { - GrEffectRef* effect; +GrEffect* DashingCircleEffect::TestCreate(SkRandom* random, + GrContext*, + const GrDrawTargetCaps& caps, + GrTexture*[]) { + GrEffect* effect; GrEffectEdgeType edgeType = static_cast<GrEffectEdgeType>(random->nextULessThan( kGrEffectEdgeTypeCnt)); SkScalar strokeWidth = random->nextRangeScalar(0, 100.f); @@ -635,8 +634,7 @@ class DashingLineEffect : public GrVertexEffect { public: typedef SkPathEffect::DashInfo DashInfo; - static GrEffectRef* Create(GrEffectEdgeType edgeType, const DashInfo& info, - SkScalar strokeWidth); + static GrEffect* Create(GrEffectEdgeType edgeType, const DashInfo& info, SkScalar strokeWidth); virtual ~DashingLineEffect(); @@ -775,8 +773,8 @@ GrGLEffect::EffectKey GLDashingLineEffect::GenKey(const GrDrawEffect& drawEffect ////////////////////////////////////////////////////////////////////////////// -GrEffectRef* DashingLineEffect::Create(GrEffectEdgeType edgeType, const DashInfo& info, - SkScalar strokeWidth) { +GrEffect* DashingLineEffect::Create(GrEffectEdgeType edgeType, const DashInfo& info, + SkScalar strokeWidth) { if (info.fCount != 2) { return NULL; } @@ -816,11 +814,11 @@ bool DashingLineEffect::onIsEqual(const GrEffect& other) const { GR_DEFINE_EFFECT_TEST(DashingLineEffect); -GrEffectRef* DashingLineEffect::TestCreate(SkRandom* random, - GrContext*, - const GrDrawTargetCaps& caps, - GrTexture*[]) { - GrEffectRef* effect; +GrEffect* DashingLineEffect::TestCreate(SkRandom* random, + GrContext*, + const GrDrawTargetCaps& caps, + GrTexture*[]) { + GrEffect* effect; GrEffectEdgeType edgeType = static_cast<GrEffectEdgeType>(random->nextULessThan( kGrEffectEdgeTypeCnt)); SkScalar strokeWidth = random->nextRangeScalar(0, 100.f); @@ -838,8 +836,8 @@ GrEffectRef* DashingLineEffect::TestCreate(SkRandom* random, ////////////////////////////////////////////////////////////////////////////// -GrEffectRef* GrDashingEffect::Create(GrEffectEdgeType edgeType, const SkPathEffect::DashInfo& info, - SkScalar strokeWidth, GrDashingEffect::DashCap cap) { +GrEffect* GrDashingEffect::Create(GrEffectEdgeType edgeType, const SkPathEffect::DashInfo& info, + SkScalar strokeWidth, GrDashingEffect::DashCap cap) { switch (cap) { case GrDashingEffect::kRound_DashCap: return DashingCircleEffect::Create(edgeType, info, SkScalarHalf(strokeWidth)); diff --git a/src/gpu/effects/GrDistanceFieldTextureEffect.cpp b/src/gpu/effects/GrDistanceFieldTextureEffect.cpp index 9305ba98f0..5ae012900f 100755 --- a/src/gpu/effects/GrDistanceFieldTextureEffect.cpp +++ b/src/gpu/effects/GrDistanceFieldTextureEffect.cpp @@ -209,10 +209,10 @@ const GrBackendEffectFactory& GrDistanceFieldTextureEffect::getFactory() const { GR_DEFINE_EFFECT_TEST(GrDistanceFieldTextureEffect); -GrEffectRef* GrDistanceFieldTextureEffect::TestCreate(SkRandom* random, - GrContext*, - const GrDrawTargetCaps&, - GrTexture* textures[]) { +GrEffect* GrDistanceFieldTextureEffect::TestCreate(SkRandom* random, + GrContext*, + const GrDrawTargetCaps&, + GrTexture* textures[]) { int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : GrEffectUnitTest::kAlphaTextureIdx; #ifdef SK_GAMMA_APPLY_TO_A8 @@ -468,10 +468,10 @@ const GrBackendEffectFactory& GrDistanceFieldLCDTextureEffect::getFactory() cons GR_DEFINE_EFFECT_TEST(GrDistanceFieldLCDTextureEffect); -GrEffectRef* GrDistanceFieldLCDTextureEffect::TestCreate(SkRandom* random, - GrContext*, - const GrDrawTargetCaps&, - GrTexture* textures[]) { +GrEffect* GrDistanceFieldLCDTextureEffect::TestCreate(SkRandom* random, + GrContext*, + const GrDrawTargetCaps&, + GrTexture* textures[]) { int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : GrEffectUnitTest::kAlphaTextureIdx; int texIdx2 = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : diff --git a/src/gpu/effects/GrDistanceFieldTextureEffect.h b/src/gpu/effects/GrDistanceFieldTextureEffect.h index b2e21b2895..38e41e5590 100644 --- a/src/gpu/effects/GrDistanceFieldTextureEffect.h +++ b/src/gpu/effects/GrDistanceFieldTextureEffect.h @@ -23,15 +23,15 @@ class GrGLDistanceFieldLCDTextureEffect; class GrDistanceFieldTextureEffect : public GrVertexEffect { public: #ifdef SK_GAMMA_APPLY_TO_A8 - static GrEffectRef* Create(GrTexture* tex, const GrTextureParams& params, - GrTexture* gamma, const GrTextureParams& gammaParams, float lum, - bool similarity) { + static GrEffect* Create(GrTexture* tex, const GrTextureParams& params, + GrTexture* gamma, const GrTextureParams& gammaParams, float lum, + bool similarity) { return SkNEW_ARGS(GrDistanceFieldTextureEffect, (tex, params, gamma, gammaParams, lum, similarity)); } #else - static GrEffectRef* Create(GrTexture* tex, const GrTextureParams& params, - bool similarity) { + static GrEffect* Create(GrTexture* tex, const GrTextureParams& params, + bool similarity) { return SkNEW_ARGS(GrDistanceFieldTextureEffect, (tex, params, similarity)); } #endif @@ -79,10 +79,9 @@ private: */ class GrDistanceFieldLCDTextureEffect : public GrVertexEffect { public: - static GrEffectRef* Create(GrTexture* tex, const GrTextureParams& params, - GrTexture* gamma, const GrTextureParams& gammaParams, - SkColor textColor, - bool uniformScale, bool useBGR) { + static GrEffect* Create(GrTexture* tex, const GrTextureParams& params, + GrTexture* gamma, const GrTextureParams& gammaParams, + SkColor textColor, bool uniformScale, bool useBGR) { return SkNEW_ARGS(GrDistanceFieldLCDTextureEffect, (tex, params, gamma, gammaParams, textColor, uniformScale, useBGR)); } diff --git a/src/gpu/effects/GrDitherEffect.cpp b/src/gpu/effects/GrDitherEffect.cpp index 1db61ba146..fc37d1afe4 100644 --- a/src/gpu/effects/GrDitherEffect.cpp +++ b/src/gpu/effects/GrDitherEffect.cpp @@ -19,7 +19,7 @@ class GLDitherEffect; class DitherEffect : public GrEffect { public: - static GrEffectRef* Create() { + static GrEffect* Create() { GR_CREATE_STATIC_EFFECT(gDitherEffect, DitherEffect, ()) return SkRef(gDitherEffect); } @@ -56,10 +56,10 @@ void DitherEffect::getConstantColorComponents(GrColor* color, uint32_t* validFla GR_DEFINE_EFFECT_TEST(DitherEffect); -GrEffectRef* DitherEffect::TestCreate(SkRandom*, - GrContext*, - const GrDrawTargetCaps&, - GrTexture*[]) { +GrEffect* DitherEffect::TestCreate(SkRandom*, + GrContext*, + const GrDrawTargetCaps&, + GrTexture*[]) { return DitherEffect::Create(); } @@ -111,6 +111,4 @@ void GLDitherEffect::emitCode(GrGLShaderBuilder* builder, ////////////////////////////////////////////////////////////////////////////// -GrEffectRef* GrDitherEffect::Create() { - return DitherEffect::Create(); -} +GrEffect* GrDitherEffect::Create() { return DitherEffect::Create(); } diff --git a/src/gpu/effects/GrOvalEffect.cpp b/src/gpu/effects/GrOvalEffect.cpp index 678abd0c38..ddda4b902a 100644 --- a/src/gpu/effects/GrOvalEffect.cpp +++ b/src/gpu/effects/GrOvalEffect.cpp @@ -19,7 +19,7 @@ class GLCircleEffect; class CircleEffect : public GrEffect { public: - static GrEffectRef* Create(GrEffectEdgeType, const SkPoint& center, SkScalar radius); + static GrEffect* Create(GrEffectEdgeType, const SkPoint& center, SkScalar radius); virtual ~CircleEffect() {}; static const char* Name() { return "Circle"; } @@ -49,9 +49,7 @@ private: typedef GrEffect INHERITED; }; -GrEffectRef* CircleEffect::Create(GrEffectEdgeType edgeType, - const SkPoint& center, - SkScalar radius) { +GrEffect* CircleEffect::Create(GrEffectEdgeType edgeType, const SkPoint& center, SkScalar radius) { SkASSERT(radius >= 0); return SkNEW_ARGS(CircleEffect, (edgeType, center, radius)); } @@ -80,10 +78,10 @@ bool CircleEffect::onIsEqual(const GrEffect& other) const { GR_DEFINE_EFFECT_TEST(CircleEffect); -GrEffectRef* CircleEffect::TestCreate(SkRandom* random, - GrContext*, - const GrDrawTargetCaps& caps, - GrTexture*[]) { +GrEffect* CircleEffect::TestCreate(SkRandom* random, + GrContext*, + const GrDrawTargetCaps& caps, + GrTexture*[]) { SkPoint center; center.fX = random->nextRangeScalar(0.f, 1000.f); center.fY = random->nextRangeScalar(0.f, 1000.f); @@ -189,7 +187,7 @@ class GLEllipseEffect; class EllipseEffect : public GrEffect { public: - static GrEffectRef* Create(GrEffectEdgeType, const SkPoint& center, SkScalar rx, SkScalar ry); + static GrEffect* Create(GrEffectEdgeType, const SkPoint& center, SkScalar rx, SkScalar ry); virtual ~EllipseEffect() {}; static const char* Name() { return "Ellipse"; } @@ -219,10 +217,10 @@ private: typedef GrEffect INHERITED; }; -GrEffectRef* EllipseEffect::Create(GrEffectEdgeType edgeType, - const SkPoint& center, - SkScalar rx, - SkScalar ry) { +GrEffect* EllipseEffect::Create(GrEffectEdgeType edgeType, + const SkPoint& center, + SkScalar rx, + SkScalar ry) { SkASSERT(rx >= 0 && ry >= 0); return SkNEW_ARGS(EllipseEffect, (edgeType, center, rx, ry)); } @@ -251,10 +249,10 @@ bool EllipseEffect::onIsEqual(const GrEffect& other) const { GR_DEFINE_EFFECT_TEST(EllipseEffect); -GrEffectRef* EllipseEffect::TestCreate(SkRandom* random, - GrContext*, - const GrDrawTargetCaps& caps, - GrTexture*[]) { +GrEffect* EllipseEffect::TestCreate(SkRandom* random, + GrContext*, + const GrDrawTargetCaps& caps, + GrTexture*[]) { SkPoint center; center.fX = random->nextRangeScalar(0.f, 1000.f); center.fY = random->nextRangeScalar(0.f, 1000.f); @@ -366,7 +364,7 @@ void GLEllipseEffect::setData(const GrGLUniformManager& uman, const GrDrawEffect ////////////////////////////////////////////////////////////////////////////// -GrEffectRef* GrOvalEffect::Create(GrEffectEdgeType edgeType, const SkRect& oval) { +GrEffect* GrOvalEffect::Create(GrEffectEdgeType edgeType, const SkRect& oval) { if (kHairlineAA_GrEffectEdgeType == edgeType) { return NULL; } diff --git a/src/gpu/effects/GrRRectEffect.cpp b/src/gpu/effects/GrRRectEffect.cpp index 33291ed5b3..d39ab0d4b0 100644 --- a/src/gpu/effects/GrRRectEffect.cpp +++ b/src/gpu/effects/GrRRectEffect.cpp @@ -44,7 +44,7 @@ public: // The flags are used to indicate which corners are circluar (unflagged corners are assumed to // be square). - static GrEffectRef* Create(GrEffectEdgeType, uint32_t circularCornerFlags, const SkRRect&); + static GrEffect* Create(GrEffectEdgeType, uint32_t circularCornerFlags, const SkRRect&); virtual ~CircularRRectEffect() {}; static const char* Name() { return "CircularRRect"; } @@ -75,9 +75,9 @@ private: typedef GrEffect INHERITED; }; -GrEffectRef* CircularRRectEffect::Create(GrEffectEdgeType edgeType, - uint32_t circularCornerFlags, - const SkRRect& rrect) { +GrEffect* CircularRRectEffect::Create(GrEffectEdgeType edgeType, + uint32_t circularCornerFlags, + const SkRRect& rrect) { if (kFillAA_GrEffectEdgeType != edgeType && kInverseFillAA_GrEffectEdgeType != edgeType) { return NULL; } @@ -110,16 +110,16 @@ bool CircularRRectEffect::onIsEqual(const GrEffect& other) const { GR_DEFINE_EFFECT_TEST(CircularRRectEffect); -GrEffectRef* CircularRRectEffect::TestCreate(SkRandom* random, - GrContext*, - const GrDrawTargetCaps& caps, - GrTexture*[]) { +GrEffect* CircularRRectEffect::TestCreate(SkRandom* random, + GrContext*, + const GrDrawTargetCaps& caps, + GrTexture*[]) { SkScalar w = random->nextRangeScalar(20.f, 1000.f); SkScalar h = random->nextRangeScalar(20.f, 1000.f); SkScalar r = random->nextRangeF(kRadiusMin, 9.f); SkRRect rrect; rrect.setRectXY(SkRect::MakeWH(w, h), r, r); - GrEffectRef* effect; + GrEffect* effect; do { GrEffectEdgeType et = (GrEffectEdgeType)random->nextULessThan(kGrEffectEdgeTypeCnt); effect = GrRRectEffect::Create(et, rrect); @@ -382,7 +382,7 @@ class GLEllipticalRRectEffect; class EllipticalRRectEffect : public GrEffect { public: - static GrEffectRef* Create(GrEffectEdgeType, const SkRRect&); + static GrEffect* Create(GrEffectEdgeType, const SkRRect&); virtual ~EllipticalRRectEffect() {}; static const char* Name() { return "EllipticalRRect"; } @@ -411,7 +411,7 @@ private: typedef GrEffect INHERITED; }; -GrEffectRef* EllipticalRRectEffect::Create(GrEffectEdgeType edgeType, const SkRRect& rrect) { +GrEffect* EllipticalRRectEffect::Create(GrEffectEdgeType edgeType, const SkRRect& rrect) { if (kFillAA_GrEffectEdgeType != edgeType && kInverseFillAA_GrEffectEdgeType != edgeType) { return NULL; } @@ -441,10 +441,10 @@ bool EllipticalRRectEffect::onIsEqual(const GrEffect& other) const { GR_DEFINE_EFFECT_TEST(EllipticalRRectEffect); -GrEffectRef* EllipticalRRectEffect::TestCreate(SkRandom* random, - GrContext*, - const GrDrawTargetCaps& caps, - GrTexture*[]) { +GrEffect* EllipticalRRectEffect::TestCreate(SkRandom* random, + GrContext*, + const GrDrawTargetCaps& caps, + GrTexture*[]) { SkScalar w = random->nextRangeScalar(20.f, 1000.f); SkScalar h = random->nextRangeScalar(20.f, 1000.f); SkVector r[4]; @@ -471,7 +471,7 @@ GrEffectRef* EllipticalRRectEffect::TestCreate(SkRandom* random, rrect.setRectXY(SkRect::MakeWH(w, h), r[SkRRect::kUpperLeft_Corner].fX, r[SkRRect::kUpperLeft_Corner].fY); } - GrEffectRef* effect; + GrEffect* effect; do { GrEffectEdgeType et = (GrEffectEdgeType)random->nextULessThan(kGrEffectEdgeTypeCnt); effect = GrRRectEffect::Create(et, rrect); @@ -631,7 +631,7 @@ void GLEllipticalRRectEffect::setData(const GrGLUniformManager& uman, ////////////////////////////////////////////////////////////////////////////// -GrEffectRef* GrRRectEffect::Create(GrEffectEdgeType edgeType, const SkRRect& rrect) { +GrEffect* GrRRectEffect::Create(GrEffectEdgeType edgeType, const SkRRect& rrect) { if (rrect.isRect()) { return GrConvexPolyEffect::Create(edgeType, rrect.getBounds()); } diff --git a/src/gpu/effects/GrSimpleTextureEffect.cpp b/src/gpu/effects/GrSimpleTextureEffect.cpp index 841561baa9..b5ad38600b 100644 --- a/src/gpu/effects/GrSimpleTextureEffect.cpp +++ b/src/gpu/effects/GrSimpleTextureEffect.cpp @@ -51,10 +51,10 @@ const GrBackendEffectFactory& GrSimpleTextureEffect::getFactory() const { GR_DEFINE_EFFECT_TEST(GrSimpleTextureEffect); -GrEffectRef* GrSimpleTextureEffect::TestCreate(SkRandom* random, - GrContext*, - const GrDrawTargetCaps&, - GrTexture* textures[]) { +GrEffect* GrSimpleTextureEffect::TestCreate(SkRandom* random, + GrContext*, + const GrDrawTargetCaps&, + GrTexture* textures[]) { int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : GrEffectUnitTest::kAlphaTextureIdx; static const SkShader::TileMode kTileModes[] = { diff --git a/src/gpu/effects/GrSimpleTextureEffect.h b/src/gpu/effects/GrSimpleTextureEffect.h index fea18e5eeb..49e3d7a843 100644 --- a/src/gpu/effects/GrSimpleTextureEffect.h +++ b/src/gpu/effects/GrSimpleTextureEffect.h @@ -23,25 +23,25 @@ class GrGLSimpleTextureEffect; class GrSimpleTextureEffect : public GrSingleTextureEffect { public: /* unfiltered, clamp mode */ - static GrEffectRef* Create(GrTexture* tex, - const SkMatrix& matrix, - GrCoordSet coordSet = kLocal_GrCoordSet) { + static GrEffect* Create(GrTexture* tex, + const SkMatrix& matrix, + GrCoordSet coordSet = kLocal_GrCoordSet) { return SkNEW_ARGS(GrSimpleTextureEffect, (tex, matrix, GrTextureParams::kNone_FilterMode, coordSet)); } /* clamp mode */ - static GrEffectRef* Create(GrTexture* tex, - const SkMatrix& matrix, - GrTextureParams::FilterMode filterMode, - GrCoordSet coordSet = kLocal_GrCoordSet) { + static GrEffect* Create(GrTexture* tex, + const SkMatrix& matrix, + GrTextureParams::FilterMode filterMode, + GrCoordSet coordSet = kLocal_GrCoordSet) { return SkNEW_ARGS(GrSimpleTextureEffect, (tex, matrix, filterMode, coordSet)); } - static GrEffectRef* Create(GrTexture* tex, - const SkMatrix& matrix, - const GrTextureParams& p, - GrCoordSet coordSet = kLocal_GrCoordSet) { + static GrEffect* Create(GrTexture* tex, + const SkMatrix& matrix, + const GrTextureParams& p, + GrCoordSet coordSet = kLocal_GrCoordSet) { return SkNEW_ARGS(GrSimpleTextureEffect, (tex, matrix, p, coordSet)); } diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp index cb2ad5f5da..f12fec5a7b 100644 --- a/src/gpu/effects/GrTextureDomain.cpp +++ b/src/gpu/effects/GrTextureDomain.cpp @@ -196,7 +196,7 @@ GrGLEffect::EffectKey GrGLTextureDomainEffect::GenKey(const GrDrawEffect& drawEf /////////////////////////////////////////////////////////////////////////////// -GrEffectRef* GrTextureDomainEffect::Create(GrTexture* texture, +GrEffect* GrTextureDomainEffect::Create(GrTexture* texture, const SkMatrix& matrix, const SkRect& domain, GrTextureDomain::Mode mode, @@ -253,10 +253,10 @@ void GrTextureDomainEffect::getConstantColorComponents(GrColor* color, uint32_t* GR_DEFINE_EFFECT_TEST(GrTextureDomainEffect); -GrEffectRef* GrTextureDomainEffect::TestCreate(SkRandom* random, - GrContext*, - const GrDrawTargetCaps&, - GrTexture* textures[]) { +GrEffect* GrTextureDomainEffect::TestCreate(SkRandom* random, + GrContext*, + const GrDrawTargetCaps&, + GrTexture* textures[]) { int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx : GrEffectUnitTest::kAlphaTextureIdx; SkRect domain; diff --git a/src/gpu/effects/GrTextureDomain.h b/src/gpu/effects/GrTextureDomain.h index b4c0b297f1..dc781870ce 100644 --- a/src/gpu/effects/GrTextureDomain.h +++ b/src/gpu/effects/GrTextureDomain.h @@ -136,12 +136,12 @@ class GrGLTextureDomainEffect; class GrTextureDomainEffect : public GrSingleTextureEffect { public: - static GrEffectRef* Create(GrTexture*, - const SkMatrix&, - const SkRect& domain, - GrTextureDomain::Mode, - GrTextureParams::FilterMode filterMode, - GrCoordSet = kLocal_GrCoordSet); + static GrEffect* Create(GrTexture*, + const SkMatrix&, + const SkRect& domain, + GrTextureDomain::Mode, + GrTextureParams::FilterMode filterMode, + GrCoordSet = kLocal_GrCoordSet); virtual ~GrTextureDomainEffect(); diff --git a/src/gpu/effects/GrYUVtoRGBEffect.cpp b/src/gpu/effects/GrYUVtoRGBEffect.cpp index 539b4ac186..01ff6d6583 100644 --- a/src/gpu/effects/GrYUVtoRGBEffect.cpp +++ b/src/gpu/effects/GrYUVtoRGBEffect.cpp @@ -100,8 +100,6 @@ private: ////////////////////////////////////////////////////////////////////////////// -GrEffectRef* GrYUVtoRGBEffect::Create(GrTexture* yTexture, - GrTexture* uTexture, - GrTexture* vTexture) { +GrEffect* GrYUVtoRGBEffect::Create(GrTexture* yTexture, GrTexture* uTexture, GrTexture* vTexture) { return YUVtoRGBEffect::Create(yTexture, uTexture, vTexture); } |