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>
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp
index 6f9b404..042ad45 100644
--- a/src/effects/gradients/SkGradientShader.cpp
+++ b/src/effects/gradients/SkGradientShader.cpp
@@ -380,7 +380,7 @@
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 @@
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 @@
ctx->stops = stopsArray;
}
- p->append(SkRasterPipeline::linear_gradient, ctx);
+ p->append(SkRasterPipeline::gradient, ctx);
}
if (!premulGrad && !this->colorsAreOpaque()) {