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

Unified Diff: src/core/SkPoint.cpp

Issue 60083014: Add sk_float_rsqrt with SSE + NEON fast paths. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: reup Created 7 years, 1 month 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
« include/core/SkFloatingPoint.h ('K') | « include/core/SkFloatingPoint.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPoint.cpp
diff --git a/src/core/SkPoint.cpp b/src/core/SkPoint.cpp
index bf3affaaf549d10c155582b65fbfaf71bb874833..d44ec403c79755ac2d0d225a438dcdb39b724589 100644
--- a/src/core/SkPoint.cpp
+++ b/src/core/SkPoint.cpp
@@ -163,7 +163,7 @@ bool SkPoint::setLength(float x, float y, float length) {
float scale;
if (SkScalarIsFinite(mag2)) {
- scale = length / sk_float_sqrt(mag2);
+ scale = length * sk_float_rsqrt(mag2);
reed1 2013/11/07 22:28:44 not prepared to land this, until we know more abou
} else {
// our mag2 step overflowed to infinity, so use doubles instead.
// much slower, but needed when x or y are very large, other wise we
« include/core/SkFloatingPoint.h ('K') | « include/core/SkFloatingPoint.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698