diff options
author | mtklein <mtklein@chromium.org> | 2016-07-19 13:36:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-07-19 13:36:03 -0700 |
commit | d1bd2082c59826b5f54cdbc7354f91fe033ece41 (patch) | |
tree | 7829c8114e8d815edb61b8a1fb78d3e0127f58bc /tests/SRGBTest.cpp | |
parent | 4bcb4c7a250f1bfb2867a181673c47cbd4335ccd (diff) |
Update rounding/clamping comments on sk_linear_to_srgb().
Rounding is enough. No need for an explicit clamp if the inputs are in range.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2161223002
Review-Url: https://codereview.chromium.org/2161223002
Diffstat (limited to 'tests/SRGBTest.cpp')
-rw-r--r-- | tests/SRGBTest.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/SRGBTest.cpp b/tests/SRGBTest.cpp index 95d2866fdc..65bfc59b42 100644 --- a/tests/SRGBTest.cpp +++ b/tests/SRGBTest.cpp @@ -11,7 +11,8 @@ #include <math.h> static uint8_t linear_to_srgb(float l) { - return (uint8_t)roundf(sk_linear_to_srgb(Sk4f{l})[0]); + // Round float to int, truncate that to uint8_t. + return (uint8_t)Sk4f_round( sk_linear_to_srgb(Sk4f{l}) )[0]; } DEF_TEST(sk_linear_to_srgb, r) { |