Index: src/effects/gradients/SkSweepGradient.cpp |
diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp |
index 2493060e99e739171ca9cece8e399e9db8f10a56..6e91e2ba257c229fdda83f7fb2f9d1b2eacd3b1c 100644 |
--- a/src/effects/gradients/SkSweepGradient.cpp |
+++ b/src/effects/gradients/SkSweepGradient.cpp |
@@ -8,12 +8,16 @@ |
#include "SkSweepGradient.h" |
+static SkMatrix translate(SkScalar dx, SkScalar dy) { |
+ SkMatrix matrix; |
+ matrix.setTranslate(dx, dy); |
+ return matrix; |
+} |
+ |
SkSweepGradient::SkSweepGradient(SkScalar cx, SkScalar cy, const Descriptor& desc) |
- : SkGradientShaderBase(desc) |
+ : SkGradientShaderBase(desc, translate(-cx, -cy)) |
, fCenter(SkPoint::Make(cx, cy)) |
{ |
- fPtsToUnit.setTranslate(-cx, -cy); |
- |
// overwrite the tilemode to a canonical value (since sweep ignores it) |
fTileMode = SkShader::kClamp_TileMode; |
} |