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

Unified Diff: samplecode/SampleGradients.cpp

Issue 1114243005: remove (redundant) twopointradial shader (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 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 | « samplecode/Sample2PtRadial.cpp ('k') | samplecode/SampleShaderText.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleGradients.cpp
diff --git a/samplecode/SampleGradients.cpp b/samplecode/SampleGradients.cpp
index f328d761a5ef9c019ff21349b4b49da67c8127bf..12d24d2ae4f3713f0e1d27b91a56e0afb3b30be7 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
};
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « samplecode/Sample2PtRadial.cpp ('k') | samplecode/SampleShaderText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698