From 588f879677d4f36e16a42dd96876534f104c2e2f Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Wed, 30 May 2018 11:33:20 -0400 Subject: warmup, remove clamping in append_gamut_transform() Clamping here seems inconsistent with our color pipeline model, and with the existing GPU impl. The SkRasterPipeline store stages already do clamp when storing unorms, and table-lookup stages clamp their inputs, so it should be safe. While refactoring, slim its interface down a bit. Change-Id: I4772457fdf90e483834d034f02974d7a859cbe24 Reviewed-on: https://skia-review.googlesource.com/130902 Reviewed-by: Brian Osman Commit-Queue: Mike Klein --- src/effects/SkToSRGBColorFilter.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/effects') diff --git a/src/effects/SkToSRGBColorFilter.cpp b/src/effects/SkToSRGBColorFilter.cpp index d2020ef338..8ea0826c2f 100644 --- a/src/effects/SkToSRGBColorFilter.cpp +++ b/src/effects/SkToSRGBColorFilter.cpp @@ -37,13 +37,12 @@ void SkToSRGBColorFilter::onAppendStages(SkRasterPipeline* p, // TODO: If we really need to handle this, we can, but I don't think Ganesh does. } - // Step 2: Transform to sRGB gamut, without clamping. - // TODO: because... - float* gamut_transform = alloc->makeArrayDefault(12); - (void)append_gamut_transform_noclamp(p, - gamut_transform, - fSrcColorSpace.get(), - SkColorSpace::MakeSRGB().get()); + // Step 2: Transform to sRGB gamut (without clamping). + append_gamut_transform(p, + alloc, + fSrcColorSpace.get(), + SkColorSpace::MakeSRGB().get(), + kPremul_SkAlphaType); // Step 3: Back to sRGB encoding. p->append(SkRasterPipeline::to_srgb); -- cgit v1.2.3