Index: src/effects/gradients/SkLinearGradient.cpp |
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp |
index f37759c1a94ff416b8ce8b0e19444409fcd7e861..4fe65470aeb6b407f778687332350690e85e5942 100644 |
--- a/src/effects/gradients/SkLinearGradient.cpp |
+++ b/src/effects/gradients/SkLinearGradient.cpp |
@@ -527,7 +527,7 @@ GrEffectRef* GrLinearGradient::TestCreate(SkRandom* random, |
colors, stops, colorCount, |
tm)); |
SkPaint paint; |
- return shader->asNewEffect(context, paint); |
+ return shader->asNewEffect(context, paint, NULL); |
} |
///////////////////////////////////////////////////////////////////// |
@@ -547,12 +547,20 @@ void GrGLLinearGradient::emitCode(GrGLShaderBuilder* builder, |
///////////////////////////////////////////////////////////////////// |
-GrEffectRef* SkLinearGradient::asNewEffect(GrContext* context, const SkPaint&) const { |
+GrEffectRef* SkLinearGradient::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 GrLinearGradient::Create(context, *this, matrix, fTileMode); |
} |