Index: gm/gradient_matrix.cpp |
diff --git a/gm/gradient_matrix.cpp b/gm/gradient_matrix.cpp |
index d1d0e42d6ea163619a3be64a2cb6ba861e938859..b2bc5d1cd8e709fc5e62ef7e2f2c402d2f85391a 100644 |
--- a/gm/gradient_matrix.cpp |
+++ b/gm/gradient_matrix.cpp |
@@ -61,21 +61,22 @@ static const SkScalar TESTGRID_Y = SkIntToScalar(200); |
static const int IMAGES_X = 4; // number of images per row |
-static SkShader* make_linear_gradient(const SkPoint pts[2]) { |
+static SkShader* make_linear_gradient(const SkPoint pts[2], const SkMatrix& localMatrix) { |
return SkGradientShader::CreateLinear(pts, gColors, NULL, SK_ARRAY_COUNT(gColors), |
- SkShader::kClamp_TileMode, NULL); |
+ SkShader::kClamp_TileMode, NULL, 0, &localMatrix); |
} |
-static SkShader* make_radial_gradient(const SkPoint pts[2]) { |
+static SkShader* make_radial_gradient(const SkPoint pts[2], const SkMatrix& localMatrix) { |
SkPoint center; |
center.set(SkScalarAve(pts[0].fX, pts[1].fX), |
SkScalarAve(pts[0].fY, pts[1].fY)); |
float radius = (center - pts[0]).length(); |
return SkGradientShader::CreateRadial(center, radius, gColors, NULL, SK_ARRAY_COUNT(gColors), |
- SkShader::kClamp_TileMode, NULL); |
+ SkShader::kClamp_TileMode, NULL, 0, &localMatrix); |
} |
-static void draw_gradients(SkCanvas* canvas, SkShader* (*makeShader)(const SkPoint[2]), |
+static void draw_gradients(SkCanvas* canvas, |
+ SkShader* (*makeShader)(const SkPoint[2], const SkMatrix&), |
const SkPoint ptsArray[][2], int numImages) { |
// Use some nice prime numbers for the rectangle and matrix with |
// different scaling along the x and y axes (which is the bug this |
@@ -97,8 +98,7 @@ static void draw_gradients(SkCanvas* canvas, SkShader* (*makeShader)(const SkPoi |
} |
// Setup shader and draw. |
- SkAutoTUnref<SkShader> shader(makeShader(*ptsArray)); |
- shader->setLocalMatrix(shaderMat); |
+ SkAutoTUnref<SkShader> shader(makeShader(*ptsArray, shaderMat)); |
SkPaint paint; |
paint.setShader(shader); |