Index: gm/shaderbounds.cpp |
diff --git a/gm/shaderbounds.cpp b/gm/shaderbounds.cpp |
index ef9a7e9015e3b042c5804a93c10261136db0832e..2a52ead04ba4ba2ac530beb4539f99800c25c1c1 100644 |
--- a/gm/shaderbounds.cpp |
+++ b/gm/shaderbounds.cpp |
@@ -9,7 +9,8 @@ |
namespace skiagm { |
-static SkShader* MakeLinear(SkScalar width, SkScalar height, bool alternate) { |
+static SkShader* MakeLinear(SkScalar width, SkScalar height, bool alternate, |
+ const SkMatrix& localMatrix) { |
SkPoint pts[2] = { {0, 0}, {width, height}}; |
SkColor colors[2] = {SK_ColorRED, SK_ColorGREEN}; |
if (alternate) { |
@@ -18,7 +19,7 @@ static SkShader* MakeLinear(SkScalar width, SkScalar height, bool alternate) { |
colors[1] = SK_ColorYELLOW; |
} |
return SkGradientShader::CreateLinear(pts, colors, NULL, 2, |
- SkShader::kClamp_TileMode, NULL); |
+ SkShader::kClamp_TileMode, NULL, 0, &localMatrix); |
} |
/////////////////////////////////////////////////////////////////////////////// |
@@ -26,7 +27,7 @@ static SkShader* MakeLinear(SkScalar width, SkScalar height, bool alternate) { |
class ShaderBoundsGM : public GM { |
public: |
typedef SkShader* (*ShaderGenFunc)(SkScalar width, SkScalar height, |
- bool alternate); |
+ bool alternate, const SkMatrix& localMatrix); |
ShaderBoundsGM(ShaderGenFunc maker, const SkString& name) |
: fShaderMaker(maker), |
fName(name) { |
@@ -80,10 +81,9 @@ protected: |
} |
SkScalar shaderWidth = SkScalarDiv(SkIntToScalar(width), scale); |
SkScalar shaderHeight = SkScalarDiv(SkIntToScalar(height), scale); |
- SkShader* shader = fShaderMaker(shaderWidth, shaderHeight, background); |
SkMatrix shaderScale; |
shaderScale.setScale(scale, scale); |
- shader->setLocalMatrix(shaderScale); |
+ SkShader* shader = fShaderMaker(shaderWidth, shaderHeight, background, shaderScale); |
return shader; |
} |