Index: src/effects/gradients/SkRadialGradient.cpp |
diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp |
index 3b9d1758c413d9bf7e671f88d3a419edb0839ec3..f0cb1612b056dd3dfccffef8145541b7e22d8873 100644 |
--- a/src/effects/gradients/SkRadialGradient.cpp |
+++ b/src/effects/gradients/SkRadialGradient.cpp |
@@ -458,6 +458,7 @@ void SkRadialGradient::RadialGradientContext::shadeSpan(int x, int y, |
#if SK_SUPPORT_GPU |
#include "GrTBackendEffectFactory.h" |
+#include "SkGr.h" |
class GrGLRadialGradient : public GrGLGradientEffect { |
public: |
@@ -538,7 +539,10 @@ GrEffectRef* GrRadialGradient::TestCreate(SkRandom* random, |
colors, stops, colorCount, |
tm)); |
SkPaint paint; |
- return shader->asNewEffect(context, paint, NULL); |
+ GrColor grColor; |
+ GrEffectRef* effect; |
+ shader->asNewEffect(context, paint, NULL, &grColor, &effect); |
+ return effect; |
} |
///////////////////////////////////////////////////////////////////// |
@@ -559,30 +563,37 @@ void GrGLRadialGradient::emitCode(GrGLShaderBuilder* builder, |
///////////////////////////////////////////////////////////////////// |
-GrEffectRef* SkRadialGradient::asNewEffect(GrContext* context, const SkPaint&, |
- const SkMatrix* localMatrix) const { |
+bool SkRadialGradient::asNewEffect(GrContext* context, const SkPaint& paint, |
+ const SkMatrix* localMatrix, GrColor* grColor, |
+ GrEffectRef** grEffect) const { |
SkASSERT(NULL != context); |
- |
+ |
SkMatrix matrix; |
if (!this->getLocalMatrix().invert(&matrix)) { |
- return NULL; |
+ return false; |
} |
if (localMatrix) { |
SkMatrix inv; |
if (!localMatrix->invert(&inv)) { |
- return NULL; |
+ return false; |
} |
matrix.postConcat(inv); |
} |
matrix.postConcat(fPtsToUnit); |
- return GrRadialGradient::Create(context, *this, matrix, fTileMode); |
+ |
+ *grColor = SkColor2GrColorJustAlpha(paint.getColor()); |
+ *grEffect = GrRadialGradient::Create(context, *this, matrix, fTileMode); |
+ |
+ return true; |
} |
#else |
-GrEffectRef* SkRadialGradient::asNewEffect(GrContext*, const SkPaint&, const SkMatrix*) const { |
+bool SkRadialGradient::asNewEffect(GrContext* context, const SkPaint& paint, |
+ const SkMatrix* localMatrix, GrColor* grColor, |
+ GrEffectRef** grEffect) const { |
SkDEBUGFAIL("Should not call in GPU-less build"); |
- return NULL; |
+ return false; |
} |
#endif |