Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(726)

Unified Diff: src/effects/gradients/SkSweepGradient.cpp

Issue 374923002: Goodbye GrEffectRef. (Closed) Base URL: https://skia.googlesource.com/skia.git@noref3
Patch Set: Address comments Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/gradients/SkRadialGradient.cpp ('k') | src/effects/gradients/SkTwoPointConicalGradient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/SkSweepGradient.cpp
diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp
index b3474ec1a2cd23aeb808d2a0836719a40bda298b..1ba044386db28a5518f786bae93a5df6d1aff7af 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;
}
« no previous file with comments | « src/effects/gradients/SkRadialGradient.cpp ('k') | src/effects/gradients/SkTwoPointConicalGradient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698