diff options
author | Mike Klein <mtklein@chromium.org> | 2018-05-30 11:33:20 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-05-30 17:09:08 +0000 |
commit | 588f879677d4f36e16a42dd96876534f104c2e2f (patch) | |
tree | bdca8a096ff6b997e255924187adee17b538f0e0 /src/effects | |
parent | 35fe3ab56994b92e40cd2604e0d897da7dfb0b53 (diff) |
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 <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/effects')
-rw-r--r-- | src/effects/SkToSRGBColorFilter.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
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<float>(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); |