Index: gm/gradients_2pt_conical.cpp |
diff --git a/gm/gradients_2pt_conical.cpp b/gm/gradients_2pt_conical.cpp |
index dece66ed8b2aa6ab2c29f40a15da229ff92694d8..27f0da186d1dd324e943e6f2552269aab809ff17 100644 |
--- a/gm/gradients_2pt_conical.cpp |
+++ b/gm/gradients_2pt_conical.cpp |
@@ -1,10 +1,10 @@ |
- |
/* |
* Copyright 2014 Google Inc. |
* |
* Use of this source code is governed by a BSD-style license that can be |
* found in the LICENSE file. |
*/ |
+ |
#include "gm.h" |
#include "SkGradientShader.h" |
@@ -38,8 +38,7 @@ static const GradData gGradData[] = { |
}; |
static SkShader* Make2ConicalOutside(const SkPoint pts[2], const GradData& data, |
- SkShader::TileMode tm, SkUnitMapper* mapper, |
- const SkMatrix& localMatrix) { |
+ SkShader::TileMode tm, const SkMatrix& localMatrix) { |
SkPoint center0, center1; |
SkScalar radius0 = SkScalarDiv(pts[1].fX - pts[0].fX, 10); |
SkScalar radius1 = SkScalarDiv(pts[1].fX - pts[0].fX, 3); |
@@ -48,13 +47,11 @@ static SkShader* Make2ConicalOutside(const SkPoint pts[2], const GradData& data, |
return SkGradientShader::CreateTwoPointConical(center0, radius0, |
center1, radius1, |
data.fColors, data.fPos, |
- data.fCount, tm, mapper, |
- 0, &localMatrix); |
+ data.fCount, tm, 0, &localMatrix); |
} |
static SkShader* Make2ConicalOutsideFlip(const SkPoint pts[2], const GradData& data, |
- SkShader::TileMode tm, SkUnitMapper* mapper, |
- const SkMatrix& localMatrix) { |
+ SkShader::TileMode tm, const SkMatrix& localMatrix) { |
SkPoint center0, center1; |
SkScalar radius0 = SkScalarDiv(pts[1].fX - pts[0].fX, 10); |
SkScalar radius1 = SkScalarDiv(pts[1].fX - pts[0].fX, 3); |
@@ -63,13 +60,11 @@ static SkShader* Make2ConicalOutsideFlip(const SkPoint pts[2], const GradData& d |
return SkGradientShader::CreateTwoPointConical(center1, radius1, |
center0, radius0, |
data.fColors, data.fPos, |
- data.fCount, tm, mapper, |
- 0, &localMatrix); |
+ data.fCount, tm, 0, &localMatrix); |
} |
static SkShader* Make2ConicalInside(const SkPoint pts[2], const GradData& data, |
- SkShader::TileMode tm, SkUnitMapper* mapper, |
- const SkMatrix& localMatrix) { |
+ SkShader::TileMode tm, const SkMatrix& localMatrix) { |
SkPoint center0, center1; |
center0.set(SkScalarAve(pts[0].fX, pts[1].fX), |
SkScalarAve(pts[0].fY, pts[1].fY)); |
@@ -77,13 +72,12 @@ static SkShader* Make2ConicalInside(const SkPoint pts[2], const GradData& data, |
SkScalarInterp(pts[0].fY, pts[1].fY, SkIntToScalar(1)/4)); |
return SkGradientShader::CreateTwoPointConical(center1, (pts[1].fX - pts[0].fX) / 7, |
center0, (pts[1].fX - pts[0].fX) / 2, |
- data.fColors, data.fPos, data.fCount, tm, mapper, |
+ data.fColors, data.fPos, data.fCount, tm, |
0, &localMatrix); |
} |
static SkShader* Make2ConicalInsideFlip(const SkPoint pts[2], const GradData& data, |
- SkShader::TileMode tm, SkUnitMapper* mapper, |
- const SkMatrix& localMatrix) { |
+ SkShader::TileMode tm, const SkMatrix& localMatrix) { |
SkPoint center0, center1; |
center0.set(SkScalarAve(pts[0].fX, pts[1].fX), |
SkScalarAve(pts[0].fY, pts[1].fY)); |
@@ -91,13 +85,12 @@ static SkShader* Make2ConicalInsideFlip(const SkPoint pts[2], const GradData& da |
SkScalarInterp(pts[0].fY, pts[1].fY, SkIntToScalar(1)/4)); |
return SkGradientShader::CreateTwoPointConical(center0, (pts[1].fX - pts[0].fX) / 2, |
center1, (pts[1].fX - pts[0].fX) / 7, |
- data.fColors, data.fPos, data.fCount, tm, mapper, |
+ data.fColors, data.fPos, data.fCount, tm, |
0, &localMatrix); |
} |
static SkShader* Make2ConicalInsideCenter(const SkPoint pts[2], const GradData& data, |
- SkShader::TileMode tm, SkUnitMapper* mapper, |
- const SkMatrix& localMatrix) { |
+ SkShader::TileMode tm, const SkMatrix& localMatrix) { |
SkPoint center0, center1; |
center0.set(SkScalarAve(pts[0].fX, pts[1].fX), |
SkScalarAve(pts[0].fY, pts[1].fY)); |
@@ -105,13 +98,12 @@ static SkShader* Make2ConicalInsideCenter(const SkPoint pts[2], const GradData& |
SkScalarInterp(pts[0].fY, pts[1].fY, SkIntToScalar(1)/4)); |
return SkGradientShader::CreateTwoPointConical(center0, (pts[1].fX - pts[0].fX) / 7, |
center0, (pts[1].fX - pts[0].fX) / 2, |
- data.fColors, data.fPos, data.fCount, tm, mapper, |
+ data.fColors, data.fPos, data.fCount, tm, |
0, &localMatrix); |
} |
static SkShader* Make2ConicalZeroRad(const SkPoint pts[2], const GradData& data, |
- SkShader::TileMode tm, SkUnitMapper* mapper, |
- const SkMatrix& localMatrix) { |
+ SkShader::TileMode tm, const SkMatrix& localMatrix) { |
SkPoint center0, center1; |
center0.set(SkScalarAve(pts[0].fX, pts[1].fX), |
SkScalarAve(pts[0].fY, pts[1].fY)); |
@@ -119,13 +111,12 @@ static SkShader* Make2ConicalZeroRad(const SkPoint pts[2], const GradData& data, |
SkScalarInterp(pts[0].fY, pts[1].fY, SkIntToScalar(1)/4)); |
return SkGradientShader::CreateTwoPointConical(center1, 0.f, |
center0, (pts[1].fX - pts[0].fX) / 2, |
- data.fColors, data.fPos, data.fCount, tm, mapper, |
+ data.fColors, data.fPos, data.fCount, tm, |
0, &localMatrix); |
} |
static SkShader* Make2ConicalZeroRadFlip(const SkPoint pts[2], const GradData& data, |
- SkShader::TileMode tm, SkUnitMapper* mapper, |
- const SkMatrix& localMatrix) { |
+ SkShader::TileMode tm, const SkMatrix& localMatrix) { |
SkPoint center0, center1; |
center0.set(SkScalarAve(pts[0].fX, pts[1].fX), |
SkScalarAve(pts[0].fY, pts[1].fY)); |
@@ -133,13 +124,12 @@ static SkShader* Make2ConicalZeroRadFlip(const SkPoint pts[2], const GradData& d |
SkScalarInterp(pts[0].fY, pts[1].fY, SkIntToScalar(1)/4)); |
return SkGradientShader::CreateTwoPointConical(center1, (pts[1].fX - pts[0].fX) / 2, |
center0, 0.f, |
- data.fColors, data.fPos, data.fCount, tm, mapper, |
+ data.fColors, data.fPos, data.fCount, tm, |
0, &localMatrix); |
} |
static SkShader* Make2ConicalZeroRadCenter(const SkPoint pts[2], const GradData& data, |
- SkShader::TileMode tm, SkUnitMapper* mapper, |
- const SkMatrix& localMatrix) { |
+ SkShader::TileMode tm, const SkMatrix& localMatrix) { |
SkPoint center0, center1; |
center0.set(SkScalarAve(pts[0].fX, pts[1].fX), |
SkScalarAve(pts[0].fY, pts[1].fY)); |
@@ -147,13 +137,12 @@ static SkShader* Make2ConicalZeroRadCenter(const SkPoint pts[2], const GradData& |
SkScalarInterp(pts[0].fY, pts[1].fY, SkIntToScalar(1)/4)); |
return SkGradientShader::CreateTwoPointConical(center0, 0.f, |
center0, (pts[1].fX - pts[0].fX) / 2, |
- data.fColors, data.fPos, data.fCount, tm, mapper, |
+ data.fColors, data.fPos, data.fCount, tm, |
0, &localMatrix); |
} |
static SkShader* Make2ConicalZeroRadOutside(const SkPoint pts[2], const GradData& data, |
- SkShader::TileMode tm, SkUnitMapper* mapper, |
- const SkMatrix& localMatrix) { |
+ SkShader::TileMode tm, const SkMatrix& localMatrix) { |
SkPoint center0, center1; |
SkScalar radius0 = 0.f; |
SkScalar radius1 = SkScalarDiv(pts[1].fX - pts[0].fX, 3); |
@@ -162,13 +151,11 @@ static SkShader* Make2ConicalZeroRadOutside(const SkPoint pts[2], const GradData |
return SkGradientShader::CreateTwoPointConical(center0, radius0, |
center1, radius1, |
data.fColors, data.fPos, |
- data.fCount, tm, mapper, |
- 0, &localMatrix); |
+ data.fCount, tm, 0, &localMatrix); |
} |
static SkShader* Make2ConicalZeroRadFlipOutside(const SkPoint pts[2], const GradData& data, |
- SkShader::TileMode tm, SkUnitMapper* mapper, |
- const SkMatrix& localMatrix) { |
+ SkShader::TileMode tm, const SkMatrix& localMatrix) { |
SkPoint center0, center1; |
SkScalar radius0 = 0.f; |
SkScalar radius1 = SkScalarDiv(pts[1].fX - pts[0].fX, 3); |
@@ -177,13 +164,11 @@ static SkShader* Make2ConicalZeroRadFlipOutside(const SkPoint pts[2], const Grad |
return SkGradientShader::CreateTwoPointConical(center1, radius1, |
center0, radius0, |
data.fColors, data.fPos, |
- data.fCount, tm, mapper, |
- 0, &localMatrix); |
+ data.fCount, tm, 0, &localMatrix); |
} |
static SkShader* Make2ConicalEdgeX(const SkPoint pts[2], const GradData& data, |
- SkShader::TileMode tm, SkUnitMapper* mapper, |
- const SkMatrix& localMatrix) { |
+ SkShader::TileMode tm, const SkMatrix& localMatrix) { |
SkPoint center0, center1; |
SkScalar radius0 = SkScalarDiv(pts[1].fX - pts[0].fX, 7); |
SkScalar radius1 = SkScalarDiv(pts[1].fX - pts[0].fX, 3); |
@@ -193,13 +178,11 @@ static SkShader* Make2ConicalEdgeX(const SkPoint pts[2], const GradData& data, |
return SkGradientShader::CreateTwoPointConical(center0, radius0, |
center1, radius1, |
data.fColors, data.fPos, |
- data.fCount, tm, mapper, |
- 0, &localMatrix); |
+ data.fCount, tm, 0, &localMatrix); |
} |
static SkShader* Make2ConicalEdgeY(const SkPoint pts[2], const GradData& data, |
- SkShader::TileMode tm, SkUnitMapper* mapper, |
- const SkMatrix& localMatrix) { |
+ SkShader::TileMode tm, const SkMatrix& localMatrix) { |
SkPoint center0, center1; |
SkScalar radius0 = SkScalarDiv(pts[1].fX - pts[0].fX, 7); |
SkScalar radius1 = SkScalarDiv(pts[1].fX - pts[0].fX, 3); |
@@ -209,12 +192,10 @@ static SkShader* Make2ConicalEdgeY(const SkPoint pts[2], const GradData& data, |
return SkGradientShader::CreateTwoPointConical(center0, radius0, |
center1, radius1, |
data.fColors, data.fPos, |
- data.fCount, tm, mapper, |
- 0, &localMatrix); |
+ data.fCount, tm, 0, &localMatrix); |
} |
static SkShader* Make2ConicalZeroRadEdgeX(const SkPoint pts[2], const GradData& data, |
- SkShader::TileMode tm, SkUnitMapper* mapper, |
- const SkMatrix& localMatrix) { |
+ SkShader::TileMode tm, const SkMatrix& localMatrix) { |
SkPoint center0, center1; |
SkScalar radius0 = 0.f; |
SkScalar radius1 = SkScalarDiv(pts[1].fX - pts[0].fX, 3); |
@@ -224,13 +205,11 @@ static SkShader* Make2ConicalZeroRadEdgeX(const SkPoint pts[2], const GradData& |
return SkGradientShader::CreateTwoPointConical(center0, radius0, |
center1, radius1, |
data.fColors, data.fPos, |
- data.fCount, tm, mapper, |
- 0, &localMatrix); |
+ data.fCount, tm, 0, &localMatrix); |
} |
static SkShader* Make2ConicalZeroRadEdgeY(const SkPoint pts[2], const GradData& data, |
- SkShader::TileMode tm, SkUnitMapper* mapper, |
- const SkMatrix& localMatrix) { |
+ SkShader::TileMode tm, const SkMatrix& localMatrix) { |
SkPoint center0, center1; |
SkScalar radius0 = 0.f; |
SkScalar radius1 = SkScalarDiv(pts[1].fX - pts[0].fX, 3); |
@@ -240,13 +219,11 @@ static SkShader* Make2ConicalZeroRadEdgeY(const SkPoint pts[2], const GradData& |
return SkGradientShader::CreateTwoPointConical(center0, radius0, |
center1, radius1, |
data.fColors, data.fPos, |
- data.fCount, tm, mapper, |
- 0, &localMatrix); |
+ data.fCount, tm, 0, &localMatrix); |
} |
static SkShader* Make2ConicalTouchX(const SkPoint pts[2], const GradData& data, |
- SkShader::TileMode tm, SkUnitMapper* mapper, |
- const SkMatrix& localMatrix) { |
+ SkShader::TileMode tm, const SkMatrix& localMatrix) { |
SkPoint center0, center1; |
SkScalar radius0 = SkScalarDiv(pts[1].fX - pts[0].fX, 7); |
SkScalar radius1 = SkScalarDiv(pts[1].fX - pts[0].fX, 3); |
@@ -256,13 +233,11 @@ static SkShader* Make2ConicalTouchX(const SkPoint pts[2], const GradData& data, |
return SkGradientShader::CreateTwoPointConical(center0, radius0, |
center1, radius1, |
data.fColors, data.fPos, |
- data.fCount, tm, mapper, |
- 0, &localMatrix); |
+ data.fCount, tm, 0, &localMatrix); |
} |
static SkShader* Make2ConicalTouchY(const SkPoint pts[2], const GradData& data, |
- SkShader::TileMode tm, SkUnitMapper* mapper, |
- const SkMatrix& localMatrix) { |
+ SkShader::TileMode tm, const SkMatrix& localMatrix) { |
SkPoint center0, center1; |
SkScalar radius0 = SkScalarDiv(pts[1].fX - pts[0].fX, 7); |
SkScalar radius1 = SkScalarDiv(pts[1].fX - pts[0].fX, 3); |
@@ -272,13 +247,11 @@ static SkShader* Make2ConicalTouchY(const SkPoint pts[2], const GradData& data, |
return SkGradientShader::CreateTwoPointConical(center0, radius0, |
center1, radius1, |
data.fColors, data.fPos, |
- data.fCount, tm, mapper, |
- 0, &localMatrix); |
+ data.fCount, tm, 0, &localMatrix); |
} |
static SkShader* Make2ConicalInsideSmallRad(const SkPoint pts[2], const GradData& data, |
- SkShader::TileMode tm, SkUnitMapper* mapper, |
- const SkMatrix& localMatrix) { |
+ SkShader::TileMode tm, const SkMatrix& localMatrix) { |
SkPoint center0, center1; |
center0.set(SkScalarAve(pts[0].fX, pts[1].fX), |
SkScalarAve(pts[0].fY, pts[1].fY)); |
@@ -286,13 +259,12 @@ static SkShader* Make2ConicalInsideSmallRad(const SkPoint pts[2], const GradData |
SkScalarInterp(pts[0].fY, pts[1].fY, SkIntToScalar(1)/4)); |
return SkGradientShader::CreateTwoPointConical(center0, 0.0000000000000000001f, |
center0, (pts[1].fX - pts[0].fX) / 2, |
- data.fColors, data.fPos, data.fCount, tm, mapper, |
+ data.fColors, data.fPos, data.fCount, tm, |
0, &localMatrix); |
} |
typedef SkShader* (*GradMaker)(const SkPoint pts[2], const GradData& data, |
- SkShader::TileMode tm, SkUnitMapper* mapper, |
- const SkMatrix& localMatrix); |
+ SkShader::TileMode tm, const SkMatrix& localMatrix); |
static const GradMaker gGradMakersOutside[] = { |
Make2ConicalOutside, Make2ConicalOutsideFlip, |
@@ -378,7 +350,7 @@ protected: |
scale.postTranslate(25.f, 25.f); |
} |
- SkShader* shader = gradMaker[j](pts, gGradData[i], tm, NULL, scale); |
+ SkShader* shader = gradMaker[j](pts, gGradData[i], tm, scale); |
paint.setShader(shader); |
canvas->drawRect(r, paint); |
shader->unref(); |