aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar benjaminwagner <benjaminwagner@google.com>2016-02-24 10:57:47 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-24 10:57:47 -0800
commit43437c2f1928073a30c2bab6d32df854658235ec (patch)
treea9e7447095832847d48c441e82d209db2adbeab2 /src
parent1cc345f6994c6817f47d712ef8e85b76337d44e3 (diff)
Round to nearest in ScalarTo256.
Diffstat (limited to 'src')
-rw-r--r--src/core/SkDraw.cpp2
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);
}