aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkMathPriv.h
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-01-22 01:04:29 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-22 01:04:29 -0800
commit6d3cef930ad19b0f55543ca40f7a07030f4fe508 (patch)
treeb9fca9f635a8a01c4e998e1da44caad648ce672d /src/core/SkMathPriv.h
parent2a2bdc698460c38ac9e24ba4abdeefec67bcba37 (diff)
Revert[2] of float color components
This reverts commit 2a2bdc698460c38ac9e24ba4abdeefec67bcba37. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1622483002 TBR= NOTRY=True Test-Ubuntu-GCC-ShuttleA-GPU-GTX660-x86_64-Release-Trybot seems wicked slow Review URL: https://codereview.chromium.org/1622483002
Diffstat (limited to 'src/core/SkMathPriv.h')
-rw-r--r--src/core/SkMathPriv.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/SkMathPriv.h b/src/core/SkMathPriv.h
index b9184a0726..6cca44e958 100644
--- a/src/core/SkMathPriv.h
+++ b/src/core/SkMathPriv.h
@@ -78,4 +78,8 @@ static inline unsigned SkDiv255Round(unsigned prod) {
return (prod + (prod >> 8)) >> 8;
}
+static inline float SkPinToUnitFloat(float x) {
+ return SkTMin(SkTMax(x, 0.0f), 1.0f);
+}
+
#endif