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/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp
index b3474ec..1ba0443 100644
--- a/src/effects/gradients/SkSweepGradient.cpp
+++ b/src/effects/gradients/SkSweepGradient.cpp
@@ -205,10 +205,8 @@
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 @@
GR_DEFINE_EFFECT_TEST(GrSweepGradient);
-GrEffectRef* GrSweepGradient::TestCreate(SkRandom* random,
+GrEffect* GrSweepGradient::TestCreate(SkRandom* random,
GrContext* context,
const GrDrawTargetCaps&,
GrTexture**) {
@@ -247,9 +245,9 @@
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 @@
/////////////////////////////////////////////////////////////////////
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 @@
}
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 @@
#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;
}