Make SkShader store localM directly rather than as a separate alloc.
May cause very slight GM changes in gpu two pt radial/conical radients.
Review URL: https://codereview.appspot.com/6821056
git-svn-id: http://skia.googlecode.com/svn/trunk@6221 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/effects/gradients/SkRadialGradient.cpp b/src/effects/gradients/SkRadialGradient.cpp
index 4766af6..a20ea35 100644
--- a/src/effects/gradients/SkRadialGradient.cpp
+++ b/src/effects/gradients/SkRadialGradient.cpp
@@ -567,19 +567,13 @@
bool SkRadialGradient::asNewEffect(GrContext* context, GrEffectStage* stage) const {
SkASSERT(NULL != context && NULL != stage);
- SkAutoTUnref<GrEffect> effect(SkNEW_ARGS(GrRadialGradient, (context, *this, fTileMode)));
SkMatrix matrix;
- if (this->getLocalMatrix(&matrix)) {
- if (!matrix.invert(&matrix)) {
- return false;
- }
- matrix.postConcat(fPtsToUnit);
- stage->setEffect(effect, matrix);
- } else {
- stage->setEffect(effect, fPtsToUnit);
+ if (!this->getLocalMatrix().invert(&matrix)) {
+ return false;
}
-
+ matrix.postConcat(fPtsToUnit);
+ stage->setEffect(SkNEW_ARGS(GrRadialGradient, (context, *this, fTileMode)), matrix)->unref();
return true;
}