aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkNx.h
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2016-02-09 13:46:49 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-09 13:46:49 -0800
commit86c6c4935171a1d2d6a9ffbff37ec6dac1326614 (patch)
tree500badd83fef02cc26d45ab047ce38fb7efd4568 /src/core/SkNx.h
parentb8d6e088590160f1198110c2371b802c1d541a36 (diff)
Sk4f: add floor()
BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1685773002 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Review URL: https://codereview.chromium.org/1685773002
Diffstat (limited to 'src/core/SkNx.h')
-rw-r--r--src/core/SkNx.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/SkNx.h b/src/core/SkNx.h
index 69295d4fc3..986c133415 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); }