Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1016)

Unified Diff: tests/SRGBTest.cpp

Issue 2161223002: Update rounding/clamping comments on sk_linear_to_srgb(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkSRGB.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/SRGBTest.cpp
diff --git a/tests/SRGBTest.cpp b/tests/SRGBTest.cpp
index 95d2866fdc5e5a2d709d0603c7ed25bb37cf52e6..65bfc59b427fd07d8135ca28bc16b5459ea7201b 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) {
« no previous file with comments | « src/core/SkSRGB.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698