Index: src/effects/gradients/SkRadialGradient.cpp |
diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp |
index e379f36c9577f33490e6ab9b0d86d34aa7835b2b..ce4c16a6543ec22b0eefdda1a99eb60f03165891 100644 |
--- a/src/effects/gradients/SkRadialGradient.cpp |
+++ b/src/effects/gradients/SkRadialGradient.cpp |
@@ -538,7 +538,7 @@ GrEffectRef* GrRadialGradient::TestCreate(SkRandom* random, |
colors, stops, colorCount, |
tm)); |
SkPaint paint; |
- return shader->asNewEffect(context, paint); |
+ return shader->asNewEffect(context, paint, NULL); |
} |
///////////////////////////////////////////////////////////////////// |
@@ -559,13 +559,21 @@ void GrGLRadialGradient::emitCode(GrGLShaderBuilder* builder, |
///////////////////////////////////////////////////////////////////// |
-GrEffectRef* SkRadialGradient::asNewEffect(GrContext* context, const SkPaint&) const { |
+GrEffectRef* SkRadialGradient::asNewEffect(GrContext* context, const SkPaint&, |
+ const SkMatrix* localMatrix) const { |
SkASSERT(NULL != context); |
SkMatrix matrix; |
if (!this->getLocalMatrix().invert(&matrix)) { |
return NULL; |
} |
+ if (localMatrix) { |
+ SkMatrix inv; |
+ if (!localMatrix->invert(&inv)) { |
+ return NULL; |
+ } |
+ matrix.postConcat(inv); |
+ } |
matrix.postConcat(fPtsToUnit); |
return GrRadialGradient::Create(context, *this, matrix, fTileMode); |
} |