diff options
author | reed <reed@google.com> | 2015-05-04 08:32:51 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-04 08:32:51 -0700 |
commit | 71a6cbfc585959738dc0b375603696ca7f60605f (patch) | |
tree | 308b974c044f356dbc0e0b6599e0be275f5b4f94 /samplecode | |
parent | f603fb3d0e5fa57c3f228d66945bef198b001135 (diff) |
remove redundant/deprecated TwoPointRadial gradiet -- use TwoPointConical
This CL derived from https://codereview.chromium.org/1114243005/
BUG=skia:
Review URL: https://codereview.chromium.org/1117423003
Diffstat (limited to 'samplecode')
-rw-r--r-- | samplecode/Sample2PtRadial.cpp | 10 | ||||
-rw-r--r-- | samplecode/SampleGradients.cpp | 10 | ||||
-rw-r--r-- | samplecode/SampleShaderText.cpp | 6 | ||||
-rw-r--r-- | samplecode/SampleSlides.cpp | 6 |
4 files changed, 16 insertions, 16 deletions
diff --git a/samplecode/Sample2PtRadial.cpp b/samplecode/Sample2PtRadial.cpp index 073fd8241b..764c2b129c 100644 --- a/samplecode/Sample2PtRadial.cpp +++ b/samplecode/Sample2PtRadial.cpp @@ -11,15 +11,15 @@ #include "SkGradientShader.h" -class TwoPtRadialView : public SampleView { +class TwoPtConicalView : public SampleView { public: - TwoPtRadialView() {} + TwoPtConicalView() {} protected: // overrides from SkEventSink virtual bool onQuery(SkEvent* evt) { if (SampleCode::TitleQ(*evt)) { - SampleCode::TitleR(evt, "2PtRadial"); + SampleCode::TitleR(evt, "2PtConical"); return true; } return this->INHERITED::onQuery(evt); @@ -33,7 +33,7 @@ protected: SkScalar r0 = 100; SkPoint c1 = { 100, 100 }; SkScalar r1 = 100; - SkShader* s = SkGradientShader::CreateTwoPointRadial(c0, r0, c1, r1, colors, + SkShader* s = SkGradientShader::CreateTwoPointConical(c0, r0, c1, r1, colors, NULL, 2, SkShader::kClamp_TileMode); @@ -48,5 +48,5 @@ private: ////////////////////////////////////////////////////////////////////////////// -static SkView* MyFactory() { return new TwoPtRadialView; } +static SkView* MyFactory() { return new TwoPtConicalView; } static SkViewRegister reg(MyFactory); diff --git a/samplecode/SampleGradients.cpp b/samplecode/SampleGradients.cpp index f328d761a5..12d24d2ae4 100644 --- a/samplecode/SampleGradients.cpp +++ b/samplecode/SampleGradients.cpp @@ -82,24 +82,24 @@ static SkShader* MakeSweep(const SkPoint pts[2], const GradData& data, SkShader: 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) { +static SkShader* Make2Conical(const SkPoint pts[2], const GradData& data, SkShader::TileMode tm) { SkPoint center0, center1; center0.set(SkScalarAve(pts[0].fX, pts[1].fX), SkScalarAve(pts[0].fY, pts[1].fY)); center1.set(SkScalarInterp(pts[0].fX, pts[1].fX, SkIntToScalar(3)/5), SkScalarInterp(pts[0].fY, pts[1].fY, SkIntToScalar(1)/4)); - return SkGradientShader::CreateTwoPointRadial( + 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); } -static SkShader* Make2RadialConcentric(const SkPoint pts[2], const GradData& data, +static SkShader* Make2ConicalConcentric(const SkPoint pts[2], const GradData& data, SkShader::TileMode tm) { SkPoint center; center.set(SkScalarAve(pts[0].fX, pts[1].fX), SkScalarAve(pts[0].fY, pts[1].fY)); - return SkGradientShader::CreateTwoPointRadial( + return SkGradientShader::CreateTwoPointConical( center, (pts[1].fX - pts[0].fX) / 7, center, (pts[1].fX - pts[0].fX) / 2, data.fColors, data.fPos, data.fCount, tm); @@ -108,7 +108,7 @@ static SkShader* Make2RadialConcentric(const SkPoint pts[2], const GradData& dat typedef SkShader* (*GradMaker)(const SkPoint pts[2], const GradData& data, SkShader::TileMode tm); static const GradMaker gGradMakers[] = { - MakeLinear, MakeRadial, MakeSweep, Make2Radial, Make2RadialConcentric + MakeLinear, MakeRadial, MakeSweep, Make2Conical, Make2ConicalConcentric }; /////////////////////////////////////////////////////////////////////////////// diff --git a/samplecode/SampleShaderText.cpp b/samplecode/SampleShaderText.cpp index 89abfc2345..9fdae842ab 100644 --- a/samplecode/SampleShaderText.cpp +++ b/samplecode/SampleShaderText.cpp @@ -72,13 +72,13 @@ static SkShader* MakeSweep(const SkPoint pts[2], const GradData& data, SkShader: 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) { +static SkShader* Make2Conical(const SkPoint pts[2], const GradData& data, SkShader::TileMode tm) { SkPoint center0, center1; center0.set(SkScalarAve(pts[0].fX, pts[1].fX), SkScalarAve(pts[0].fY, pts[1].fY)); center1.set(SkScalarInterp(pts[0].fX, pts[1].fX, SkIntToScalar(3)/5), SkScalarInterp(pts[0].fY, pts[1].fY, SkIntToScalar(1)/4)); - return SkGradientShader::CreateTwoPointRadial( + 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); @@ -87,7 +87,7 @@ static SkShader* Make2Radial(const SkPoint pts[2], const GradData& data, SkShade typedef SkShader* (*GradMaker)(const SkPoint pts[2], const GradData& data, SkShader::TileMode tm); static const GradMaker gGradMakers[] = { - MakeLinear, MakeRadial, MakeSweep, Make2Radial + MakeLinear, MakeRadial, MakeSweep, Make2Conical }; /////////////////////////////////////////////////////////////////////////////// diff --git a/samplecode/SampleSlides.cpp b/samplecode/SampleSlides.cpp index 6899fc111e..83e91bb4d6 100644 --- a/samplecode/SampleSlides.cpp +++ b/samplecode/SampleSlides.cpp @@ -197,13 +197,13 @@ static SkShader* MakeSweep(const SkPoint pts[2], const GradData& data, SkShader: 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) { +static SkShader* Make2Conical(const SkPoint pts[2], const GradData& data, SkShader::TileMode tm) { SkPoint center0, center1; center0.set(SkScalarAve(pts[0].fX, pts[1].fX), SkScalarAve(pts[0].fY, pts[1].fY)); center1.set(SkScalarInterp(pts[0].fX, pts[1].fX, SkIntToScalar(3)/5), SkScalarInterp(pts[0].fY, pts[1].fY, SkIntToScalar(1)/4)); - return SkGradientShader::CreateTwoPointRadial( + 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); @@ -211,7 +211,7 @@ static SkShader* Make2Radial(const SkPoint pts[2], const GradData& data, SkShade typedef SkShader* (*GradMaker)(const SkPoint pts[2], const GradData& data, SkShader::TileMode tm); static const GradMaker gGradMakers[] = { - MakeLinear, MakeRadial, MakeSweep, Make2Radial + MakeLinear, MakeRadial, MakeSweep, Make2Conical }; static void gradient_slide(SkCanvas* canvas) { |