Index: src/effects/gradients/SkSweepGradient.cpp |
diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp |
index 81ebb3441eb13159399ce771d05c0a5e3402953d..ba43571c9b7afea88ab518b3a2888933d37ae945 100644 |
--- a/src/effects/gradients/SkSweepGradient.cpp |
+++ b/src/effects/gradients/SkSweepGradient.cpp |
@@ -247,7 +247,7 @@ GrEffectRef* GrSweepGradient::TestCreate(SkRandom* random, |
SkAutoTUnref<SkShader> shader(SkGradientShader::CreateSweep(center.fX, center.fY, |
colors, stops, colorCount)); |
SkPaint paint; |
- return shader->asNewEffect(context, paint); |
+ return shader->asNewEffect(context, paint, NULL); |
} |
///////////////////////////////////////////////////////////////////// |
@@ -279,11 +279,19 @@ void GrGLSweepGradient::emitCode(GrGLShaderBuilder* builder, |
///////////////////////////////////////////////////////////////////// |
-GrEffectRef* SkSweepGradient::asNewEffect(GrContext* context, const SkPaint&) const { |
+GrEffectRef* SkSweepGradient::asNewEffect(GrContext* context, const SkPaint&, |
+ const SkMatrix* localMatrix) const { |
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 GrSweepGradient::Create(context, *this, matrix); |
} |