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

Unified Diff: src/effects/SkCornerPathEffect.cpp

Issue 1135693003: Revert of 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/device/xps/SkXPSDevice.cpp ('k') | src/effects/SkDashPathEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkCornerPathEffect.cpp
diff --git a/src/effects/SkCornerPathEffect.cpp b/src/effects/SkCornerPathEffect.cpp
index 79d4c4cbd3a1710d1bea4f3e56a10a5d1328d834..4b81f261fe669416f260f9b50669ec3a87878ffd 100644
--- a/src/effects/SkCornerPathEffect.cpp
+++ b/src/effects/SkCornerPathEffect.cpp
@@ -20,13 +20,12 @@
SkPoint* step) {
SkScalar dist = SkPoint::Distance(a, b);
- step->set(b.fX - a.fX, b.fY - a.fY);
-
+ *step = b - a;
if (dist <= radius * 2) {
- step->scale(SK_ScalarHalf);
+ *step *= SK_ScalarHalf;
return false;
} else {
- step->scale(SkScalarDiv(radius, dist));
+ *step *= radius / dist;
return true;
}
}
@@ -47,6 +46,7 @@
bool prevIsValid = true;
// to avoid warnings
+ step.set(0, 0);
moveTo.set(0, 0);
firstStep.set(0, 0);
lastCorner.set(0, 0);
« no previous file with comments | « src/device/xps/SkXPSDevice.cpp ('k') | src/effects/SkDashPathEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698