diff options
author | reed <reed@google.com> | 2016-01-21 15:29:10 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-21 15:29:10 -0800 |
commit | 353c148d8e8c9031daca34c6f9d6bcc6f08706c7 (patch) | |
tree | 2688f89d13fd991cefaf2a6e9cd79e48fa31417c /src/core/SkMathPriv.h | |
parent | 07caf56e723ec04a024f952177f7f4daba06c82c (diff) |
experiment: float color components
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1617813002
Review URL: https://codereview.chromium.org/1617813002
Diffstat (limited to 'src/core/SkMathPriv.h')
-rw-r--r-- | src/core/SkMathPriv.h | 4 |
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 |