aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/gradients
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-05-11 10:59:22 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-12 11:38:49 +0000
commit5c7960be57010bf61db3d4ce879a3194687b5af9 (patch)
tree9ccdfd2230214173d19db29f206d1af2197f2787 /src/effects/gradients
parentdf3a371c904c2e3e1d3d9201b7dfc0d080e5f12a (diff)
refactor gradient stage names
This is just a name refactor and I'm happy to delay it until we're done with the current wave of gradient CLs. The main ideas: - we use the "linear_gradient" stages for all gradients, so cut the "linear" and just call them "gradient"; - remind ourselves that the 2-stop stage requires even spacing, i.e. stops at 0 and 1. This name should harmonize with Herb's new general evenly spaced gradient stage, currently "evenly_spaced_linear_gradient", and after it lands and I rebase, "evenly_spaced_gradient" - remind ourselves which polar coordinate xy_to_polar_unit returns, the angle. Change-Id: I0fd0c8bd4c1ead7d2d0fff45a199d318b71f34ac Reviewed-on: https://skia-review.googlesource.com/16500 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Reed <reed@google.com>
Diffstat (limited to 'src/effects/gradients')
-rw-r--r--src/effects/gradients/SkGradientShader.cpp6
-rw-r--r--src/effects/gradients/SkSweepGradient.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp
index 6f9b404015..042ad458c8 100644
--- a/src/effects/gradients/SkGradientShader.cpp
+++ b/src/effects/gradients/SkGradientShader.cpp
@@ -380,7 +380,7 @@ bool SkGradientShaderBase::onAppendStages(SkRasterPipeline* p,
if (!fOrigPos) {
// We clamp only when the stops are evenly spaced.
// If not, there may be hard stops, and clamping ruins hard stops at 0 and/or 1.
- // In that case, we must make sure we're using the general linear_gradient stage,
+ // In that case, we must make sure we're using the general "gradient" stage,
// which is the only stage that will correctly handle unclamped t.
p->append(SkRasterPipeline::clamp_x, alloc->make<float>(1));
}
@@ -404,7 +404,7 @@ bool SkGradientShaderBase::onAppendStages(SkRasterPipeline* p,
f_and_b[0] = SkPM4f::From4f(c_r.to4f() - c_l.to4f());
f_and_b[1] = c_l;
- p->append(SkRasterPipeline::linear_gradient_2stops, f_and_b);
+ p->append(SkRasterPipeline::evenly_spaced_2_stop_gradient, f_and_b);
} else {
struct Stop { float t; SkPM4f f, b; };
@@ -493,7 +493,7 @@ bool SkGradientShaderBase::onAppendStages(SkRasterPipeline* p,
ctx->stops = stopsArray;
}
- p->append(SkRasterPipeline::linear_gradient, ctx);
+ p->append(SkRasterPipeline::gradient, ctx);
}
if (!premulGrad && !this->colorsAreOpaque()) {
diff --git a/src/effects/gradients/SkSweepGradient.cpp b/src/effects/gradients/SkSweepGradient.cpp
index b3a24cd16e..df571e9ea8 100644
--- a/src/effects/gradients/SkSweepGradient.cpp
+++ b/src/effects/gradients/SkSweepGradient.cpp
@@ -315,7 +315,7 @@ bool SkSweepGradient::adjustMatrixAndAppendStages(SkArenaAlloc* alloc,
SkMatrix* matrix,
SkRasterPipeline* p) const {
matrix->postTranslate(-fCenter.fX, -fCenter.fY);
- p->append(SkRasterPipeline::xy_to_polar_unit);
+ p->append(SkRasterPipeline::xy_to_unit_angle);
return true;
}