Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Unified Diff: bench/GradientBench.cpp

Issue 288313009: Remove unused (by clients) SkUnitMapper (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | expectations/gm/ignored-tests.txt » ('j') | gyp/skia_for_chromium_defines.gypi » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/GradientBench.cpp
diff --git a/bench/GradientBench.cpp b/bench/GradientBench.cpp
index 55e777d8fbe5ba3be58a69d8d928b0842d89b4bd..fa07bce4fd1f1404f686b9ee44584765782b226e 100644
--- a/bench/GradientBench.cpp
+++ b/bench/GradientBench.cpp
@@ -13,7 +13,6 @@
#include "SkPaint.h"
#include "SkShader.h"
#include "SkString.h"
-#include "SkUnitMapper.h"
struct GradData {
int fCount;
@@ -45,38 +44,33 @@ static const GradData gGradData[] = {
/// Ignores scale
static SkShader* MakeLinear(const SkPoint pts[2], const GradData& data,
- SkShader::TileMode tm, SkUnitMapper* mapper,
- float scale) {
- return SkGradientShader::CreateLinear(pts, data.fColors, data.fPos,
- data.fCount, tm, mapper);
+ SkShader::TileMode tm, float scale) {
+ return SkGradientShader::CreateLinear(pts, data.fColors, data.fPos, data.fCount, tm);
}
static SkShader* MakeRadial(const SkPoint pts[2], const GradData& data,
- SkShader::TileMode tm, SkUnitMapper* mapper,
- float scale) {
+ SkShader::TileMode tm, float scale) {
SkPoint center;
center.set(SkScalarAve(pts[0].fX, pts[1].fX),
SkScalarAve(pts[0].fY, pts[1].fY));
return SkGradientShader::CreateRadial(center, center.fX * scale,
data.fColors,
- data.fPos, data.fCount, tm, mapper);
+ data.fPos, data.fCount, tm);
}
/// Ignores scale
static SkShader* MakeSweep(const SkPoint pts[2], const GradData& data,
- SkShader::TileMode tm, SkUnitMapper* mapper,
- float scale) {
+ SkShader::TileMode tm, float scale) {
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, mapper);
+ data.fPos, data.fCount);
}
/// Ignores scale
static SkShader* Make2Radial(const SkPoint pts[2], const GradData& data,
- SkShader::TileMode tm, SkUnitMapper* mapper,
- float scale) {
+ SkShader::TileMode tm, float scale) {
SkPoint center0, center1;
center0.set(SkScalarAve(pts[0].fX, pts[1].fX),
SkScalarAve(pts[0].fY, pts[1].fY));
@@ -85,13 +79,12 @@ static SkShader* Make2Radial(const SkPoint pts[2], const GradData& data,
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, mapper);
+ data.fColors, data.fPos, data.fCount, tm);
}
/// Ignores scale
static SkShader* MakeConical(const SkPoint pts[2], const GradData& data,
- SkShader::TileMode tm, SkUnitMapper* mapper,
- float scale) {
+ SkShader::TileMode tm, float scale) {
SkPoint center0, center1;
center0.set(SkScalarAve(pts[0].fX, pts[1].fX),
SkScalarAve(pts[0].fY, pts[1].fY));
@@ -99,13 +92,12 @@ static SkShader* MakeConical(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);
}
/// Ignores scale
static SkShader* MakeConicalZeroRad(const SkPoint pts[2], const GradData& data,
- SkShader::TileMode tm, SkUnitMapper* mapper,
- float scale) {
+ SkShader::TileMode tm, float scale) {
SkPoint center0, center1;
center0.set(SkScalarAve(pts[0].fX, pts[1].fX),
SkScalarAve(pts[0].fY, pts[1].fY));
@@ -113,13 +105,12 @@ static SkShader* MakeConicalZeroRad(const SkPoint pts[2], const GradData& data,
SkScalarInterp(pts[0].fY, pts[1].fY, SkIntToScalar(1)/4));
return SkGradientShader::CreateTwoPointConical(center1, 0.0,
center0, (pts[1].fX - pts[0].fX) / 2,
- data.fColors, data.fPos, data.fCount, tm, mapper);
+ data.fColors, data.fPos, data.fCount, tm);
}
/// Ignores scale
static SkShader* MakeConicalOutside(const SkPoint pts[2], const GradData& data,
- SkShader::TileMode tm, SkUnitMapper* mapper,
- float scale) {
+ SkShader::TileMode tm, float scale) {
SkPoint center0, center1;
SkScalar radius0 = SkScalarDiv(pts[1].fX - pts[0].fX, 10);
SkScalar radius1 = SkScalarDiv(pts[1].fX - pts[0].fX, 3);
@@ -128,13 +119,12 @@ static SkShader* MakeConicalOutside(const SkPoint pts[2], const GradData& data,
return SkGradientShader::CreateTwoPointConical(center0, radius0,
center1, radius1,
data.fColors, data.fPos,
- data.fCount, tm, mapper);
+ data.fCount, tm);
}
/// Ignores scale
static SkShader* MakeConicalOutsideZeroRad(const SkPoint pts[2], const GradData& data,
- SkShader::TileMode tm, SkUnitMapper* mapper,
- float scale) {
+ SkShader::TileMode tm, float scale) {
SkPoint center0, center1;
SkScalar radius0 = SkScalarDiv(pts[1].fX - pts[0].fX, 10);
SkScalar radius1 = SkScalarDiv(pts[1].fX - pts[0].fX, 3);
@@ -143,12 +133,11 @@ static SkShader* MakeConicalOutsideZeroRad(const SkPoint pts[2], const GradData&
return SkGradientShader::CreateTwoPointConical(center0, 0.0,
center1, radius1,
data.fColors, data.fPos,
- data.fCount, tm, mapper);
+ data.fCount, tm);
}
typedef SkShader* (*GradMaker)(const SkPoint pts[2], const GradData& data,
- SkShader::TileMode tm, SkUnitMapper* mapper,
- float scale);
+ SkShader::TileMode tm, float scale);
static const struct {
GradMaker fMaker;
@@ -240,7 +229,7 @@ public:
{ SkIntToScalar(W), SkIntToScalar(H) }
};
- fShader = gGrads[gradType].fMaker(pts, data, tm, NULL, scale);
+ fShader = gGrads[gradType].fMaker(pts, data, tm, scale);
fGeomType = geomType;
}
« no previous file with comments | « no previous file | expectations/gm/ignored-tests.txt » ('j') | gyp/skia_for_chromium_defines.gypi » ('J')

Powered by Google App Engine
This is Rietveld 408576698