From 4eebd9eed06039d265f06edb759765731f963271 Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Wed, 11 Jul 2018 14:49:51 -0400 Subject: 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 Reviewed-by: Brian Osman --- tests/ParametricStageTest.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') 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); -- cgit v1.2.3