Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Unified Diff: tests/DrawBitmapRectTest.cpp

Issue 1138263002: Revert of stop calling SkScalarDiv (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/utils/SkNinePatch.cpp ('k') | tests/MatrixTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/DrawBitmapRectTest.cpp
diff --git a/tests/DrawBitmapRectTest.cpp b/tests/DrawBitmapRectTest.cpp
index 80167b7083218a3a2d1bb1827b333c9728024a91..9c522db28e80f22cd708c4b65d4cccdda18b497b 100644
--- a/tests/DrawBitmapRectTest.cpp
+++ b/tests/DrawBitmapRectTest.cpp
@@ -124,19 +124,19 @@
REPORTER_ASSERT(reporter, treat_as_sprite(mat, size, bilerBits));
const SkScalar twoThirds = SK_Scalar1 * 2 / 3;
- const SkScalar bigScale = (size.width() + twoThirds) / size.width();
+ const SkScalar bigScale = SkScalarDiv(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 = (size.width() + oneThird) / size.width();
+ const SkScalar smallScale = SkScalarDiv(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 = (size.width() + oneFortyth) / size.width();
+ const SkScalar tinyScale = SkScalarDiv(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));
« no previous file with comments | « src/utils/SkNinePatch.cpp ('k') | tests/MatrixTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698