diff options
author | benjaminwagner <benjaminwagner@google.com> | 2016-02-24 10:57:47 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-24 10:57:47 -0800 |
commit | 43437c2f1928073a30c2bab6d32df854658235ec (patch) | |
tree | a9e7447095832847d48c441e82d209db2adbeab2 /src | |
parent | 1cc345f6994c6817f47d712ef8e85b76337d44e3 (diff) |
Round to nearest in ScalarTo256.
This is a followup to https://codereview.chromium.org/1693683002 per discussion on https://codereview.chromium.org/1691403002.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1723483004
Review URL: https://codereview.chromium.org/1723483004
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkDraw.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp index 4db759474f..cff4252579 100644 --- a/src/core/SkDraw.cpp +++ b/src/core/SkDraw.cpp @@ -1762,7 +1762,7 @@ bool SkTriColorShader::TriColorShaderContext::setup(const SkPoint pts[], const S #include "SkComposeShader.h" static int ScalarTo256(SkScalar v) { - return static_cast<int>(SkScalarPin(v, 0, 1) * 256); + return static_cast<int>(SkScalarPin(v, 0, 1) * 256 + 0.5); } |