aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/SkBitmapProcShader.cpp17
-rw-r--r--src/core/SkImageFilter.cpp2
-rw-r--r--src/core/SkPictureShader.cpp10
-rw-r--r--src/core/SkShader.cpp16
-rw-r--r--src/core/SkXfermode.cpp13
-rw-r--r--src/effects/SkAlphaThresholdFilter.cpp16
-rw-r--r--src/effects/SkArithmeticMode.cpp14
-rw-r--r--src/effects/SkBlurMaskFilter.cpp28
-rw-r--r--src/effects/SkColorFilters.cpp10
-rw-r--r--src/effects/SkColorMatrixFilter.cpp12
-rw-r--r--src/effects/SkDisplacementMapEffect.cpp18
-rw-r--r--src/effects/SkGpuBlurUtils.cpp4
-rw-r--r--src/effects/SkLightingImageFilter.cpp50
-rw-r--r--src/effects/SkLumaColorFilter.cpp2
-rw-r--r--src/effects/SkMagnifierImageFilter.cpp27
-rw-r--r--src/effects/SkMatrixConvolutionImageFilter.cpp28
-rw-r--r--src/effects/SkMorphologyImageFilter.cpp10
-rw-r--r--src/effects/SkPerlinNoiseShader.cpp40
-rw-r--r--src/effects/SkTableColorFilter.cpp14
-rw-r--r--src/effects/SkXfermodeImageFilter.cpp2
-rw-r--r--src/effects/gradients/SkLinearGradient.cpp34
-rw-r--r--src/effects/gradients/SkLinearGradient.h2
-rw-r--r--src/effects/gradients/SkRadialGradient.cpp34
-rw-r--r--src/effects/gradients/SkSweepGradient.cpp26
-rw-r--r--src/effects/gradients/SkTwoPointConicalGradient.cpp12
-rw-r--r--src/effects/gradients/SkTwoPointConicalGradient.h2
-rw-r--r--src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp132
-rw-r--r--src/effects/gradients/SkTwoPointRadialGradient.cpp34
-rw-r--r--src/gpu/GrAAConvexPathRenderer.cpp12
-rw-r--r--src/gpu/GrAAHairLinePathRenderer.cpp8
-rw-r--r--src/gpu/GrAARectRenderer.cpp24
-rw-r--r--src/gpu/GrBitmapTextContext.h2
-rw-r--r--src/gpu/GrClipMaskManager.cpp2
-rwxr-xr-xsrc/gpu/GrContext.cpp16
-rw-r--r--src/gpu/GrOvalRenderer.cpp46
-rw-r--r--src/gpu/SkGpuDevice.cpp8
-rw-r--r--src/gpu/SkGr.cpp31
-rw-r--r--src/gpu/effects/GrBezierEffect.cpp30
-rw-r--r--src/gpu/effects/GrBezierEffect.h6
-rw-r--r--src/gpu/effects/GrBicubicEffect.cpp8
-rw-r--r--src/gpu/effects/GrBicubicEffect.h14
-rw-r--r--src/gpu/effects/GrConfigConversionEffect.cpp16
-rw-r--r--src/gpu/effects/GrConfigConversionEffect.h8
-rw-r--r--src/gpu/effects/GrConvexPolyEffect.cpp27
-rw-r--r--src/gpu/effects/GrConvexPolyEffect.h6
-rw-r--r--src/gpu/effects/GrConvolutionEffect.cpp8
-rw-r--r--src/gpu/effects/GrConvolutionEffect.h24
-rw-r--r--src/gpu/effects/GrCustomCoordsTextureEffect.cpp8
-rw-r--r--src/gpu/effects/GrCustomCoordsTextureEffect.h2
-rw-r--r--src/gpu/effects/GrDashingEffect.cpp38
-rwxr-xr-xsrc/gpu/effects/GrDistanceFieldTextureEffect.cpp16
-rw-r--r--src/gpu/effects/GrDistanceFieldTextureEffect.h17
-rw-r--r--src/gpu/effects/GrDitherEffect.cpp14
-rw-r--r--src/gpu/effects/GrOvalEffect.cpp34
-rw-r--r--src/gpu/effects/GrRRectEffect.cpp34
-rw-r--r--src/gpu/effects/GrSimpleTextureEffect.cpp8
-rw-r--r--src/gpu/effects/GrSimpleTextureEffect.h22
-rw-r--r--src/gpu/effects/GrTextureDomain.cpp10
-rw-r--r--src/gpu/effects/GrTextureDomain.h12
-rw-r--r--src/gpu/effects/GrYUVtoRGBEffect.cpp4
60 files changed, 558 insertions, 566 deletions
diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp
index 37ba5403c4..e7cc035c74 100644
--- a/src/core/SkBitmapProcShader.cpp
+++ b/src/core/SkBitmapProcShader.cpp
@@ -383,8 +383,8 @@ void SkBitmapProcShader::toString(SkString* str) const {
#include "SkGr.h"
bool SkBitmapProcShader::asNewEffect(GrContext* context, const SkPaint& paint,
- const SkMatrix* localMatrix, GrColor* grColor,
- GrEffectRef** grEffect) const {
+ const SkMatrix* localMatrix, GrColor* paintColor,
+ GrEffect** effect) const {
SkMatrix matrix;
matrix.setIDiv(fRawBitmap.width(), fRawBitmap.height());
@@ -454,13 +454,14 @@ bool SkBitmapProcShader::asNewEffect(GrContext* context, const SkPaint& paint,
return false;
}
- *grColor = (kAlpha_8_SkColorType == fRawBitmap.colorType()) ? SkColor2GrColor(paint.getColor())
- : SkColor2GrColorJustAlpha(paint.getColor());
+ *paintColor = (kAlpha_8_SkColorType == fRawBitmap.colorType()) ?
+ SkColor2GrColor(paint.getColor()) :
+ SkColor2GrColorJustAlpha(paint.getColor());
if (useBicubic) {
- *grEffect = GrBicubicEffect::Create(texture, matrix, tm);
+ *effect = GrBicubicEffect::Create(texture, matrix, tm);
} else {
- *grEffect = GrSimpleTextureEffect::Create(texture, matrix, params);
+ *effect = GrSimpleTextureEffect::Create(texture, matrix, params);
}
GrUnlockAndUnrefCachedBitmapTexture(texture);
@@ -470,8 +471,8 @@ bool SkBitmapProcShader::asNewEffect(GrContext* context, const SkPaint& paint,
#else
bool SkBitmapProcShader::asNewEffect(GrContext* context, const SkPaint& paint,
- const SkMatrix* localMatrix, GrColor* grColor,
- GrEffect** grEffect) const {
+ const SkMatrix* localMatrix, GrColor* paintColor,
+ GrEffect** effect) const {
SkDEBUGFAIL("Should not call in GPU-less build");
return false;
}
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 6240902e1b..64603b4cb5 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -179,7 +179,7 @@ bool SkImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const Cont
am.setIdentity(context);
GrContext::AutoRenderTarget art(context, dst.texture()->asRenderTarget());
GrContext::AutoClip acs(context, dstRect);
- GrEffectRef* effect;
+ GrEffect* effect;
offset->fX = bounds.left();
offset->fY = bounds.top();
bounds.offset(-srcOffset);
diff --git a/src/core/SkPictureShader.cpp b/src/core/SkPictureShader.cpp
index e154131dcb..d6b84c356a 100644
--- a/src/core/SkPictureShader.cpp
+++ b/src/core/SkPictureShader.cpp
@@ -189,18 +189,18 @@ void SkPictureShader::toString(SkString* str) const {
#if SK_SUPPORT_GPU
bool SkPictureShader::asNewEffect(GrContext* context, const SkPaint& paint,
- const SkMatrix* localMatrix, GrColor* grColor,
- GrEffectRef** grEffect) const {
+ const SkMatrix* localMatrix, GrColor* paintColor,
+ GrEffect** effect) const {
SkAutoTUnref<SkShader> bitmapShader(this->refBitmapShader(context->getMatrix(), localMatrix));
if (!bitmapShader) {
return false;
}
- return bitmapShader->asNewEffect(context, paint, NULL, grColor, grEffect);
+ return bitmapShader->asNewEffect(context, paint, NULL, paintColor, effect);
}
#else
bool SkPictureShader::asNewEffect(GrContext* context, const SkPaint& paint,
- const SkMatrix* localMatrix, GrColor* grColor,
- GrEffect** grEffect) const {
+ const SkMatrix* localMatrix, GrColor* paintColor,
+ GrEffect** effect) const {
SkDEBUGFAIL("Should not call in GPU-less build");
return false;
}
diff --git a/src/core/SkShader.cpp b/src/core/SkShader.cpp
index 71781ee0d8..d533cd69b4 100644
--- a/src/core/SkShader.cpp
+++ b/src/core/SkShader.cpp
@@ -209,8 +209,8 @@ SkShader::GradientType SkShader::asAGradient(GradientInfo* info) const {
}
bool SkShader::asNewEffect(GrContext* context, const SkPaint& paint,
- const SkMatrix* localMatrixOrNull, GrColor* grColor,
- GrEffect** grEffect) const {
+ const SkMatrix* localMatrixOrNull, GrColor* paintColor,
+ GrEffect** effect) const {
return false;
}
@@ -348,20 +348,20 @@ SkShader::GradientType SkColorShader::asAGradient(GradientInfo* info) const {
#include "SkGr.h"
bool SkColorShader::asNewEffect(GrContext* context, const SkPaint& paint,
- const SkMatrix* localMatrix, GrColor* grColor,
- GrEffectRef** grEffect) const {
- *grEffect = NULL;
+ const SkMatrix* localMatrix, GrColor* paintColor,
+ GrEffect** effect) const {
+ *effect = NULL;
SkColor skColor = fColor;
U8CPU newA = SkMulDiv255Round(SkColorGetA(fColor), paint.getAlpha());
- *grColor = SkColor2GrColor(SkColorSetA(skColor, newA));
+ *paintColor = SkColor2GrColor(SkColorSetA(skColor, newA));
return true;
}
#else
bool SkColorShader::asNewEffect(GrContext* context, const SkPaint& paint,
- const SkMatrix* localMatrix, GrColor* grColor,
- GrEffect** grEffect) const {
+ const SkMatrix* localMatrix, GrColor* paintColor,
+ GrEffect** effect) const {
SkDEBUGFAIL("Should not call in GPU-less build");
return false;
}
diff --git a/src/core/SkXfermode.cpp b/src/core/SkXfermode.cpp
index cf4f19f448..4b15af0a87 100644
--- a/src/core/SkXfermode.cpp
+++ b/src/core/SkXfermode.cpp
@@ -793,7 +793,7 @@ public:
return mode > SkXfermode::kLastCoeffMode && mode <= SkXfermode::kLastMode;
}
- static GrEffectRef* Create(SkXfermode::Mode mode, GrTexture* background) {
+ static GrEffect* Create(SkXfermode::Mode mode, GrTexture* background) {
if (!IsSupportedMode(mode)) {
return NULL;
} else {
@@ -1223,10 +1223,10 @@ private:
};
GR_DEFINE_EFFECT_TEST(XferEffect);
-GrEffectRef* XferEffect::TestCreate(SkRandom* rand,
- GrContext*,
- const GrDrawTargetCaps&,
- GrTexture*[]) {
+GrEffect* XferEffect::TestCreate(SkRandom* rand,
+ GrContext*,
+ const GrDrawTargetCaps&,
+ GrTexture*[]) {
int mode = rand->nextRangeU(SkXfermode::kLastCoeffMode + 1, SkXfermode::kLastSeparableMode);
return SkNEW_ARGS(XferEffect, (static_cast<SkXfermode::Mode>(mode), NULL));
@@ -1361,8 +1361,7 @@ void SkProcCoeffXfermode::xferA8(SkAlpha* SK_RESTRICT dst,
}
#if SK_SUPPORT_GPU
-bool SkProcCoeffXfermode::asNewEffect(GrEffectRef** effect,
- GrTexture* background) const {
+bool SkProcCoeffXfermode::asNewEffect(GrEffect** effect, GrTexture* background) const {
if (XferEffect::IsSupportedMode(fMode)) {
if (NULL != effect) {
*effect = XferEffect::Create(fMode, background);
diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp
index a77891a385..23937cc839 100644
--- a/src/effects/SkAlphaThresholdFilter.cpp
+++ b/src/effects/SkAlphaThresholdFilter.cpp
@@ -58,10 +58,10 @@ class GrGLAlphaThresholdEffect;
class AlphaThresholdEffect : public GrEffect {
public:
- static GrEffectRef* Create(GrTexture* texture,
- GrTexture* maskTexture,
- float innerThreshold,
- float outerThreshold) {
+ static GrEffect* Create(GrTexture* texture,
+ GrTexture* maskTexture,
+ float innerThreshold,
+ float outerThreshold) {
return SkNEW_ARGS(AlphaThresholdEffect, (texture,
maskTexture,
innerThreshold,
@@ -197,10 +197,10 @@ void GrGLAlphaThresholdEffect::setData(const GrGLUniformManager& uman,
GR_DEFINE_EFFECT_TEST(AlphaThresholdEffect);
-GrEffectRef* AlphaThresholdEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrDrawTargetCaps&,
- GrTexture** textures) {
+GrEffect* AlphaThresholdEffect::TestCreate(SkRandom* random,
+ GrContext* context,
+ const GrDrawTargetCaps&,
+ GrTexture** textures) {
GrTexture* bmpTex = textures[GrEffectUnitTest::kSkiaPMTextureIdx];
GrTexture* maskTex = textures[GrEffectUnitTest::kAlphaTextureIdx];
float inner_thresh = random->nextUScalar1();
diff --git a/src/effects/SkArithmeticMode.cpp b/src/effects/SkArithmeticMode.cpp
index f04ccf23f3..0424a6ed75 100644
--- a/src/effects/SkArithmeticMode.cpp
+++ b/src/effects/SkArithmeticMode.cpp
@@ -34,7 +34,7 @@ public:
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkArithmeticMode_scalar)
#if SK_SUPPORT_GPU
- virtual bool asNewEffect(GrEffectRef** effect, GrTexture* background) const SK_OVERRIDE;
+ virtual bool asNewEffect(GrEffect** effect, GrTexture* background) const SK_OVERRIDE;
#endif
private:
@@ -262,7 +262,7 @@ private:
class GrArithmeticEffect : public GrEffect {
public:
- static GrEffectRef* Create(float k1, float k2, float k3, float k4, bool enforcePMColor,
+ static GrEffect* Create(float k1, float k2, float k3, float k4, bool enforcePMColor,
GrTexture* background) {
return SkNEW_ARGS(GrArithmeticEffect, (k1, k2, k3, k4, enforcePMColor, background));
}
@@ -410,10 +410,10 @@ GrGLEffect::EffectKey GrGLArithmeticEffect::GenKey(const GrDrawEffect& drawEffec
return key;
}
-GrEffectRef* GrArithmeticEffect::TestCreate(SkRandom* rand,
- GrContext*,
- const GrDrawTargetCaps&,
- GrTexture*[]) {
+GrEffect* GrArithmeticEffect::TestCreate(SkRandom* rand,
+ GrContext*,
+ const GrDrawTargetCaps&,
+ GrTexture*[]) {
float k1 = rand->nextF();
float k2 = rand->nextF();
float k3 = rand->nextF();
@@ -425,7 +425,7 @@ GrEffectRef* GrArithmeticEffect::TestCreate(SkRandom* rand,
GR_DEFINE_EFFECT_TEST(GrArithmeticEffect);
-bool SkArithmeticMode_scalar::asNewEffect(GrEffectRef** effect, GrTexture* background) const {
+bool SkArithmeticMode_scalar::asNewEffect(GrEffect** effect, GrTexture* background) const {
if (effect) {
*effect = GrArithmeticEffect::Create(SkScalarToFloat(fK[0]),
SkScalarToFloat(fK[1]),
diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp
index 86a4f5a1a5..e400663795 100644
--- a/src/effects/SkBlurMaskFilter.cpp
+++ b/src/effects/SkBlurMaskFilter.cpp
@@ -555,8 +555,7 @@ public:
/**
* Create a simple filter effect with custom bicubic coefficients.
*/
- static GrEffectRef* Create(GrContext *context, const SkRect& rect,
- float sigma) {
+ static GrEffect* Create(GrContext *context, const SkRect& rect, float sigma) {
GrTexture *blurProfileTexture = NULL;
int doubleProfileSize = SkScalarCeilToInt(12*sigma);
@@ -759,10 +758,10 @@ void GrRectBlurEffect::getConstantColorComponents(GrColor* color, uint32_t* vali
GR_DEFINE_EFFECT_TEST(GrRectBlurEffect);
-GrEffectRef* GrRectBlurEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrDrawTargetCaps&,
- GrTexture**) {
+GrEffect* GrRectBlurEffect::TestCreate(SkRandom* random,
+ GrContext* context,
+ const GrDrawTargetCaps&,
+ GrTexture**) {
float sigma = random->nextRangeF(3,8);
float width = random->nextRangeF(200,300);
float height = random->nextRangeF(200,300);
@@ -793,8 +792,7 @@ bool SkBlurMaskFilterImpl::directFilterMaskGPU(GrContext* context,
int pad=SkScalarCeilToInt(6*xformedSigma)/2;
rect.outset(SkIntToScalar(pad), SkIntToScalar(pad));
- SkAutoTUnref<GrEffectRef> effect(GrRectBlurEffect::Create(
- context, rect, xformedSigma));
+ SkAutoTUnref<GrEffect> effect(GrRectBlurEffect::Create(context, rect, xformedSigma));
if (!effect) {
return false;
}
@@ -815,7 +813,7 @@ class GrGLRRectBlurEffect;
class GrRRectBlurEffect : public GrEffect {
public:
- static GrEffectRef* Create(GrContext* context, float sigma, const SkRRect&);
+ static GrEffect* Create(GrContext* context, float sigma, const SkRRect&);
virtual ~GrRRectBlurEffect() {};
static const char* Name() { return "GrRRectBlur"; }
@@ -844,7 +842,7 @@ private:
};
-GrEffectRef* GrRRectBlurEffect::Create(GrContext* context, float sigma, const SkRRect& rrect) {
+GrEffect* GrRRectBlurEffect::Create(GrContext* context, float sigma, const SkRRect& rrect) {
if (!rrect.isSimpleCircular()) {
return NULL;
}
@@ -941,10 +939,10 @@ bool GrRRectBlurEffect::onIsEqual(const GrEffect& other) const {
GR_DEFINE_EFFECT_TEST(GrRRectBlurEffect);
-GrEffectRef* GrRRectBlurEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrDrawTargetCaps& caps,
- GrTexture*[]) {
+GrEffect* GrRRectBlurEffect::TestCreate(SkRandom* random,
+ GrContext* context,
+ const GrDrawTargetCaps& caps,
+ GrTexture*[]) {
SkScalar w = random->nextRangeScalar(100.f, 1000.f);
SkScalar h = random->nextRangeScalar(100.f, 1000.f);
SkScalar r = random->nextRangeF(1.f, 9.f);
@@ -1074,7 +1072,7 @@ bool SkBlurMaskFilterImpl::directFilterRRectMaskGPU(GrContext* context,
float extra=3.f*SkScalarCeilToScalar(xformedSigma-1/6.0f);
proxy_rect.outset(extra, extra);
- SkAutoTUnref<GrEffectRef> effect(GrRRectBlurEffect::Create(
+ SkAutoTUnref<GrEffect> effect(GrRRectBlurEffect::Create(
context, xformedSigma, rrect));
if (!effect) {
return false;
diff --git a/src/effects/SkColorFilters.cpp b/src/effects/SkColorFilters.cpp
index 18dbb9509e..35b78257b9 100644
--- a/src/effects/SkColorFilters.cpp
+++ b/src/effects/SkColorFilters.cpp
@@ -187,7 +187,7 @@ static inline ColorExpr color_filter_expression(const SkXfermode::Mode& mode,
class ModeColorFilterEffect : public GrEffect {
public:
- static GrEffectRef* Create(const GrColor& c, SkXfermode::Mode mode) {
+ static GrEffect* Create(const GrColor& c, SkXfermode::Mode mode) {
// TODO: Make the effect take the coeffs rather than mode since we already do the
// conversion here.
SkXfermode::Coeff srcCoeff, dstCoeff;
@@ -396,10 +396,10 @@ void ModeColorFilterEffect::getConstantColorComponents(GrColor* color, uint32_t*
}
GR_DEFINE_EFFECT_TEST(ModeColorFilterEffect);
-GrEffectRef* ModeColorFilterEffect::TestCreate(SkRandom* rand,
- GrContext*,
- const GrDrawTargetCaps&,
- GrTexture*[]) {
+GrEffect* ModeColorFilterEffect::TestCreate(SkRandom* rand,
+ GrContext*,
+ const GrDrawTargetCaps&,
+ GrTexture*[]) {
SkXfermode::Mode mode = SkXfermode::kDst_Mode;
while (SkXfermode::kDst_Mode == mode) {
mode = static_cast<SkXfermode::Mode>(rand->nextRangeU(0, SkXfermode::kLastCoeffMode));
diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp
index b3b9c295ab..cf2e3b75fd 100644
--- a/src/effects/SkColorMatrixFilter.cpp
+++ b/src/effects/SkColorMatrixFilter.cpp
@@ -330,7 +330,7 @@ bool SkColorMatrixFilter::asColorMatrix(SkScalar matrix[20]) const {
class ColorMatrixEffect : public GrEffect {
public:
- static GrEffectRef* Create(const SkColorMatrix& matrix) {
+ static GrEffect* Create(const SkColorMatrix& matrix) {
return SkNEW_ARGS(ColorMatrixEffect, (matrix));
}
@@ -468,10 +468,10 @@ private:
GR_DEFINE_EFFECT_TEST(ColorMatrixEffect);
-GrEffectRef* ColorMatrixEffect::TestCreate(SkRandom* random,
- GrContext*,
- const GrDrawTargetCaps&,
- GrTexture* dummyTextures[2]) {
+GrEffect* ColorMatrixEffect::TestCreate(SkRandom* random,
+ GrContext*,
+ const GrDrawTargetCaps&,
+ GrTexture* dummyTextures[2]) {
SkColorMatrix colorMatrix;
for (size_t i = 0; i < SK_ARRAY_COUNT(colorMatrix.fMat); ++i) {
colorMatrix.fMat[i] = random->nextSScalar1();
@@ -479,7 +479,7 @@ GrEffectRef* ColorMatrixEffect::TestCreate(SkRandom* random,
return ColorMatrixEffect::Create(colorMatrix);
}
-GrEffectRef* SkColorMatrixFilter::asNewEffect(GrContext*) const {
+GrEffect* SkColorMatrixFilter::asNewEffect(GrContext*) const {
return ColorMatrixEffect::Create(fMatrix);
}
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index 28a4ab395a..b270640b97 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -299,11 +299,11 @@ private:
class GrDisplacementMapEffect : public GrEffect {
public:
- static GrEffectRef* Create(SkDisplacementMapEffect::ChannelSelectorType xChannelSelector,
- SkDisplacementMapEffect::ChannelSelectorType yChannelSelector,
- SkVector scale,
- GrTexture* displacement, const SkMatrix& offsetMatrix,
- GrTexture* color) {
+ static GrEffect* Create(SkDisplacementMapEffect::ChannelSelectorType xChannelSelector,
+ SkDisplacementMapEffect::ChannelSelectorType yChannelSelector,
+ SkVector scale,
+ GrTexture* displacement, const SkMatrix& offsetMatrix,
+ GrTexture* color) {
return SkNEW_ARGS(GrDisplacementMapEffect, (xChannelSelector,
yChannelSelector,
scale,
@@ -475,10 +475,10 @@ void GrDisplacementMapEffect::getConstantColorComponents(GrColor*,
GR_DEFINE_EFFECT_TEST(GrDisplacementMapEffect);
-GrEffectRef* GrDisplacementMapEffect::TestCreate(SkRandom* random,
- GrContext*,
- const GrDrawTargetCaps&,
- GrTexture* textures[]) {
+GrEffect* GrDisplacementMapEffect::TestCreate(SkRandom* random,
+ GrContext*,
+ const GrDrawTargetCaps&,
+ GrTexture* textures[]) {
int texIdxDispl = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx :
GrEffectUnitTest::kAlphaTextureIdx;
int texIdxColor = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx :
diff --git a/src/effects/SkGpuBlurUtils.cpp b/src/effects/SkGpuBlurUtils.cpp
index 9da08e6f71..5888108755 100644
--- a/src/effects/SkGpuBlurUtils.cpp
+++ b/src/effects/SkGpuBlurUtils.cpp
@@ -54,7 +54,7 @@ static void convolve_gaussian_pass(GrContext* context,
float bounds[2]) {
GrPaint paint;
paint.reset();
- SkAutoTUnref<GrEffectRef> conv(GrConvolutionEffect::CreateGaussian(
+ SkAutoTUnref<GrEffect> conv(GrConvolutionEffect::CreateGaussian(
texture, direction, radius, sigma, useBounds, bounds));
paint.reset();
paint.addColorEffect(conv);
@@ -174,7 +174,7 @@ GrTexture* GaussianBlur(GrContext* context,
matrix.mapRect(&domain, rect);
domain.inset(i < scaleFactorX ? SK_ScalarHalf / srcTexture->width() : 0.0f,
i < scaleFactorY ? SK_ScalarHalf / srcTexture->height() : 0.0f);
- SkAutoTUnref<GrEffectRef> effect(GrTextureDomainEffect::Create(
+ SkAutoTUnref<GrEffect> effect(GrTextureDomainEffect::Create(
srcTexture,
matrix,
domain,
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index 54bfc0408a..c5b8fc6249 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -274,7 +274,8 @@ protected:
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE;
#if SK_SUPPORT_GPU
- virtual bool asNewEffect(GrEffectRef** effect, GrTexture*, const SkMatrix& matrix, const SkIRect& bounds) const SK_OVERRIDE;
+ virtual bool asNewEffect(GrEffect** effect, GrTexture*, const SkMatrix& matrix,
+ const SkIRect& bounds) const SK_OVERRIDE;
#endif
private:
@@ -296,7 +297,8 @@ protected:
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE;
#if SK_SUPPORT_GPU
- virtual bool asNewEffect(GrEffectRef** effect, GrTexture*, const SkMatrix& matrix, const SkIRect& bounds) const SK_OVERRIDE;
+ virtual bool asNewEffect(GrEffect** effect, GrTexture*, const SkMatrix& matrix,
+ const SkIRect& bounds) const SK_OVERRIDE;
#endif
private:
@@ -334,11 +336,11 @@ private:
class GrDiffuseLightingEffect : public GrLightingEffect {
public:
- static GrEffectRef* Create(GrTexture* texture,
- const SkLight* light,
- SkScalar surfaceScale,
- const SkMatrix& matrix,
- SkScalar kd) {
+ static GrEffect* Create(GrTexture* texture,
+ const SkLight* light,
+ SkScalar surfaceScale,
+ const SkMatrix& matrix,
+ SkScalar kd) {
return SkNEW_ARGS(GrDiffuseLightingEffect, (texture,
light,
surfaceScale,
@@ -369,12 +371,12 @@ private:
class GrSpecularLightingEffect : public GrLightingEffect {
public:
- static GrEffectRef* Create(GrTexture* texture,
- const SkLight* light,
- SkScalar surfaceScale,
- const SkMatrix& matrix,
- SkScalar ks,
- SkScalar shininess) {
+ static GrEffect* Create(GrTexture* texture,
+ const SkLight* light,
+ SkScalar surfaceScale,
+ const SkMatrix& matrix,
+ SkScalar ks,
+ SkScalar shininess) {
return SkNEW_ARGS(GrSpecularLightingEffect, (texture,
light,
surfaceScale,
@@ -985,7 +987,8 @@ bool SkDiffuseLightingImageFilter::onFilterImage(Proxy* proxy,
}
#if SK_SUPPORT_GPU
-bool SkDiffuseLightingImageFilter::asNewEffect(GrEffectRef** effect, GrTexture* texture, const SkMatrix& matrix, const SkIRect&) const {
+bool SkDiffuseLightingImageFilter::asNewEffect(GrEffect** effect, GrTexture* texture,
+ const SkMatrix& matrix, const SkIRect&) const {
if (effect) {
SkScalar scale = SkScalarMul(surfaceScale(), SkIntToScalar(255));
*effect = GrDiffuseLightingEffect::Create(texture, light(), scale, matrix, kd());
@@ -1074,7 +1077,8 @@ bool SkSpecularLightingImageFilter::onFilterImage(Proxy* proxy,
}
#if SK_SUPPORT_GPU
-bool SkSpecularLightingImageFilter::asNewEffect(GrEffectRef** effect, GrTexture* texture, const SkMatrix& matrix, const SkIRect&) const {
+bool SkSpecularLightingImageFilter::asNewEffect(GrEffect** effect, GrTexture* texture,
+ const SkMatrix& matrix, const SkIRect&) const {
if (effect) {
SkScalar scale = SkScalarMul(surfaceScale(), SkIntToScalar(255));
*effect = GrSpecularLightingEffect::Create(texture, light(), scale, matrix, ks(), shininess());
@@ -1230,10 +1234,10 @@ bool GrDiffuseLightingEffect::onIsEqual(const GrEffect& sBase) const {
GR_DEFINE_EFFECT_TEST(GrDiffuseLightingEffect);
-GrEffectRef* GrDiffuseLightingEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrDrawTargetCaps&,
- GrTexture* textures[]) {
+GrEffect* GrDiffuseLightingEffect::TestCreate(SkRandom* random,
+ GrContext* context,
+ const GrDrawTargetCaps&,
+ GrTexture* textures[]) {
SkScalar surfaceScale = random->nextSScalar1();
SkScalar kd = random->nextUScalar1();
SkAutoTUnref<SkLight> light(create_random_light(random));
@@ -1436,10 +1440,10 @@ bool GrSpecularLightingEffect::onIsEqual(const GrEffect& sBase) const {
GR_DEFINE_EFFECT_TEST(GrSpecularLightingEffect);
-GrEffectRef* GrSpecularLightingEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrDrawTargetCaps&,
- GrTexture* textures[]) {
+GrEffect* GrSpecularLightingEffect::TestCreate(SkRandom* random,
+ GrContext* context,
+ const GrDrawTargetCaps&,
+ GrTexture* textures[]) {
SkScalar surfaceScale = random->nextSScalar1();
SkScalar ks = random->nextUScalar1();
SkScalar shininess = random->nextUScalar1();
diff --git a/src/effects/SkLumaColorFilter.cpp b/src/effects/SkLumaColorFilter.cpp
index 54dfc08c19..4c5e98ab85 100644
--- a/src/effects/SkLumaColorFilter.cpp
+++ b/src/effects/SkLumaColorFilter.cpp
@@ -60,7 +60,7 @@ void SkLumaColorFilter::toString(SkString* str) const {
#if SK_SUPPORT_GPU
class LumaColorFilterEffect : public GrEffect {
public:
- static GrEffectRef* Create() {
+ static GrEffect* Create() {
GR_CREATE_STATIC_EFFECT(gLumaEffect, LumaColorFilterEffect, ());
return SkRef(gLumaEffect);
}
diff --git a/src/effects/SkMagnifierImageFilter.cpp b/src/effects/SkMagnifierImageFilter.cpp
index a8556d1384..7601603fdb 100644
--- a/src/effects/SkMagnifierImageFilter.cpp
+++ b/src/effects/SkMagnifierImageFilter.cpp
@@ -25,13 +25,13 @@ class GrGLMagnifierEffect;
class GrMagnifierEffect : public GrSingleTextureEffect {
public:
- static GrEffectRef* Create(GrTexture* texture,
- float xOffset,
- float yOffset,
- float xInvZoom,
- float yInvZoom,
- float xInvInset,
- float yInvInset) {
+ static GrEffect* Create(GrTexture* texture,
+ float xOffset,
+ float yOffset,
+ float xInvZoom,
+ float yInvZoom,
+ float xInvInset,
+ float yInvInset) {
return SkNEW_ARGS(GrMagnifierEffect, (texture,
xOffset,
yOffset,
@@ -181,10 +181,10 @@ void GrGLMagnifierEffect::setData(const GrGLUniformManager& uman,
GR_DEFINE_EFFECT_TEST(GrMagnifierEffect);
-GrEffectRef* GrMagnifierEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrDrawTargetCaps&,
- GrTexture** textures) {
+GrEffect* GrMagnifierEffect::TestCreate(SkRandom* random,
+ GrContext* context,
+ const GrDrawTargetCaps&,
+ GrTexture** textures) {
GrTexture* texture = textures[0];
const int kMaxWidth = 200;
const int kMaxHeight = 200;
@@ -195,7 +195,7 @@ GrEffectRef* GrMagnifierEffect::TestCreate(SkRandom* random,
uint32_t y = random->nextULessThan(kMaxHeight - height);
uint32_t inset = random->nextULessThan(kMaxInset);
- GrEffectRef* effect = GrMagnifierEffect::Create(
+ GrEffect* effect = GrMagnifierEffect::Create(
texture,
(float) width / texture->width(),
(float) height / texture->height(),
@@ -252,7 +252,8 @@ SkMagnifierImageFilter::SkMagnifierImageFilter(const SkRect& srcRect, SkScalar i
}
#if SK_SUPPORT_GPU
-bool SkMagnifierImageFilter::asNewEffect(GrEffectRef** effect, GrTexture* texture, const SkMatrix&, const SkIRect&) const {
+bool SkMagnifierImageFilter::asNewEffect(GrEffect** effect, GrTexture* texture, const SkMatrix&,
+ const SkIRect&) const {
if (effect) {
SkScalar yOffset = (texture->origin() == kTopLeft_GrSurfaceOrigin) ? fSrcRect.y() :
(texture->height() - (fSrcRect.y() + fSrcRect.height()));
diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp
index 684281a117..5baf36b76f 100644
--- a/src/effects/SkMatrixConvolutionImageFilter.cpp
+++ b/src/effects/SkMatrixConvolutionImageFilter.cpp
@@ -330,15 +330,15 @@ class GrGLMatrixConvolutionEffect;
class GrMatrixConvolutionEffect : public GrSingleTextureEffect {
public:
typedef SkMatrixConvolutionImageFilter::TileMode TileMode;
- static GrEffectRef* Create(GrTexture* texture,
- const SkIRect& bounds,
- const SkISize& kernelSize,
- const SkScalar* kernel,
- SkScalar gain,
- SkScalar bias,
- const SkIPoint& kernelOffset,
- TileMode tileMode,
- bool convolveAlpha) {
+ static GrEffect* Create(GrTexture* texture,
+ const SkIRect& bounds,
+ const SkISize& kernelSize,
+ const SkScalar* kernel,
+ SkScalar gain,
+ SkScalar bias,
+ const SkIPoint& kernelOffset,
+ TileMode tileMode,
+ bool convolveAlpha) {
return SkNEW_ARGS(GrMatrixConvolutionEffect, (texture,
bounds,
kernelSize,
@@ -625,10 +625,10 @@ GR_DEFINE_EFFECT_TEST(GrMatrixConvolutionEffect);
// Allows for a 5x5 kernel (or 25x1, for that matter).
#define MAX_KERNEL_SIZE 25
-GrEffectRef* GrMatrixConvolutionEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrDrawTargetCaps&,
- GrTexture* textures[]) {
+GrEffect* GrMatrixConvolutionEffect::TestCreate(SkRandom* random,
+ GrContext* context,
+ const GrDrawTargetCaps&,
+ GrTexture* textures[]) {
int texIdx = random->nextBool() ? GrEffectUnitTest::kSkiaPMTextureIdx :
GrEffectUnitTest::kAlphaTextureIdx;
int width = random->nextRangeU(1, MAX_KERNEL_SIZE);
@@ -659,7 +659,7 @@ GrEffectRef* GrMatrixConvolutionEffect::TestCreate(SkRandom* random,
convolveAlpha);
}
-bool SkMatrixConvolutionImageFilter::asNewEffect(GrEffectRef** effect,
+bool SkMatrixConvolutionImageFilter::asNewEffect(GrEffect** effect,
GrTexture* texture,
const SkMatrix&,
const SkIRect& bounds
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index a18388e096..53180fa7d3 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -278,7 +278,7 @@ public:
kDilate_MorphologyType,
};
- static GrEffectRef* Create(GrTexture* tex, Direction dir, int radius, MorphologyType type) {
+ static GrEffect* Create(GrTexture* tex, Direction dir, int radius, MorphologyType type) {
return SkNEW_ARGS(GrMorphologyEffect, (tex, dir, radius, type));
}
@@ -446,10 +446,10 @@ void GrMorphologyEffect::getConstantColorComponents(GrColor* color, uint32_t* va
GR_DEFINE_EFFECT_TEST(GrMorphologyEffect);
-GrEffectRef* GrMorphologyEffect::TestCreate(SkRandom* random,
- GrContext*,
- const GrDrawTargetCaps&,
- GrTexture* textures[]) {
+GrEffect* GrMorphologyEffect::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/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp
index 894af42cea..f57fcf3b74 100644
--- a/src/effects/SkPerlinNoiseShader.cpp
+++ b/src/effects/SkPerlinNoiseShader.cpp
@@ -525,11 +525,11 @@ private:
class GrPerlinNoiseEffect : public GrEffect {
public:
- static GrEffectRef* Create(SkPerlinNoiseShader::Type type,
- int numOctaves, bool stitchTiles,
- SkPerlinNoiseShader::PaintingData* paintingData,
- GrTexture* permutationsTexture, GrTexture* noiseTexture,
- const SkMatrix& matrix, uint8_t alpha) {
+ static GrEffect* Create(SkPerlinNoiseShader::Type type,
+ int numOctaves, bool stitchTiles,
+ SkPerlinNoiseShader::PaintingData* paintingData,
+ GrTexture* permutationsTexture, GrTexture* noiseTexture,
+ const SkMatrix& matrix, uint8_t alpha) {
return SkNEW_ARGS(GrPerlinNoiseEffect, (type, numOctaves, stitchTiles, paintingData,
permutationsTexture, noiseTexture, matrix, alpha));
}
@@ -608,10 +608,10 @@ private:
/////////////////////////////////////////////////////////////////////
GR_DEFINE_EFFECT_TEST(GrPerlinNoiseEffect);
-GrEffectRef* GrPerlinNoiseEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrDrawTargetCaps&,
- GrTexture**) {
+GrEffect* GrPerlinNoiseEffect::TestCreate(SkRandom* random,
+ GrContext* context,
+ const GrDrawTargetCaps&,
+ GrTexture**) {
int numOctaves = random->nextRangeU(2, 10);
bool stitchTiles = random->nextBool();
SkScalar seed = SkIntToScalar(random->nextU());
@@ -628,9 +628,9 @@ GrEffectRef* GrPerlinNoiseEffect::TestCreate(SkRandom* random,
stitchTiles ? &tileSize : NULL);
SkPaint paint;
- GrColor grColor;
- GrEffectRef* effect;
- shader->asNewEffect(context, paint, NULL, &grColor, &effect);
+ GrColor paintColor;
+ GrEffect* effect;
+ SkAssertResult(shader->asNewEffect(context, paint, NULL, &paintColor, &effect));
SkDELETE(shader);
@@ -944,11 +944,11 @@ void GrGLPerlinNoise::setData(const GrGLUniformManager& uman, const GrDrawEffect
/////////////////////////////////////////////////////////////////////
bool SkPerlinNoiseShader::asNewEffect(GrContext* context, const SkPaint& paint,
- const SkMatrix* externalLocalMatrix, GrColor* grColor,
- GrEffect** grEffect) const {
+ const SkMatrix* externalLocalMatrix, GrColor* paintColor,
+ GrEffect** effect) const {
SkASSERT(NULL != context);
- *grColor = SkColor2GrColorJustAlpha(paint.getColor());
+ *paintColor = SkColor2GrColorJustAlpha(paint.getColor());
SkMatrix localMatrix = this->getLocalMatrix();
if (externalLocalMatrix) {
@@ -965,7 +965,7 @@ bool SkPerlinNoiseShader::asNewEffect(GrContext* context, const SkPaint& paint,
}
SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter(
clearColor, SkXfermode::kSrc_Mode));
- *grEffect = cf->asNewEffect(context);
+ *effect = cf->asNewEffect(context);
return true;
}
@@ -982,7 +982,7 @@ bool SkPerlinNoiseShader::asNewEffect(GrContext* context, const SkPaint& paint,
m.setTranslateX(-localMatrix.getTranslateX() + SK_Scalar1);
m.setTranslateY(-localMatrix.getTranslateY() + SK_Scalar1);
if ((NULL != permutationsTexture) && (NULL != noiseTexture)) {
- *grEffect = GrPerlinNoiseEffect::Create(fType,
+ *effect = GrPerlinNoiseEffect::Create(fType,
fNumOctaves,
fStitchTiles,
paintingData,
@@ -990,7 +990,7 @@ bool SkPerlinNoiseShader::asNewEffect(GrContext* context, const SkPaint& paint,
m, paint.getAlpha());
} else {
SkDELETE(paintingData);
- *grEffect = NULL;
+ *effect = NULL;
}
// Unlock immediately, this is not great, but we don't have a way of
@@ -1009,8 +1009,8 @@ bool SkPerlinNoiseShader::asNewEffect(GrContext* context, const SkPaint& paint,
#else
bool SkPerlinNoiseShader::asNewEffect(GrContext* context, const SkPaint& paint,
- const SkMatrix* externalLocalMatrix, GrColor* grColor,
- GrEffect** grEffect) const {
+ const SkMatrix* externalLocalMatrix, GrColor* paintColor,
+ GrEffect** effect) const {
SkDEBUGFAIL("Should not call in GPU-less build");
return false;
}
diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp
index d4a111e64b..09024d3976 100644
--- a/src/effects/SkTableColorFilter.cpp
+++ b/src/effects/SkTableColorFilter.cpp
@@ -236,7 +236,7 @@ class GLColorTableEffect;
class ColorTableEffect : public GrEffect {
public:
- static GrEffectRef* Create(GrTexture* texture, unsigned flags) {
+ static GrEffect* Create(GrTexture* texture, unsigned flags) {
return SkNEW_ARGS(ColorTableEffect, (texture, flags));
}
@@ -377,18 +377,18 @@ void ColorTableEffect::getConstantColorComponents(GrColor* color, uint32_t* vali
GR_DEFINE_EFFECT_TEST(ColorTableEffect);
-GrEffectRef* ColorTableEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrDrawTargetCaps&,
- GrTexture* textures[]) {
+GrEffect* ColorTableEffect::TestCreate(SkRandom* random,
+ GrContext* context,
+ const GrDrawTargetCaps&,
+ GrTexture* textures[]) {
static unsigned kAllFlags = SkTable_ColorFilter::kR_Flag | SkTable_ColorFilter::kG_Flag |
SkTable_ColorFilter::kB_Flag | SkTable_ColorFilter::kA_Flag;
return ColorTableEffect::Create(textures[GrEffectUnitTest::kAlphaTextureIdx], kAllFlags);
}
-GrEffectRef* SkTable_ColorFilter::asNewEffect(GrContext* context) const {
+GrEffect* SkTable_ColorFilter::asNewEffect(GrContext* context) const {
SkBitmap bitmap;
- GrEffectRef* effect = NULL;
+ GrEffect* effect = NULL;
this->asComponentTable(&bitmap);
// passing NULL because this effect does no tiling or filtering.
GrTexture* texture = GrLockAndRefCachedBitmapTexture(context, bitmap, NULL);
diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp
index bcfb78576e..cf32cf5cb0 100644
--- a/src/effects/SkXfermodeImageFilter.cpp
+++ b/src/effects/SkXfermodeImageFilter.cpp
@@ -123,7 +123,7 @@ bool SkXfermodeImageFilter::filterImageGPU(Proxy* proxy,
GrTexture* foregroundTex = foreground.getTexture();
GrContext* context = foregroundTex->getContext();
- GrEffectRef* xferEffect = NULL;
+ GrEffect* xferEffect = NULL;
GrTextureDesc desc;
desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit;
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp
index d518cc700f..113877cfe0 100644
--- a/src/effects/gradients/SkLinearGradient.cpp
+++ b/src/effects/gradients/SkLinearGradient.cpp
@@ -480,10 +480,10 @@ private:
class GrLinearGradient : public GrGradientEffect {
public:
- static GrEffectRef* Create(GrContext* ctx,
- const SkLinearGradient& shader,
- const SkMatrix& matrix,
- SkShader::TileMode tm) {
+ static GrEffect* Create(GrContext* ctx,
+ const SkLinearGradient& shader,
+ const SkMatrix& matrix,
+ SkShader::TileMode tm) {
return SkNEW_ARGS(GrLinearGradient, (ctx, shader, matrix, tm));
}
@@ -511,10 +511,10 @@ private:
GR_DEFINE_EFFECT_TEST(GrLinearGradient);
-GrEffectRef* GrLinearGradient::TestCreate(SkRandom* random,
- GrContext* context,
- const GrDrawTargetCaps&,
- GrTexture**) {
+GrEffect* GrLinearGradient::TestCreate(SkRandom* random,
+ GrContext* context,
+ const GrDrawTargetCaps&,
+ GrTexture**) {
SkPoint points[] = {{random->nextUScalar1(), random->nextUScalar1()},
{random->nextUScalar1(), random->nextUScalar1()}};
@@ -527,9 +527,9 @@ GrEffectRef* GrLinearGradient::TestCreate(SkRandom* random,
colors, stops, colorCount,
tm));
SkPaint paint;
- GrColor grColor;
- GrEffectRef* effect;
- shader->asNewEffect(context, paint, NULL, &grColor, &effect);
+ GrColor paintColor;
+ GrEffect* effect;
+ SkAssertResult(shader->asNewEffect(context, paint, NULL, &paintColor, &effect));
return effect;
}
@@ -551,8 +551,8 @@ void GrGLLinearGradient::emitCode(GrGLShaderBuilder* builder,
/////////////////////////////////////////////////////////////////////
bool SkLinearGradient::asNewEffect(GrContext* context, const SkPaint& paint,
- const SkMatrix* localMatrix, GrColor* grColor,
- GrEffectRef** grEffect) const {
+ const SkMatrix* localMatrix, GrColor* paintColor,
+ GrEffect** effect) const {
SkASSERT(NULL != context);
SkMatrix matrix;
@@ -568,8 +568,8 @@ bool SkLinearGradient::asNewEffect(GrContext* context, const SkPaint& paint,
}
matrix.postConcat(fPtsToUnit);
- *grColor = SkColor2GrColorJustAlpha(paint.getColor());
- *grEffect = GrLinearGradient::Create(context, *this, matrix, fTileMode);
+ *paintColor = SkColor2GrColorJustAlpha(paint.getColor());
+ *effect = GrLinearGradient::Create(context, *this, matrix, fTileMode);
return true;
}
@@ -577,8 +577,8 @@ bool SkLinearGradient::asNewEffect(GrContext* context, const SkPaint& paint,
#else
bool SkLinearGradient::asNewEffect(GrContext* context, const SkPaint& paint,
- const SkMatrix* localMatrix, GrColor* grColor,
- GrEffect** grEffect) const {
+ const SkMatrix* localMatrix, GrColor* paintColor,
+ GrEffect** effect) const {
SkDEBUGFAIL("Should not call in GPU-less build");
return false;
}
diff --git a/src/effects/gradients/SkLinearGradient.h b/src/effects/gradients/SkLinearGradient.h
index bb64188251..41d015296f 100644
--- a/src/effects/gradients/SkLinearGradient.h
+++ b/src/effects/gradients/SkLinearGradient.h
@@ -31,7 +31,7 @@ public:
virtual BitmapType asABitmap(SkBitmap*, SkMatrix*, TileMode*) const SK_OVERRIDE;
virtual GradientType asAGradient(GradientInfo* info) const SK_OVERRIDE;
virtual bool asNewEffect(GrContext* context, const SkPaint& paint, const SkMatrix* localMatrix,
- GrColor* grColor, GrEffect** grEffect) const SK_OVERRIDE;
+ GrColor* paintColor, GrEffect** effect) const SK_OVERRIDE;
SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLinearGradient)
diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp
index bb60d0f061..2267d8d5bb 100644
--- a/src/effects/gradients/SkRadialGradient.cpp
+++ b/src/effects/gradients/SkRadialGradient.cpp
@@ -489,10 +489,10 @@ private:
class GrRadialGradient : public GrGradientEffect {
public:
- static GrEffectRef* Create(GrContext* ctx,
- const SkRadialGradient& shader,
- const SkMatrix& matrix,
- SkShader::TileMode tm) {
+ static GrEffect* Create(GrContext* ctx,
+ const SkRadialGradient& shader,
+ const SkMatrix& matrix,
+ SkShader::TileMode tm) {
return SkNEW_ARGS(GrRadialGradient, (ctx, shader, matrix, tm));
}
@@ -522,10 +522,10 @@ private:
GR_DEFINE_EFFECT_TEST(GrRadialGradient);
-GrEffectRef* GrRadialGradient::TestCreate(SkRandom* random,
- GrContext* context,
- const GrDrawTargetCaps&,
- GrTexture**) {
+GrEffect* GrRadialGradient::TestCreate(SkRandom* random,
+ GrContext* context,
+ const GrDrawTargetCaps&,
+ GrTexture**) {
SkPoint center = {random->nextUScalar1(), random->nextUScalar1()};
SkScalar radius = random->nextUScalar1();
@@ -538,9 +538,9 @@ GrEffectRef* GrRadialGradient::TestCreate(SkRandom* random,
colors, stops, colorCount,
tm));
SkPaint paint;
- GrColor grColor;
- GrEffectRef* effect;
- shader->asNewEffect(context, paint, NULL, &grColor, &effect);
+ GrColor paintColor;
+ GrEffect* effect;
+ SkAssertResult(shader->asNewEffect(context, paint, NULL, &paintColor, &effect));
return effect;
}
@@ -563,8 +563,8 @@ void GrGLRadialGradient::emitCode(GrGLShaderBuilder* builder,
/////////////////////////////////////////////////////////////////////
bool SkRadialGradient::asNewEffect(GrContext* context, const SkPaint& paint,
- const SkMatrix* localMatrix, GrColor* grColor,
- GrEffectRef** grEffect) const {
+ const SkMatrix* localMatrix, GrColor* paintColor,
+ GrEffect** effect) const {
SkASSERT(NULL != context);
SkMatrix matrix;
@@ -580,8 +580,8 @@ bool SkRadialGradient::asNewEffect(GrContext* context, const SkPaint& paint,
}
matrix.postConcat(fPtsToUnit);
- *grColor = SkColor2GrColorJustAlpha(paint.getColor());
- *grEffect = GrRadialGradient::Create(context, *this, matrix, fTileMode);
+ *paintColor = SkColor2GrColorJustAlpha(paint.getColor());
+ *effect = GrRadialGradient::Create(context, *this, matrix, fTileMode);
return true;
}
@@ -589,8 +589,8 @@ bool SkRadialGradient::asNewEffect(GrContext* context, const SkPaint& paint,
#else
bool SkRadialGradient::asNewEffect(GrContext* context, const SkPaint& paint,
- const SkMatrix* localMatrix, GrColor* grColor,
- GrEffect** grEffect) const {
+ const SkMatrix* localMatrix, GrColor* paintColor,
+ GrEffect** effect) const {
SkDEBUGFAIL("Should not call in GPU-less build");
return false;
}
diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp
index b3474ec1a2..1ba044386d 100644
--- a/src/effects/gradients/SkSweepGradient.cpp
+++ b/src/effects/gradients/SkSweepGradient.cpp
@@ -205,10 +205,8 @@ private:
class GrSweepGradient : public GrGradientEffect {
public:
- static GrEffectRef* Create(GrContext* ctx,
- const SkSweepGradient& shader,
- const SkMatrix& matrix) {
- return SkNEW_ARGS(GrSweepGradient, (ctx, shader, matrix));
+ static GrEffect* Create(GrContext* ctx, const SkSweepGradient& shader, const SkMatrix& m) {
+ return SkNEW_ARGS(GrSweepGradient, (ctx, shader, m));
}
virtual ~GrSweepGradient() { }
@@ -233,7 +231,7 @@ private:
GR_DEFINE_EFFECT_TEST(GrSweepGradient);
-GrEffectRef* GrSweepGradient::TestCreate(SkRandom* random,
+GrEffect* GrSweepGradient::TestCreate(SkRandom* random,
GrContext* context,
const GrDrawTargetCaps&,
GrTexture**) {
@@ -247,9 +245,9 @@ GrEffectRef* GrSweepGradient::TestCreate(SkRandom* random,
SkAutoTUnref<SkShader> shader(SkGradientShader::CreateSweep(center.fX, center.fY,
colors, stops, colorCount));
SkPaint paint;
- GrEffectRef* effect;
- GrColor grColor;
- shader->asNewEffect(context, paint, NULL, &grColor, &effect);
+ GrEffect* effect;
+ GrColor paintColor;
+ SkAssertResult(shader->asNewEffect(context, paint, NULL, &paintColor, &effect));
return effect;
}
@@ -283,8 +281,8 @@ void GrGLSweepGradient::emitCode(GrGLShaderBuilder* builder,
/////////////////////////////////////////////////////////////////////
bool SkSweepGradient::asNewEffect(GrContext* context, const SkPaint& paint,
- const SkMatrix* localMatrix, GrColor* grColor,
- GrEffectRef** grEffect) const {
+ const SkMatrix* localMatrix, GrColor* paintColor,
+ GrEffect** effect) const {
SkMatrix matrix;
if (!this->getLocalMatrix().invert(&matrix)) {
@@ -299,8 +297,8 @@ bool SkSweepGradient::asNewEffect(GrContext* context, const SkPaint& paint,
}
matrix.postConcat(fPtsToUnit);
- *grEffect = GrSweepGradient::Create(context, *this, matrix);
- *grColor = SkColor2GrColorJustAlpha(paint.getColor());
+ *effect = GrSweepGradient::Create(context, *this, matrix);
+ *paintColor = SkColor2GrColorJustAlpha(paint.getColor());
return true;
}
@@ -308,8 +306,8 @@ bool SkSweepGradient::asNewEffect(GrContext* context, const SkPaint& paint,
#else
bool SkSweepGradient::asNewEffect(GrContext* context, const SkPaint& paint,
- const SkMatrix* localMatrix, GrColor* grColor,
- GrEffect** grEffect) const {
+ const SkMatrix* localMatrix, GrColor* paintColor,
+ GrEffect** effect) const {
SkDEBUGFAIL("Should not call in GPU-less build");
return false;
}
diff --git a/src/effects/gradients/SkTwoPointConicalGradient.cpp b/src/effects/gradients/SkTwoPointConicalGradient.cpp
index 6678000c90..bb702ff8fe 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient.cpp
@@ -382,21 +382,21 @@ void SkTwoPointConicalGradient::flatten(
#include "SkGr.h"
bool SkTwoPointConicalGradient::asNewEffect(GrContext* context, const SkPaint& paint,
- const SkMatrix* localMatrix, GrColor* grColor,
- GrEffectRef** grEffect) const {
+ const SkMatrix* localMatrix, GrColor* paintColor,
+ GrEffect** effect) const {
SkASSERT(NULL != context);
SkASSERT(fPtsToUnit.isIdentity());
- *grEffect = Gr2PtConicalGradientEffect::Create(context, *this, fTileMode, localMatrix);
- *grColor = SkColor2GrColorJustAlpha(paint.getColor());
+ *effect = Gr2PtConicalGradientEffect::Create(context, *this, fTileMode, localMatrix);
+ *paintColor = SkColor2GrColorJustAlpha(paint.getColor());
return true;
}
#else
bool SkTwoPointConicalGradient::asNewEffect(GrContext* context, const SkPaint& paint,
- const SkMatrix* localMatrix, GrColor* grColor,
- GrEffect** grEffect) const {
+ const SkMatrix* localMatrix, GrColor* paintColor,
+ GrEffect** effect) const {
SkDEBUGFAIL("Should not call in GPU-less build");
return false;
}
diff --git a/src/effects/gradients/SkTwoPointConicalGradient.h b/src/effects/gradients/SkTwoPointConicalGradient.h
index bff377ee79..418c92dc61 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient.h
+++ b/src/effects/gradients/SkTwoPointConicalGradient.h
@@ -65,7 +65,7 @@ public:
SkMatrix* matrix,
TileMode* xy) const;
virtual SkShader::GradientType asAGradient(GradientInfo* info) const SK_OVERRIDE;
- virtual bool asNewEffect(GrContext*, const SkPaint&, const SkMatrix*, GrColor* grColor,
+ virtual bool asNewEffect(GrContext*, const SkPaint&, const SkMatrix*, GrColor* paintColor,
GrEffect**) const SK_OVERRIDE;
virtual bool isOpaque() const SK_OVERRIDE;
diff --git a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
index b6959e32e1..4d0aa0fbfc 100644
--- a/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
+++ b/src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
@@ -59,10 +59,10 @@ class GLEdge2PtConicalEffect;
class Edge2PtConicalEffect : public GrGradientEffect {
public:
- static GrEffectRef* Create(GrContext* ctx,
- const SkTwoPointConicalGradient& shader,
- const SkMatrix& matrix,
- SkShader::TileMode tm) {
+ static GrEffect* Create(GrContext* ctx,
+ const SkTwoPointConicalGradient& shader,
+ const SkMatrix& matrix,
+ SkShader::TileMode tm) {
return SkNEW_ARGS(Edge2PtConicalEffect, (ctx, shader, matrix, tm));
}
@@ -172,10 +172,10 @@ const GrBackendEffectFactory& Edge2PtConicalEffect::getFactory() const {
GR_DEFINE_EFFECT_TEST(Edge2PtConicalEffect);
-GrEffectRef* Edge2PtConicalEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrDrawTargetCaps&,
- GrTexture**) {
+GrEffect* Edge2PtConicalEffect::TestCreate(SkRandom* random,
+ GrContext* context,
+ const GrDrawTargetCaps&,
+ GrTexture**) {
SkPoint center1 = {random->nextUScalar1(), random->nextUScalar1()};
SkScalar radius1 = random->nextUScalar1();
SkPoint center2;
@@ -202,9 +202,9 @@ GrEffectRef* Edge2PtConicalEffect::TestCreate(SkRandom* random,
colors, stops, colorCount,
tm));
SkPaint paint;
- GrEffectRef* effect;
- GrColor grColor;
- shader->asNewEffect(context, paint, NULL, &grColor, &effect);
+ GrEffect* effect;
+ GrColor paintColor;
+ SkAssertResult(shader->asNewEffect(context, paint, NULL, &paintColor, &effect));
return effect;
}
@@ -365,11 +365,11 @@ class GLFocalOutside2PtConicalEffect;
class FocalOutside2PtConicalEffect : public GrGradientEffect {
public:
- static GrEffectRef* Create(GrContext* ctx,
- const SkTwoPointConicalGradient& shader,
- const SkMatrix& matrix,
- SkShader::TileMode tm,
- SkScalar focalX) {
+ static GrEffect* Create(GrContext* ctx,
+ const SkTwoPointConicalGradient& shader,
+ const SkMatrix& matrix,
+ SkShader::TileMode tm,
+ SkScalar focalX) {
return SkNEW_ARGS(FocalOutside2PtConicalEffect, (ctx, shader, matrix, tm, focalX));
}
@@ -448,10 +448,10 @@ const GrBackendEffectFactory& FocalOutside2PtConicalEffect::getFactory() const {
GR_DEFINE_EFFECT_TEST(FocalOutside2PtConicalEffect);
-GrEffectRef* FocalOutside2PtConicalEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrDrawTargetCaps&,
- GrTexture**) {
+GrEffect* FocalOutside2PtConicalEffect::TestCreate(SkRandom* random,
+ GrContext* context,
+ const GrDrawTargetCaps&,
+ GrTexture**) {
SkPoint center1 = {random->nextUScalar1(), random->nextUScalar1()};
SkScalar radius1 = 0.f;
SkPoint center2;
@@ -475,9 +475,9 @@ GrEffectRef* FocalOutside2PtConicalEffect::TestCreate(SkRandom* random,
colors, stops, colorCount,
tm));
SkPaint paint;
- GrEffectRef* effect;
- GrColor grColor;
- shader->asNewEffect(context, paint, NULL, &grColor, &effect);
+ GrEffect* effect;
+ GrColor paintColor;
+ SkAssertResult(shader->asNewEffect(context, paint, NULL, &paintColor, &effect));
return effect;
}
@@ -579,11 +579,11 @@ class GLFocalInside2PtConicalEffect;
class FocalInside2PtConicalEffect : public GrGradientEffect {
public:
- static GrEffectRef* Create(GrContext* ctx,
- const SkTwoPointConicalGradient& shader,
- const SkMatrix& matrix,
- SkShader::TileMode tm,
- SkScalar focalX) {
+ static GrEffect* Create(GrContext* ctx,
+ const SkTwoPointConicalGradient& shader,
+ const SkMatrix& matrix,
+ SkShader::TileMode tm,
+ SkScalar focalX) {
return SkNEW_ARGS(FocalInside2PtConicalEffect, (ctx, shader, matrix, tm, focalX));
}
@@ -657,10 +657,10 @@ const GrBackendEffectFactory& FocalInside2PtConicalEffect::getFactory() const {
GR_DEFINE_EFFECT_TEST(FocalInside2PtConicalEffect);
-GrEffectRef* FocalInside2PtConicalEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrDrawTargetCaps&,
- GrTexture**) {
+GrEffect* FocalInside2PtConicalEffect::TestCreate(SkRandom* random,
+ GrContext* context,
+ const GrDrawTargetCaps&,
+ GrTexture**) {
SkPoint center1 = {random->nextUScalar1(), random->nextUScalar1()};
SkScalar radius1 = 0.f;
SkPoint center2;
@@ -686,10 +686,10 @@ GrEffectRef* FocalInside2PtConicalEffect::TestCreate(SkRandom* random,
colors, stops, colorCount,
tm));
SkPaint paint;
- GrColor grColor;
- GrEffectRef* grEffect;
- shader->asNewEffect(context, paint, NULL, &grColor, &grEffect);
- return grEffect;
+ GrColor paintColor;
+ GrEffect* effect;
+ SkAssertResult(shader->asNewEffect(context, paint, NULL, &paintColor, &effect));
+ return effect;
}
GLFocalInside2PtConicalEffect::GLFocalInside2PtConicalEffect(const GrBackendEffectFactory& factory,
@@ -812,11 +812,11 @@ class GLCircleInside2PtConicalEffect;
class CircleInside2PtConicalEffect : public GrGradientEffect {
public:
- static GrEffectRef* Create(GrContext* ctx,
- const SkTwoPointConicalGradient& shader,
- const SkMatrix& matrix,
- SkShader::TileMode tm,
- const CircleConicalInfo& info) {
+ static GrEffect* Create(GrContext* ctx,
+ const SkTwoPointConicalGradient& shader,
+ const SkMatrix& matrix,
+ SkShader::TileMode tm,
+ const CircleConicalInfo& info) {
return SkNEW_ARGS(CircleInside2PtConicalEffect, (ctx, shader, matrix, tm, info));
}
@@ -902,10 +902,10 @@ const GrBackendEffectFactory& CircleInside2PtConicalEffect::getFactory() const {
GR_DEFINE_EFFECT_TEST(CircleInside2PtConicalEffect);
-GrEffectRef* CircleInside2PtConicalEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrDrawTargetCaps&,
- GrTexture**) {
+GrEffect* CircleInside2PtConicalEffect::TestCreate(SkRandom* random,
+ GrContext* context,
+ const GrDrawTargetCaps&,
+ GrTexture**) {
SkPoint center1 = {random->nextUScalar1(), random->nextUScalar1()};
SkScalar radius1 = random->nextUScalar1() + 0.0001f; // make sure radius1 != 0
SkPoint center2;
@@ -930,10 +930,10 @@ GrEffectRef* CircleInside2PtConicalEffect::TestCreate(SkRandom* random,
colors, stops, colorCount,
tm));
SkPaint paint;
- GrColor grColor;
- GrEffectRef* grEffect;
- shader->asNewEffect(context, paint, NULL, &grColor, &grEffect);
- return grEffect;
+ GrColor paintColor;
+ GrEffect* effect;
+ SkAssertResult(shader->asNewEffect(context, paint, NULL, &paintColor, &effect));
+ return effect;
}
GLCircleInside2PtConicalEffect::GLCircleInside2PtConicalEffect(const GrBackendEffectFactory& factory,
@@ -1024,11 +1024,11 @@ class GLCircleOutside2PtConicalEffect;
class CircleOutside2PtConicalEffect : public GrGradientEffect {
public:
- static GrEffectRef* Create(GrContext* ctx,
- const SkTwoPointConicalGradient& shader,
- const SkMatrix& matrix,
- SkShader::TileMode tm,
- const CircleConicalInfo& info) {
+ static GrEffect* Create(GrContext* ctx,
+ const SkTwoPointConicalGradient& shader,
+ const SkMatrix& matrix,
+ SkShader::TileMode tm,
+ const CircleConicalInfo& info) {
return SkNEW_ARGS(CircleOutside2PtConicalEffect, (ctx, shader, matrix, tm, info));
}
@@ -1131,10 +1131,10 @@ const GrBackendEffectFactory& CircleOutside2PtConicalEffect::getFactory() const
GR_DEFINE_EFFECT_TEST(CircleOutside2PtConicalEffect);
-GrEffectRef* CircleOutside2PtConicalEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrDrawTargetCaps&,
- GrTexture**) {
+GrEffect* CircleOutside2PtConicalEffect::TestCreate(SkRandom* random,
+ GrContext* context,
+ const GrDrawTargetCaps&,
+ GrTexture**) {
SkPoint center1 = {random->nextUScalar1(), random->nextUScalar1()};
SkScalar radius1 = random->nextUScalar1() + 0.0001f; // make sure radius1 != 0
SkPoint center2;
@@ -1160,10 +1160,10 @@ GrEffectRef* CircleOutside2PtConicalEffect::TestCreate(SkRandom* random,
colors, stops, colorCount,
tm));
SkPaint paint;
- GrColor grColor;
- GrEffectRef* grEffect;
- shader->asNewEffect(context, paint, NULL, &grColor, &grEffect);
- return grEffect;
+ GrColor paintColor;
+ GrEffect* effect;
+ SkAssertResult(shader->asNewEffect(context, paint, NULL, &paintColor, &effect));
+ return effect;
}
GLCircleOutside2PtConicalEffect::GLCircleOutside2PtConicalEffect(const GrBackendEffectFactory& factory,
@@ -1280,10 +1280,10 @@ GrGLEffect::EffectKey GLCircleOutside2PtConicalEffect::GenKey(const GrDrawEffect
//////////////////////////////////////////////////////////////////////////////
-GrEffectRef* Gr2PtConicalGradientEffect::Create(GrContext* ctx,
- const SkTwoPointConicalGradient& shader,
- SkShader::TileMode tm,
- const SkMatrix* localMatrix) {
+GrEffect* Gr2PtConicalGradientEffect::Create(GrContext* ctx,
+ const SkTwoPointConicalGradient& shader,
+ SkShader::TileMode tm,
+ const SkMatrix* localMatrix) {
SkMatrix matrix;
if (!shader.getLocalMatrix().invert(&matrix)) {
return NULL;
diff --git a/src/effects/gradients/SkTwoPointRadialGradient.cpp b/src/effects/gradients/SkTwoPointRadialGradient.cpp
index 22feb7189c..79c231d49a 100644
--- a/src/effects/gradients/SkTwoPointRadialGradient.cpp
+++ b/src/effects/gradients/SkTwoPointRadialGradient.cpp
@@ -434,10 +434,10 @@ private:
class GrRadial2Gradient : public GrGradientEffect {
public:
- static GrEffectRef* Create(GrContext* ctx,
- const SkTwoPointRadialGradient& shader,
- const SkMatrix& matrix,
- SkShader::TileMode tm) {
+ static GrEffect* Create(GrContext* ctx,
+ const SkTwoPointRadialGradient& shader,
+ const SkMatrix& matrix,
+ SkShader::TileMode tm) {
return SkNEW_ARGS(GrRadial2Gradient, (ctx, shader, matrix, tm));
}
@@ -506,10 +506,10 @@ private:
GR_DEFINE_EFFECT_TEST(GrRadial2Gradient);
-GrEffectRef* GrRadial2Gradient::TestCreate(SkRandom* random,
- GrContext* context,
- const GrDrawTargetCaps&,
- GrTexture**) {
+GrEffect* GrRadial2Gradient::TestCreate(SkRandom* random,
+ GrContext* context,
+ const GrDrawTargetCaps&,
+ GrTexture**) {
SkPoint center1 = {random->nextUScalar1(), random->nextUScalar1()};
SkScalar radius1 = random->nextUScalar1();
SkPoint center2;
@@ -530,9 +530,9 @@ GrEffectRef* GrRadial2Gradient::TestCreate(SkRandom* random,
colors, stops, colorCount,
tm));
SkPaint paint;
- GrEffectRef* effect;
- GrColor grColor;
- shader->asNewEffect(context, paint, NULL, &grColor, &effect);
+ GrEffect* effect;
+ GrColor paintColor;
+ SkAssertResult(shader->asNewEffect(context, paint, NULL, &paintColor, &effect));
return effect;
}
@@ -674,8 +674,8 @@ GrGLEffect::EffectKey GrGLRadial2Gradient::GenKey(const GrDrawEffect& drawEffect
/////////////////////////////////////////////////////////////////////
bool SkTwoPointRadialGradient::asNewEffect(GrContext* context, const SkPaint& paint,
- const SkMatrix* localMatrix, GrColor* grColor,
- GrEffectRef** grEffect) const {
+ const SkMatrix* localMatrix, GrColor* paintColor,
+ GrEffect** effect) const {
SkASSERT(NULL != context);
// invert the localM, translate to center1 (fPtsToUni), rotate so center2 is on x axis.
@@ -701,8 +701,8 @@ bool SkTwoPointRadialGradient::asNewEffect(GrContext* context, const SkPaint& pa
matrix.postConcat(rot);
}
- *grColor = SkColor2GrColorJustAlpha(paint.getColor());
- *grEffect = GrRadial2Gradient::Create(context, *this, matrix, fTileMode);
+ *paintColor = SkColor2GrColorJustAlpha(paint.getColor());
+ *effect = GrRadial2Gradient::Create(context, *this, matrix, fTileMode);
return true;
}
@@ -710,8 +710,8 @@ bool SkTwoPointRadialGradient::asNewEffect(GrContext* context, const SkPaint& pa
#else
bool SkTwoPointRadialGradient::asNewEffect(GrContext* context, const SkPaint& paint,
- const SkMatrix* localMatrix, GrColor* grColor,
- GrEffect** grEffect) const {
+ const SkMatrix* localMatrix, GrColor* paintColor,
+ GrEffect** effect) const {
SkDEBUGFAIL("Should not call in GPU-less build");
return false;
}
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp
index d0f6e0ef64..7765eb1839 100644
--- a/src/gpu/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/GrAAConvexPathRenderer.cpp
@@ -506,7 +506,7 @@ static void create_vertices(const SegmentArray& segments,
class QuadEdgeEffect : public GrVertexEffect {
public:
- static GrEffectRef* Create() {
+ static GrEffect* Create() {
GR_CREATE_STATIC_EFFECT(gQuadEdgeEffect, QuadEdgeEffect, ());
gQuadEdgeEffect->ref();
return gQuadEdgeEffect;
@@ -595,10 +595,10 @@ private:
GR_DEFINE_EFFECT_TEST(QuadEdgeEffect);
-GrEffectRef* QuadEdgeEffect::TestCreate(SkRandom* random,
- GrContext*,
- const GrDrawTargetCaps& caps,
- GrTexture*[]) {
+GrEffect* QuadEdgeEffect::TestCreate(SkRandom* random,
+ GrContext*,
+ const GrDrawTargetCaps& caps,
+ GrTexture*[]) {
// Doesn't work without derivative instructions.
return caps.shaderDerivativeSupport() ? QuadEdgeEffect::Create() : NULL;
}
@@ -675,7 +675,7 @@ bool GrAAConvexPathRenderer::onDrawPath(const SkPath& origPath,
drawState->setVertexAttribs<gPathAttribs>(SK_ARRAY_COUNT(gPathAttribs));
static const int kEdgeAttrIndex = 1;
- GrEffectRef* quadEffect = QuadEdgeEffect::Create();
+ GrEffect* quadEffect = QuadEdgeEffect::Create();
drawState->addCoverageEffect(quadEffect, kEdgeAttrIndex)->unref();
GrDrawTarget::AutoReleaseGeometry arg(target, vCount, iCount);
diff --git a/src/gpu/GrAAHairLinePathRenderer.cpp b/src/gpu/GrAAHairLinePathRenderer.cpp
index 0014bbe4a0..d5ff40d955 100644
--- a/src/gpu/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/GrAAHairLinePathRenderer.cpp
@@ -997,8 +997,8 @@ bool GrAAHairLinePathRenderer::onDrawPath(const SkPath& path,
kVertsPerQuad * quadCnt + kVertsPerQuad * conicCnt));
if (quadCnt > 0) {
- GrEffectRef* hairQuadEffect = GrQuadEffect::Create(kHairlineAA_GrEffectEdgeType,
- *target->caps());
+ GrEffect* hairQuadEffect = GrQuadEffect::Create(kHairlineAA_GrEffectEdgeType,
+ *target->caps());
SkASSERT(NULL != hairQuadEffect);
GrDrawState::AutoRestoreEffects are(drawState);
target->setIndexSourceToBuffer(fQuadsIndexBuffer);
@@ -1018,8 +1018,8 @@ bool GrAAHairLinePathRenderer::onDrawPath(const SkPath& path,
if (conicCnt > 0) {
GrDrawState::AutoRestoreEffects are(drawState);
- GrEffectRef* hairConicEffect = GrConicEffect::Create(kHairlineAA_GrEffectEdgeType,
- *target->caps());
+ GrEffect* hairConicEffect = GrConicEffect::Create(kHairlineAA_GrEffectEdgeType,
+ *target->caps());
SkASSERT(NULL != hairConicEffect);
drawState->addCoverageEffect(hairConicEffect, 1, 2)->unref();
int conics = 0;
diff --git a/src/gpu/GrAARectRenderer.cpp b/src/gpu/GrAARectRenderer.cpp
index 497b3cfbb8..48024a6999 100644
--- a/src/gpu/GrAARectRenderer.cpp
+++ b/src/gpu/GrAARectRenderer.cpp
@@ -19,7 +19,7 @@ class GrGLAlignedRectEffect;
// Axis Aligned special case
class GrAlignedRectEffect : public GrVertexEffect {
public:
- static GrEffectRef* Create() {
+ static GrEffect* Create() {
GR_CREATE_STATIC_EFFECT(gAlignedRectEffect, GrAlignedRectEffect, ());
gAlignedRectEffect->ref();
return gAlignedRectEffect;
@@ -113,10 +113,10 @@ private:
GR_DEFINE_EFFECT_TEST(GrAlignedRectEffect);
-GrEffectRef* GrAlignedRectEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrDrawTargetCaps&,
- GrTexture* textures[]) {
+GrEffect* GrAlignedRectEffect::TestCreate(SkRandom* random,
+ GrContext* context,
+ const GrDrawTargetCaps&,
+ GrTexture* textures[]) {
return GrAlignedRectEffect::Create();
}
@@ -137,7 +137,7 @@ class GrGLRectEffect;
*/
class GrRectEffect : public GrVertexEffect {
public:
- static GrEffectRef* Create() {
+ static GrEffect* Create() {
GR_CREATE_STATIC_EFFECT(gRectEffect, GrRectEffect, ());
gRectEffect->ref();
return gRectEffect;
@@ -248,10 +248,10 @@ private:
GR_DEFINE_EFFECT_TEST(GrRectEffect);
-GrEffectRef* GrRectEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrDrawTargetCaps&,
- GrTexture* textures[]) {
+GrEffect* GrRectEffect::TestCreate(SkRandom* random,
+ GrContext* context,
+ const GrDrawTargetCaps&,
+ GrTexture* textures[]) {
return GrRectEffect::Create();
}
@@ -631,7 +631,7 @@ void GrAARectRenderer::shaderFillAARect(GrGpu* gpu,
RectVertex* verts = reinterpret_cast<RectVertex*>(geo.vertices());
- GrEffectRef* effect = GrRectEffect::Create();
+ GrEffect* effect = GrRectEffect::Create();
static const int kRectAttrIndex = 1;
static const int kWidthIndex = 2;
drawState->addCoverageEffect(effect, kRectAttrIndex, kWidthIndex)->unref();
@@ -681,7 +681,7 @@ void GrAARectRenderer::shaderFillAlignedAARect(GrGpu* gpu,
AARectVertex* verts = reinterpret_cast<AARectVertex*>(geo.vertices());
- GrEffectRef* effect = GrAlignedRectEffect::Create();
+ GrEffect* effect = GrAlignedRectEffect::Create();
static const int kOffsetIndex = 1;
drawState->addCoverageEffect(effect, kOffsetIndex)->unref();
diff --git a/src/gpu/GrBitmapTextContext.h b/src/gpu/GrBitmapTextContext.h
index 5be2e99851..b9d5ce78d5 100644
--- a/src/gpu/GrBitmapTextContext.h
+++ b/src/gpu/GrBitmapTextContext.h
@@ -47,7 +47,7 @@ private:
void* fVertices;
int32_t fMaxVertices;
GrTexture* fCurrTexture;
- SkAutoTUnref<GrEffectRef> fCachedEffect;
+ SkAutoTUnref<GrEffect> fCachedEffect;
uint32_t fEffectTextureGenID;
int fCurrVertex;
SkRect fVertexBounds;
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index a878894c59..704750efca 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -165,7 +165,7 @@ bool GrClipMaskManager::installClipEffects(const ElementList& elements,
} else {
edgeType = invert ? kInverseFillBW_GrEffectEdgeType : kFillBW_GrEffectEdgeType;
}
- SkAutoTUnref<GrEffectRef> effect;
+ SkAutoTUnref<GrEffect> effect;
switch (iter.get()->getType()) {
case SkClipStack::Element::kPath_Type:
effect.reset(GrConvexPolyEffect::Create(edgeType, iter.get()->getPath(),
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index cdef414535..9cae6b05c8 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -1482,7 +1482,7 @@ bool GrContext::readRenderTargetPixels(GrRenderTarget* target,
textureMatrix.setTranslate(SK_Scalar1 *left, SK_Scalar1 *top);
textureMatrix.postIDiv(src->width(), src->height());
- SkAutoTUnref<const GrEffectRef> effect;
+ SkAutoTUnref<const GrEffect> effect;
if (unpremul) {
effect.reset(this->createPMToUPMEffect(src, swapRAndB, textureMatrix));
if (NULL != effect) {
@@ -1654,7 +1654,7 @@ bool GrContext::writeRenderTargetPixels(GrRenderTarget* target,
return false;
}
- SkAutoTUnref<const GrEffectRef> effect;
+ SkAutoTUnref<const GrEffect> effect;
SkMatrix textureMatrix;
textureMatrix.setIDiv(texture->width(), texture->height());
@@ -1861,9 +1861,9 @@ void test_pm_conversions(GrContext* ctx, int* pmToUPMValue, int* upmToPMValue) {
}
}
-const GrEffectRef* GrContext::createPMToUPMEffect(GrTexture* texture,
- bool swapRAndB,
- const SkMatrix& matrix) {
+const GrEffect* GrContext::createPMToUPMEffect(GrTexture* texture,
+ bool swapRAndB,
+ const SkMatrix& matrix) {
if (!fDidTestPMConversions) {
test_pm_conversions(this, &fPMToUPMConversion, &fUPMToPMConversion);
fDidTestPMConversions = true;
@@ -1877,9 +1877,9 @@ const GrEffectRef* GrContext::createPMToUPMEffect(GrTexture* texture,
}
}
-const GrEffectRef* GrContext::createUPMToPMEffect(GrTexture* texture,
- bool swapRAndB,
- const SkMatrix& matrix) {
+const GrEffect* GrContext::createUPMToPMEffect(GrTexture* texture,
+ bool swapRAndB,
+ const SkMatrix& matrix) {
if (!fDidTestPMConversions) {
test_pm_conversions(this, &fPMToUPMConversion, &fUPMToPMConversion);
fDidTestPMConversions = true;
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp
index 8a76646b5b..fe4c03e0e8 100644
--- a/src/gpu/GrOvalRenderer.cpp
+++ b/src/gpu/GrOvalRenderer.cpp
@@ -61,7 +61,7 @@ inline bool circle_stays_circle(const SkMatrix& m) {
class CircleEdgeEffect : public GrVertexEffect {
public:
- static GrEffectRef* Create(bool stroke) {
+ static GrEffect* Create(bool stroke) {
GR_CREATE_STATIC_EFFECT(gCircleStrokeEdge, CircleEdgeEffect, (true));
GR_CREATE_STATIC_EFFECT(gCircleFillEdge, CircleEdgeEffect, (false));
@@ -153,10 +153,10 @@ private:
GR_DEFINE_EFFECT_TEST(CircleEdgeEffect);
-GrEffectRef* CircleEdgeEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrDrawTargetCaps&,
- GrTexture* textures[]) {
+GrEffect* CircleEdgeEffect::TestCreate(SkRandom* random,
+ GrContext* context,
+ const GrDrawTargetCaps&,
+ GrTexture* textures[]) {
return CircleEdgeEffect::Create(random->nextBool());
}
@@ -172,7 +172,7 @@ GrEffectRef* CircleEdgeEffect::TestCreate(SkRandom* random,
class EllipseEdgeEffect : public GrVertexEffect {
public:
- static GrEffectRef* Create(bool stroke) {
+ static GrEffect* Create(bool stroke) {
GR_CREATE_STATIC_EFFECT(gEllipseStrokeEdge, EllipseEdgeEffect, (true));
GR_CREATE_STATIC_EFFECT(gEllipseFillEdge, EllipseEdgeEffect, (false));
@@ -284,10 +284,10 @@ private:
GR_DEFINE_EFFECT_TEST(EllipseEdgeEffect);
-GrEffectRef* EllipseEdgeEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrDrawTargetCaps&,
- GrTexture* textures[]) {
+GrEffect* EllipseEdgeEffect::TestCreate(SkRandom* random,
+ GrContext* context,
+ const GrDrawTargetCaps&,
+ GrTexture* textures[]) {
return EllipseEdgeEffect::Create(random->nextBool());
}
@@ -306,7 +306,7 @@ class DIEllipseEdgeEffect : public GrVertexEffect {
public:
enum Mode { kStroke = 0, kHairline, kFill };
- static GrEffectRef* Create(Mode mode) {
+ static GrEffect* Create(Mode mode) {
GR_CREATE_STATIC_EFFECT(gEllipseStrokeEdge, DIEllipseEdgeEffect, (kStroke));
GR_CREATE_STATIC_EFFECT(gEllipseHairlineEdge, DIEllipseEdgeEffect, (kHairline));
GR_CREATE_STATIC_EFFECT(gEllipseFillEdge, DIEllipseEdgeEffect, (kFill));
@@ -440,10 +440,10 @@ private:
GR_DEFINE_EFFECT_TEST(DIEllipseEdgeEffect);
-GrEffectRef* DIEllipseEdgeEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrDrawTargetCaps&,
- GrTexture* textures[]) {
+GrEffect* DIEllipseEdgeEffect::TestCreate(SkRandom* random,
+ GrContext* context,
+ const GrDrawTargetCaps&,
+ GrTexture* textures[]) {
return DIEllipseEdgeEffect::Create((Mode)(random->nextRangeU(0,2)));
}
@@ -541,7 +541,7 @@ void GrOvalRenderer::drawCircle(GrDrawTarget* target,
}
}
- GrEffectRef* effect = CircleEdgeEffect::Create(isStrokeOnly && innerRadius > 0);
+ GrEffect* effect = CircleEdgeEffect::Create(isStrokeOnly && innerRadius > 0);
static const int kCircleEdgeAttrIndex = 1;
drawState->addCoverageEffect(effect, kCircleEdgeAttrIndex)->unref();
@@ -681,8 +681,8 @@ bool GrOvalRenderer::drawEllipse(GrDrawTarget* target,
EllipseVertex* verts = reinterpret_cast<EllipseVertex*>(geo.vertices());
- GrEffectRef* effect = EllipseEdgeEffect::Create(isStrokeOnly &&
- innerXRadius > 0 && innerYRadius > 0);
+ GrEffect* effect = EllipseEdgeEffect::Create(isStrokeOnly &&
+ innerXRadius > 0 && innerYRadius > 0);
static const int kEllipseCenterAttrIndex = 1;
static const int kEllipseEdgeAttrIndex = 2;
@@ -800,7 +800,7 @@ bool GrOvalRenderer::drawDIEllipse(GrDrawTarget* target,
DIEllipseVertex* verts = reinterpret_cast<DIEllipseVertex*>(geo.vertices());
- GrEffectRef* effect = DIEllipseEdgeEffect::Create(mode);
+ GrEffect* effect = DIEllipseEdgeEffect::Create(mode);
static const int kEllipseOuterOffsetAttrIndex = 1;
static const int kEllipseInnerOffsetAttrIndex = 2;
@@ -898,7 +898,7 @@ bool GrOvalRenderer::drawDRRect(GrDrawTarget* target, GrContext* context, bool u
}
GrEffectEdgeType edgeType = applyAA ? kInverseFillAA_GrEffectEdgeType :
kInverseFillBW_GrEffectEdgeType;
- GrEffectRef* effect = GrRRectEffect::Create(edgeType, *inner);
+ GrEffect* effect = GrRRectEffect::Create(edgeType, *inner);
if (NULL == effect) {
return false;
}
@@ -920,7 +920,7 @@ bool GrOvalRenderer::drawDRRect(GrDrawTarget* target, GrContext* context, bool u
}
GrEffectEdgeType edgeType = applyAA ? kFillAA_GrEffectEdgeType :
kFillBW_GrEffectEdgeType;
- GrEffectRef* effect = GrRRectEffect::Create(edgeType, *outer);
+ GrEffect* effect = GrRRectEffect::Create(edgeType, *outer);
if (NULL == effect) {
return false;
}
@@ -1051,7 +1051,7 @@ bool GrOvalRenderer::drawRRect(GrDrawTarget* target, GrContext* context, bool us
isStrokeOnly = (isStrokeOnly && innerRadius >= 0);
- GrEffectRef* effect = CircleEdgeEffect::Create(isStrokeOnly);
+ GrEffect* effect = CircleEdgeEffect::Create(isStrokeOnly);
static const int kCircleEdgeAttrIndex = 1;
drawState->addCoverageEffect(effect, kCircleEdgeAttrIndex)->unref();
@@ -1155,7 +1155,7 @@ bool GrOvalRenderer::drawRRect(GrDrawTarget* target, GrContext* context, bool us
}
EllipseVertex* verts = reinterpret_cast<EllipseVertex*>(geo.vertices());
- GrEffectRef* effect = EllipseEdgeEffect::Create(isStrokeOnly);
+ GrEffect* effect = EllipseEdgeEffect::Create(isStrokeOnly);
static const int kEllipseOffsetAttrIndex = 1;
static const int kEllipseRadiiAttrIndex = 2;
drawState->addCoverageEffect(effect,
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 42acc9b81c..a0e40766a3 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1328,7 +1328,7 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap,
SkScalarMul(srcRect.fBottom, hInv));
SkRect textureDomain = SkRect::MakeEmpty();
- SkAutoTUnref<GrEffectRef> effect;
+ SkAutoTUnref<GrEffect> effect;
if (needsTextureDomain && !(flags & SkCanvas::kBleed_DrawBitmapRectFlag)) {
// Use a constrained texture domain to avoid color bleeding
SkScalar left, top, right, bottom;
@@ -1369,9 +1369,9 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap,
GrPaint grPaint;
grPaint.addColorEffect(effect);
bool alphaOnly = !(kAlpha_8_SkColorType == bitmap.colorType());
- GrColor grColor = (alphaOnly) ? SkColor2GrColorJustAlpha(paint.getColor()) :
- SkColor2GrColor(paint.getColor());
- SkPaint2GrPaintNoShader(this->context(), paint, grColor, false, &grPaint);
+ GrColor paintColor = (alphaOnly) ? SkColor2GrColorJustAlpha(paint.getColor()) :
+ SkColor2GrColor(paint.getColor());
+ SkPaint2GrPaintNoShader(this->context(), paint, paintColor, false, &grPaint);
fContext->drawRectToRect(grPaint, dstRect, paintRect, NULL);
}
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index a1b379fe8c..c4e2c1f93f 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -419,7 +419,7 @@ bool GrPixelConfig2ColorType(GrPixelConfig config, SkColorType* ctOut) {
///////////////////////////////////////////////////////////////////////////////
-void SkPaint2GrPaintNoShader(GrContext* context, const SkPaint& skPaint, GrColor grColor,
+void SkPaint2GrPaintNoShader(GrContext* context, const SkPaint& skPaint, GrColor paintColor,
bool constantColor, GrPaint* grPaint) {
grPaint->setDither(skPaint.isDither());
@@ -429,7 +429,7 @@ void SkPaint2GrPaintNoShader(GrContext* context, const SkPaint& skPaint, GrColor
SkXfermode::Coeff dm;
SkXfermode* mode = skPaint.getXfermode();
- GrEffectRef* xferEffect = NULL;
+ GrEffect* xferEffect = NULL;
if (SkXfermode::AsNewEffectOrCoeff(mode, &xferEffect, &sm, &dm)) {
if (NULL != xferEffect) {
grPaint->addColorEffect(xferEffect)->unref();
@@ -445,7 +445,7 @@ void SkPaint2GrPaintNoShader(GrContext* context, const SkPaint& skPaint, GrColor
grPaint->setBlendFunc(sk_blend_to_grblend(sm), sk_blend_to_grblend(dm));
//set the color of the paint to the one of the parameter
- grPaint->setColor(grColor);
+ grPaint->setColor(paintColor);
SkColorFilter* colorFilter = skPaint.getColorFilter();
if (NULL != colorFilter) {
@@ -455,7 +455,7 @@ void SkPaint2GrPaintNoShader(GrContext* context, const SkPaint& skPaint, GrColor
SkColor filtered = colorFilter->filterColor(skPaint.getColor());
grPaint->setColor(SkColor2GrColor(filtered));
} else {
- SkAutoTUnref<GrEffectRef> effect(colorFilter->asNewEffect(context));
+ SkAutoTUnref<GrEffect> effect(colorFilter->asNewEffect(context));
if (NULL != effect.get()) {
grPaint->addColorEffect(effect);
}
@@ -476,7 +476,7 @@ void SkPaint2GrPaintNoShader(GrContext* context, const SkPaint& skPaint, GrColor
target->config() == kBGRA_8888_GrPixelConfig) {
// The dither flag is set and the target is likely
// not going to be dithered by the GPU.
- SkAutoTUnref<GrEffectRef> effect(GrDitherEffect::Create());
+ SkAutoTUnref<GrEffect> effect(GrDitherEffect::Create());
if (NULL != effect.get()) {
grPaint->addColorEffect(effect);
grPaint->setDither(false);
@@ -515,30 +515,29 @@ void SkPaint2GrPaintShader(GrContext* context, const SkPaint& skPaint,
return;
}
- // SkShader::asNewEffect() may do offscreen rendering. Save off the current RT, clip, and
- // matrix. We don't reset the matrix on the context because SkShader::asNewEffect may use
- // GrContext::getMatrix() to know the transformation from local coords to device space.
- GrColor grColor = SkColor2GrColor(skPaint.getColor());
+ GrColor paintColor = SkColor2GrColor(skPaint.getColor());
// Start a new block here in order to preserve our context state after calling
// asNewEffect(). Since these calls get passed back to the client, we don't really
// want them messing around with the context.
{
+ // SkShader::asNewEffect() may do offscreen rendering. Save off the current RT, clip, and
+ // matrix. We don't reset the matrix on the context because SkShader::asNewEffect may use
+ // GrContext::getMatrix() to know the transformation from local coords to device space.
GrContext::AutoRenderTarget art(context, NULL);
GrContext::AutoClip ac(context, GrContext::AutoClip::kWideOpen_InitialClip);
AutoMatrix am(context);
- // setup the shader as the first color effect on the paint
- // the default grColor is the paint's color
- GrEffectRef* grEffect = NULL;
- if (shader->asNewEffect(context, skPaint, NULL, &grColor, &grEffect) && NULL != grEffect) {
- SkAutoTUnref<GrEffectRef> effect(grEffect);
- grPaint->addColorEffect(effect);
+ // Allow the shader to modify paintColor and also create an effect to be installed as
+ // the first color effect on the GrPaint.
+ GrEffect* effect = NULL;
+ if (shader->asNewEffect(context, skPaint, NULL, &paintColor, &effect) && NULL != effect) {
+ grPaint->addColorEffect(effect)->unref();
constantColor = false;
}
}
// The grcolor is automatically set when calling asneweffect.
// If the shader can be seen as an effect it returns true and adds its effect to the grpaint.
- SkPaint2GrPaintNoShader(context, skPaint, grColor, constantColor, grPaint);
+ SkPaint2GrPaintNoShader(context, skPaint, paintColor, constantColor, grPaint);
}
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);
}