Goodbye GrEffectRef.
Also, reworked some var names and comments around SkShader::asNewEffect.
R=robertphillips@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/374923002
diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp
index bb60d0f..2267d8d 100644
--- a/src/effects/gradients/SkRadialGradient.cpp
+++ b/src/effects/gradients/SkRadialGradient.cpp
@@ -489,10 +489,10 @@
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 @@
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 @@
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 @@
/////////////////////////////////////////////////////////////////////
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 @@
}
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 @@
#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;
}