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

Unified Diff: src/core/SkGeometry.cpp

Issue 1024473005: Try out operator overloads for Sk2x. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: simpler math Created 5 years, 9 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/Sk2x.h ('k') | tests/Sk2xTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkGeometry.cpp
diff --git a/src/core/SkGeometry.cpp b/src/core/SkGeometry.cpp
index 88c4b60cddac5027ef0153be78344d5ced92e351..6d14e4bb54f595996213a85ecd08d4242f8c450c 100644
--- a/src/core/SkGeometry.cpp
+++ b/src/core/SkGeometry.cpp
@@ -139,12 +139,11 @@ SkPoint SkEvalQuadAt(const SkPoint src[3], SkScalar t) {
Sk2f P1 = Sk2f::Load(&src[1].fX);
Sk2f P2 = Sk2f::Load(&src[2].fX);
- Sk2f A = P2.subtract(P1.add(P1)).add(P0);
- Sk2f B = P1.subtract(P0);
- B = B.add(B);
+ Sk2f B = P1 - P0;
+ Sk2f A = P2 - P1 - B;
SkPoint result;
- A.multiply(t2).add(B).multiply(t2).add(P0).store(&result.fX);
+ ((A * t2 + B+B) * t2 + P0).store(&result.fX);
return result;
}
« no previous file with comments | « src/core/Sk2x.h ('k') | tests/Sk2xTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698