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

Unified Diff: src/core/Sk4x.h

Issue 1027783002: Sk2x/Sk4x: add negate(), operator -() (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: 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/Sk4x.h
diff --git a/src/core/Sk4x.h b/src/core/Sk4x.h
index 777927fb773620239415587dcf3e41f43537b397..99ed67d50a35d819c59a5bbb8a7000fe8a689548 100644
--- a/src/core/Sk4x.h
+++ b/src/core/Sk4x.h
@@ -69,6 +69,9 @@ public:
Sk4x& operator *=(const Sk4x& o) { return (*this = *this * o); }
Sk4x& operator /=(const Sk4x& o) { return (*this = *this / o); }
+ Sk4x negate() const { return Sk4x(0) - *this; }
+ Sk4x operator -() const { return this->negate(); }
+
Sk4x rsqrt() const; // Approximate reciprocal sqrt().
Sk4x sqrt() const; // this->multiply(this->rsqrt()) may be faster, but less precise.
« 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