Index: samplecode/SampleSlides.cpp |
diff --git a/samplecode/SampleSlides.cpp b/samplecode/SampleSlides.cpp |
index 6bc9a28fd3716615dac573f1c0ee461068de3325..d828ae601f4470e5978231d30b6a2e68719e8496 100644 |
--- a/samplecode/SampleSlides.cpp |
+++ b/samplecode/SampleSlides.cpp |
@@ -178,26 +178,32 @@ |
{ 5, gColors, gPos2 } |
}; |
-static SkShader* MakeLinear(const SkPoint pts[2], const GradData& data, SkShader::TileMode tm) { |
- return SkGradientShader::CreateLinear(pts, data.fColors, data.fPos, data.fCount, tm); |
-} |
- |
-static SkShader* MakeRadial(const SkPoint pts[2], const GradData& data, SkShader::TileMode tm) { |
+static SkShader* MakeLinear(const SkPoint pts[2], const GradData& data, |
+ SkShader::TileMode tm, SkUnitMapper* mapper) { |
+ return SkGradientShader::CreateLinear(pts, data.fColors, data.fPos, |
+ data.fCount, tm, mapper); |
+} |
+ |
+static SkShader* MakeRadial(const SkPoint pts[2], const GradData& data, |
+ SkShader::TileMode tm, SkUnitMapper* mapper) { |
SkPoint center; |
center.set(SkScalarAve(pts[0].fX, pts[1].fX), |
SkScalarAve(pts[0].fY, pts[1].fY)); |
return SkGradientShader::CreateRadial(center, center.fX, data.fColors, |
- data.fPos, data.fCount, tm); |
-} |
- |
-static SkShader* MakeSweep(const SkPoint pts[2], const GradData& data, SkShader::TileMode tm) { |
+ data.fPos, data.fCount, tm, mapper); |
+} |
+ |
+static SkShader* MakeSweep(const SkPoint pts[2], const GradData& data, |
+ SkShader::TileMode tm, SkUnitMapper* mapper) { |
SkPoint center; |
center.set(SkScalarAve(pts[0].fX, pts[1].fX), |
SkScalarAve(pts[0].fY, pts[1].fY)); |
- return SkGradientShader::CreateSweep(center.fX, center.fY, data.fColors, data.fPos, data.fCount); |
-} |
- |
-static SkShader* Make2Radial(const SkPoint pts[2], const GradData& data, SkShader::TileMode tm) { |
+ return SkGradientShader::CreateSweep(center.fX, center.fY, data.fColors, |
+ data.fPos, data.fCount, mapper); |
+} |
+ |
+static SkShader* Make2Radial(const SkPoint pts[2], const GradData& data, |
+ SkShader::TileMode tm, SkUnitMapper* mapper) { |
SkPoint center0, center1; |
center0.set(SkScalarAve(pts[0].fX, pts[1].fX), |
SkScalarAve(pts[0].fY, pts[1].fY)); |
@@ -206,10 +212,11 @@ |
return SkGradientShader::CreateTwoPointRadial( |
center1, (pts[1].fX - pts[0].fX) / 7, |
center0, (pts[1].fX - pts[0].fX) / 2, |
- data.fColors, data.fPos, data.fCount, tm); |
-} |
- |
-typedef SkShader* (*GradMaker)(const SkPoint pts[2], const GradData& data, SkShader::TileMode tm); |
+ data.fColors, data.fPos, data.fCount, tm, mapper); |
+} |
+ |
+typedef SkShader* (*GradMaker)(const SkPoint pts[2], const GradData& data, |
+ SkShader::TileMode tm, SkUnitMapper* mapper); |
static const GradMaker gGradMakers[] = { |
MakeLinear, MakeRadial, MakeSweep, Make2Radial |
}; |
@@ -229,7 +236,7 @@ |
for (size_t i = 0; i < SK_ARRAY_COUNT(gGradData); i++) { |
canvas->save(); |
for (size_t j = 0; j < SK_ARRAY_COUNT(gGradMakers); j++) { |
- SkShader* shader = gGradMakers[j](pts, gGradData[i], tm); |
+ SkShader* shader = gGradMakers[j](pts, gGradData[i], tm, NULL); |
paint.setShader(shader); |
canvas->drawRect(r, paint); |
shader->unref(); |
@@ -328,7 +335,7 @@ |
{ SkIntToScalar(size.fX), SkIntToScalar(size.fY) } }; |
SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorRED }; |
return SkGradientShader::CreateLinear(pts, colors, NULL, |
- SK_ARRAY_COUNT(colors), SkShader::kMirror_TileMode); |
+ SK_ARRAY_COUNT(colors), SkShader::kMirror_TileMode, NULL); |
} |
class Rec { |