aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-05-12 10:28:06 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-05-12 10:28:06 -0700
commit2629697933b5cc975e45d2a45c48f803fc6cbcec (patch)
tree53730ca8354552773d93adfe7ade5f1e2bc18192 /src/utils
parent39a9a5069b25aa8b9529118cfd0ece5f412fb56b (diff)
Revert of stop calling SkScalarDiv (patchset #4 id:60001 of https://codereview.chromium.org/1135053002/)
Reason for revert: need to wait for Blink roll (and patch android) Original issue's description: > stop calling SkScalarDiv > > BUG=skia: > TBR= > > Committed: https://skia.googlesource.com/skia/+/67d71c898249a7af3523b16c6a69895a63bfae0a TBR= NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1138263002
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/SkInterpolator.cpp3
-rw-r--r--src/utils/SkNinePatch.cpp4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/utils/SkInterpolator.cpp b/src/utils/SkInterpolator.cpp
index 03e7e4a83f..97574e475b 100644
--- a/src/utils/SkInterpolator.cpp
+++ b/src/utils/SkInterpolator.cpp
@@ -62,7 +62,8 @@ SkScalar SkInterpolatorBase::ComputeRelativeT(SkMSec time, SkMSec prevTime,
SkMSec nextTime, const SkScalar blend[4]) {
SkASSERT(time > prevTime && time < nextTime);
- SkScalar t = (SkScalar)(time - prevTime) / (SkScalar)(nextTime - prevTime);
+ SkScalar t = SkScalarDiv((SkScalar)(time - prevTime),
+ (SkScalar)(nextTime - prevTime));
return blend ?
SkUnitCubicInterp(t, blend[0], blend[1], blend[2], blend[3]) : t;
}
diff --git a/src/utils/SkNinePatch.cpp b/src/utils/SkNinePatch.cpp
index ce8d4801c6..4e0d1d1a39 100644
--- a/src/utils/SkNinePatch.cpp
+++ b/src/utils/SkNinePatch.cpp
@@ -161,7 +161,7 @@ void SkNinePatch::DrawMesh(SkCanvas* canvas, const SkRect& bounds,
if (bounds.width() >= fixed)
stretchX = (bounds.width() - fixed) / stretchSize;
else // reuse stretchX, but keep it negative as a signal
- stretchX = -bounds.width() / fixed;
+ stretchX = SkScalarDiv(-bounds.width(), fixed);
}
if (numYStretch > 0) {
@@ -173,7 +173,7 @@ void SkNinePatch::DrawMesh(SkCanvas* canvas, const SkRect& bounds,
if (bounds.height() >= fixed)
stretchY = (bounds.height() - fixed) / stretchSize;
else // reuse stretchX, but keep it negative as a signal
- stretchY = -bounds.height() / fixed;
+ stretchY = SkScalarDiv(-bounds.height(), fixed);
}
#if 0