diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp index 209b833973..7752aac51d 100644 --- a/src/effects/gradients/SkLinearGradient.cpp +++ b/src/effects/gradients/SkLinearGradient.cpp @@ -612,7 +612,8 @@ 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(SkFloatToIntFloor(-fx * invDx) + 1, count); + int n = SkTMin(static_cast(SkFloatToIntFloor(-fx * invDx)) + 1, + count); SkASSERT(n > 0); fill(dstC, n, rec[0].fColor); count -= n; @@ -627,7 +628,8 @@ 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(SkFloatToIntFloor((1 - fx) * invDx) + 1, count); + int n = SkTMin(static_cast(SkFloatToIntFloor((1 - fx) * invDx)) + 1, + count); SkASSERT(n > 0); fill(dstC, n, rec[fRecs.count() - 1].fColor); count -= n;