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

Unified Diff: src/effects/gradients/SkLinearGradient.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/SkLinearGradient.h ('k') | src/effects/gradients/SkRadialGradient.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/SkLinearGradient.cpp
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp
index d518cc700f954a8e023c8f5fe1bcb641917eacc9..113877cfe089a3f55055edce451840ef421f1fa3 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;
}
« no previous file with comments | « src/effects/gradients/SkLinearGradient.h ('k') | src/effects/gradients/SkRadialGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698