diff options
author | reed <reed@google.com> | 2015-05-12 09:47:22 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-12 09:47:22 -0700 |
commit | 67d71c898249a7af3523b16c6a69895a63bfae0a (patch) | |
tree | 718e9b0eb395ffd67ec0e1bcf3074f0289f89600 /tests | |
parent | 7da2e55ccbad4868a455c1c9f23e5f63bd99e916 (diff) |
stop calling SkScalarDiv
BUG=skia:
TBR=
Review URL: https://codereview.chromium.org/1135053002
Diffstat (limited to 'tests')
-rw-r--r-- | tests/DrawBitmapRectTest.cpp | 6 | ||||
-rw-r--r-- | tests/MatrixTest.cpp | 8 | ||||
-rw-r--r-- | tests/PathCoverageTest.cpp | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/tests/DrawBitmapRectTest.cpp b/tests/DrawBitmapRectTest.cpp index 9c522db28e..80167b7083 100644 --- a/tests/DrawBitmapRectTest.cpp +++ b/tests/DrawBitmapRectTest.cpp @@ -124,19 +124,19 @@ static void test_treatAsSprite(skiatest::Reporter* reporter) { REPORTER_ASSERT(reporter, treat_as_sprite(mat, size, bilerBits)); const SkScalar twoThirds = SK_Scalar1 * 2 / 3; - const SkScalar bigScale = SkScalarDiv(size.width() + twoThirds, size.width()); + const SkScalar bigScale = (size.width() + twoThirds) / size.width(); mat.setScale(bigScale, bigScale); REPORTER_ASSERT(reporter, !treat_as_sprite(mat, size, false)); REPORTER_ASSERT(reporter, !treat_as_sprite(mat, size, bilerBits)); const SkScalar oneThird = SK_Scalar1 / 3; - const SkScalar smallScale = SkScalarDiv(size.width() + oneThird, size.width()); + const SkScalar smallScale = (size.width() + oneThird) / size.width(); mat.setScale(smallScale, smallScale); REPORTER_ASSERT(reporter, treat_as_sprite(mat, size, false)); REPORTER_ASSERT(reporter, !treat_as_sprite(mat, size, bilerBits)); const SkScalar oneFortyth = SK_Scalar1 / 40; - const SkScalar tinyScale = SkScalarDiv(size.width() + oneFortyth, size.width()); + const SkScalar tinyScale = (size.width() + oneFortyth) / size.width(); mat.setScale(tinyScale, tinyScale); REPORTER_ASSERT(reporter, treat_as_sprite(mat, size, false)); REPORTER_ASSERT(reporter, treat_as_sprite(mat, size, bilerBits)); diff --git a/tests/MatrixTest.cpp b/tests/MatrixTest.cpp index 95d33acabd..72e0dcc021 100644 --- a/tests/MatrixTest.cpp +++ b/tests/MatrixTest.cpp @@ -270,8 +270,8 @@ static void test_matrix_min_max_scale(skiatest::Reporter* reporter) { mat.mapVectors(vectors, SK_ARRAY_COUNT(vectors)); for (size_t i = 0; i < SK_ARRAY_COUNT(vectors); ++i) { SkScalar d = vectors[i].length(); - REPORTER_ASSERT(reporter, SkScalarDiv(d, maxScale) < gVectorScaleTol); - REPORTER_ASSERT(reporter, SkScalarDiv(minScale, d) < gVectorScaleTol); + REPORTER_ASSERT(reporter, d / maxScale < gVectorScaleTol); + REPORTER_ASSERT(reporter, minScale / d < gVectorScaleTol); if (max < d) { max = d; } @@ -279,8 +279,8 @@ static void test_matrix_min_max_scale(skiatest::Reporter* reporter) { min = d; } } - REPORTER_ASSERT(reporter, SkScalarDiv(max, maxScale) >= gCloseScaleTol); - REPORTER_ASSERT(reporter, SkScalarDiv(minScale, min) >= gCloseScaleTol); + REPORTER_ASSERT(reporter, max / maxScale >= gCloseScaleTol); + REPORTER_ASSERT(reporter, minScale / min >= gCloseScaleTol); } } diff --git a/tests/PathCoverageTest.cpp b/tests/PathCoverageTest.cpp index 0e4a1539f2..303ddcc4cb 100644 --- a/tests/PathCoverageTest.cpp +++ b/tests/PathCoverageTest.cpp @@ -60,7 +60,7 @@ static inline uint32_t compute_pointCount(SkScalar d, SkScalar tol) { if (d < tol) { return 1; } else { - int temp = SkScalarCeilToInt(SkScalarSqrt(SkScalarDiv(d, tol))); + int temp = SkScalarCeilToInt(SkScalarSqrt(d / tol)); uint32_t count = SkMin32(SkNextPow2(temp), MAX_POINTS_PER_CURVE); return count; } |