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

Unified Diff: src/core/SkRRect.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/core/SkPictureShader.cpp ('k') | src/core/SkScalar.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRRect.cpp
diff --git a/src/core/SkRRect.cpp b/src/core/SkRRect.cpp
index 0d1887d792e05b4661b28e5a4ace1c17d9298e8e..e54256009aab6cbbdda5c49be074679cf1c13a32 100644
--- a/src/core/SkRRect.cpp
+++ b/src/core/SkRRect.cpp
@@ -26,7 +26,8 @@
}
if (rect.width() < xRad+xRad || rect.height() < yRad+yRad) {
- SkScalar scale = SkMinScalar(rect.width() / (xRad + xRad), rect.height() / (yRad + yRad));
+ SkScalar scale = SkMinScalar(SkScalarDiv(rect.width(), xRad + xRad),
+ SkScalarDiv(rect.height(), yRad + yRad));
SkASSERT(scale < SK_Scalar1);
xRad = SkScalarMul(xRad, scale);
yRad = SkScalarMul(yRad, scale);
@@ -65,10 +66,10 @@
SkScalar scale = SK_Scalar1;
if (leftRad + rightRad > rect.width()) {
- scale = rect.width() / (leftRad + rightRad);
+ scale = SkScalarDiv(rect.width(), leftRad + rightRad);
}
if (topRad + bottomRad > rect.height()) {
- scale = SkMinScalar(scale, rect.height() / (topRad + bottomRad));
+ scale = SkMinScalar(scale, SkScalarDiv(rect.height(), topRad + bottomRad));
}
if (scale < SK_Scalar1) {
« no previous file with comments | « src/core/SkPictureShader.cpp ('k') | src/core/SkScalar.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698