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

Unified Diff: src/core/SkNx.h

Issue 1685773002: Sk4f: add floor() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add a bench Created 4 years, 10 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 | « bench/Sk4fBench.cpp ('k') | src/opts/SkNx_neon.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkNx.h
diff --git a/src/core/SkNx.h b/src/core/SkNx.h
index 69295d4fc3f8d566e16fd92132306040865e6d6c..986c1334153a4e590e5865f8210b9a5b2d5e26dc 100644
--- a/src/core/SkNx.h
+++ b/src/core/SkNx.h
@@ -50,7 +50,7 @@ public:
#undef OP
#define OP(op) SkNx op() const { return {fLo.op(), fHi.op()}; }
- OP(abs)
+ OP(abs) OP(floor)
OP(sqrt) OP(rsqrt0) OP(rsqrt1) OP(rsqrt2)
OP(invert) OP(approxInvert)
#undef OP
@@ -124,6 +124,7 @@ public:
static SkNx Max(const SkNx& a, const SkNx& b) { return SkTMax(a.fVal, b.fVal); }
SkNx abs() const { return SkTAbs(fVal); }
+ SkNx floor() const { return Floor(fVal); }
SkNx sqrt () const { return Sqrt(fVal); }
SkNx rsqrt0() const { return this->sqrt().invert(); }
@@ -145,6 +146,8 @@ public:
SkNx thenElse(const SkNx& t, const SkNx& e) const { return fVal != 0 ? t : e; }
protected:
+ static double Floor(double val) { return ::floor (val); }
+ static float Floor(float val) { return ::floorf(val); }
static double Sqrt(double val) { return ::sqrt (val); }
static float Sqrt(float val) { return ::sqrtf(val); }
« no previous file with comments | « bench/Sk4fBench.cpp ('k') | src/opts/SkNx_neon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698