commit | b3665f01608dc65374b23f00240582494021a540 | [log] [tgz] |
---|---|---|
author | Mike Klein <mtklein@chromium.org> | Mon May 01 14:56:04 2017 -0400 |
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | Mon May 01 19:30:46 2017 +0000 |
tree | e539b3a7be113605093ba142b5e8d0b85b308422 | |
parent | fb11acdeefce2fe24e98dc4e4c1d002291604119 [diff] |
fix t / t2 confusion in hsl_to_rgb I think the original[1] SkRasterPipeline_opts.h version had a typo that I faithfully copied over to hsl_to_rgb. In Hue2RGB[2], the scalar equivalent of hue_to_rgb, we mutate t to keep it in 0-1 range[3]. In the SkRasterPipeline_opts.h code we introduced a new value t2 instead, and then used it everywhere, but accidentally typed 't' in the t < 1/6 case. The expression "p + (q - p)*6.0f*t" should have been "p + (q - p)*6.0f*t2". This fixes things by changing t in place, much like Hue2RGB does. The GM doesn't change anywhere, which is troubling. [1] https://skia-review.googlesource.com/c/7460/21/src/opts/SkRasterPipeline_opts.h#808 [2] https://skia-review.googlesource.com/c/7460/21/src/effects/SkHighContrastFilter.cpp#26 [3] I think this whole clamp should probably become "t = fract(t)". Will follow up. Change-Id: I3dcc1a79ffae46830178d931844ee3113f8bdfd1 Reviewed-on: https://skia-review.googlesource.com/14910 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>