aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2018-07-11 14:49:51 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-11 20:14:38 +0000
commit4eebd9eed06039d265f06edb759765731f963271 (patch)
treea60d5bf110250ad75593977b39fdf93a019c1fff /tests
parentc0a27081722eaebd005cf9c2eb78d7d1e4db7e2c (diff)
collapse parametric_{r,g,b} into parametric, remove _a and gamma_dst
parametric_a and gamma_dst were unused outside of unit tests. In all other cases, we always use parametric_{r,g,b} together and always pass them the same argument. So we can collapse them into a single stage like gamma and to/from_srgb. Change-Id: I08cea896c7744f97b4f4bf9e029f5d643e45e177 Reviewed-on: https://skia-review.googlesource.com/140576 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/ParametricStageTest.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/ParametricStageTest.cpp b/tests/ParametricStageTest.cpp
index 6d98ac451b..1b943e9fbf 100644
--- a/tests/ParametricStageTest.cpp
+++ b/tests/ParametricStageTest.cpp
@@ -22,10 +22,7 @@ static void check_error(skiatest::Reporter* r, float limit, SkColorSpaceTransfer
SkRasterPipeline_<256> p;
p.append(SkRasterPipeline::load_f32, &ip);
- p.append(SkRasterPipeline::parametric_r, &fn);
- p.append(SkRasterPipeline::parametric_g, &fn);
- p.append(SkRasterPipeline::parametric_b, &fn);
- p.append(SkRasterPipeline::parametric_a, &fn);
+ p.append(SkRasterPipeline::parametric, &fn);
p.append(SkRasterPipeline::store_f32, &op);
p.run(0,0, 256/4,1);
@@ -34,6 +31,9 @@ static void check_error(skiatest::Reporter* r, float limit, SkColorSpaceTransfer
for (int i = 0; i < 256; i++) {
float want = (in[i] <= fn.fD) ? fn.fC * in[i] + fn.fF
: powf(in[i] * fn.fA + fn.fB, fn.fG) + fn.fE;
+ if (i % 4 == 3) { // alpha should stay unchanged.
+ want = in[i];
+ }
float err = fabsf(out[i] - want);
if (err > limit) {
ERRORF(r, "At %d, error was %g (got %g, want %g)", i, err, out[i], want);