aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/BlendTest.cpp
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-26 17:51:00 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-26 17:51:00 +0000
commit573f8485a630ea859f12bf85bfc3ac3cd1e0fb92 (patch)
treea6af79b61cdbeed1bfaadfa78fa546238881e160 /tests/BlendTest.cpp
parenta47ac2bcc228981bd9f04508ad0894b61704800e (diff)
BlendTest: implicit casts -> explicit casts
BUG=skia: R=reed@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/181503003 git-svn-id: http://skia.googlecode.com/svn/trunk@13595 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/BlendTest.cpp')
-rw-r--r--tests/BlendTest.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/BlendTest.cpp b/tests/BlendTest.cpp
index 9b42e5629c..b72d8d5c75 100644
--- a/tests/BlendTest.cpp
+++ b/tests/BlendTest.cpp
@@ -10,7 +10,7 @@ typedef uint8_t(*Blend)(uint8_t dst, uint8_t src, uint8_t srcAlpha);
// This is our golden algorithm.
static uint8_t blend_double_round(uint8_t dst, uint8_t src, uint8_t srcAlpha) {
SkASSERT(src <= srcAlpha);
- return 0.5 + src + dst * (255.0 - srcAlpha) / 255.0;
+ return SkToU8(0.5 + src + dst * (255.0 - srcAlpha) / 255.0);
}
static uint8_t abs_diff(uint8_t a, uint8_t b) {
@@ -52,15 +52,15 @@ static void test_dst(skiatest::Reporter* r, uint8_t dst, int maxDiff, Blend algo
}
static uint8_t blend_double_trunc(uint8_t dst, uint8_t src, uint8_t srcAlpha) {
- return src + dst * (255.0 - srcAlpha) / 255.0;
+ return SkToU8(src + dst * (255.0 - srcAlpha) / 255.0);
}
static uint8_t blend_float_trunc(uint8_t dst, uint8_t src, uint8_t srcAlpha) {
- return src + dst * (255.0f - srcAlpha) / 255.0f;
+ return SkToU8(src + dst * (255.0f - srcAlpha) / 255.0f);
}
static uint8_t blend_float_round(uint8_t dst, uint8_t src, uint8_t srcAlpha) {
- return 0.5f + src + dst * (255.0f - srcAlpha) / 255.0f;
+ return SkToU8(0.5f + src + dst * (255.0f - srcAlpha) / 255.0f);
}
static uint8_t blend_255_trunc(uint8_t dst, uint8_t src, uint8_t srcAlpha) {