diff options
author | 2017-08-06 22:29:57 -0400 | |
---|---|---|
committer | 2017-08-07 02:49:29 +0000 | |
commit | 35ee0e09b4966bd087147e2c9b4c3177e9737d3b (patch) | |
tree | ed5b262a1dd16a47c0bb6f000635ba2fdb1cd9cb /src | |
parent | b2a5973d0248bcf810ce7f1a6f93a209af7a0348 (diff) |
clean up useage of SkFloatBits
Bug: skia:
Change-Id: I6d3a0019f2fcf11feca69123e4ce6eb35de43613
Reviewed-on: https://skia-review.googlesource.com/31222
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/ports/SkScalerContext_win_dw.cpp | 8 | ||||
-rw-r--r-- | src/shaders/gradients/SkLinearGradient.cpp | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/ports/SkScalerContext_win_dw.cpp b/src/ports/SkScalerContext_win_dw.cpp index 1b5cdc8c67..a84e653f28 100644 --- a/src/ports/SkScalerContext_win_dw.cpp +++ b/src/ports/SkScalerContext_win_dw.cpp @@ -867,10 +867,10 @@ void SkScalerContext_DW::generateColorGlyphImage(const SkGlyph& glyph) { SkColor color; if (colorGlyph->paletteIndex != 0xffff) { - color = SkColorSetARGB(SkFloatToIntRound(colorGlyph->runColor.a * 255), - SkFloatToIntRound(colorGlyph->runColor.r * 255), - SkFloatToIntRound(colorGlyph->runColor.g * 255), - SkFloatToIntRound(colorGlyph->runColor.b * 255)); + color = SkColorSetARGB(sk_float_round2int(colorGlyph->runColor.a * 255), + sk_float_round2int(colorGlyph->runColor.r * 255), + sk_float_round2int(colorGlyph->runColor.g * 255), + sk_float_round2int(colorGlyph->runColor.b * 255)); } else { // If all components of runColor are 0 or (equivalently) paletteIndex is 0xFFFF then // the 'current brush' is used. fRec.getLuminanceColor() is kinda sorta what is wanted diff --git a/src/shaders/gradients/SkLinearGradient.cpp b/src/shaders/gradients/SkLinearGradient.cpp index 32b2ba5670..2645c38a51 100644 --- a/src/shaders/gradients/SkLinearGradient.cpp +++ b/src/shaders/gradients/SkLinearGradient.cpp @@ -636,7 +636,7 @@ void SkLinearGradient::LinearGradientContext::shade4_dx_clamp(SkPMColor dstC[], if (fx < 0) { // count is guaranteed to be positive, but the first arg may overflow int32 after // increment => casting to uint32 ensures correct clamping. - int n = SkTMin<uint32_t>(static_cast<uint32_t>(SkFloatToIntFloor(-fx * invDx)) + 1, + int n = SkTMin<uint32_t>(static_cast<uint32_t>(sk_float_floor2int(-fx * invDx)) + 1, count); SkASSERT(n > 0); fill<apply_alpha>(dstC, n, rec[0].fColor); @@ -652,7 +652,7 @@ void SkLinearGradient::LinearGradientContext::shade4_dx_clamp(SkPMColor dstC[], if (fx > 1) { // count is guaranteed to be positive, but the first arg may overflow int32 after // increment => casting to uint32 ensures correct clamping. - int n = SkTMin<uint32_t>(static_cast<uint32_t>(SkFloatToIntFloor((1 - fx) * invDx)) + 1, + int n = SkTMin<uint32_t>(static_cast<uint32_t>(sk_float_floor2int((1 - fx) * invDx)) + 1, count); SkASSERT(n > 0); fill<apply_alpha>(dstC, n, rec[fRecs.count() - 1].fColor); |