diff options
author | Chris Dalton <csmartdalton@google.com> | 2018-04-11 13:18:09 -0600 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-04-12 14:29:00 +0000 |
commit | e3fda9310a8996edbbb1d14acc8f5da07f2d2740 (patch) | |
tree | 828825030b2d3d5cbe9c4e40792a2c2f6b9a0df9 /src/core/SkNx.h | |
parent | 74e5937c188fccf57ba88208783ba39fb1aa6881 (diff) |
Implement Sk4f min/max
Bug: skia:
Change-Id: Icf235dea81e9f125c1c8590ec87cb3591393036c
Reviewed-on: https://skia-review.googlesource.com/120281
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Diffstat (limited to 'src/core/SkNx.h')
-rw-r--r-- | src/core/SkNx.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/SkNx.h b/src/core/SkNx.h index 0b41365e82..11c8f7c665 100644 --- a/src/core/SkNx.h +++ b/src/core/SkNx.h @@ -103,6 +103,8 @@ struct SkNx { Half::Store2(ptr + 2*N/2*sizeof(T), a.fHi, b.fHi); } + AI T min() const { return std::min(fLo.min(), fHi.min()); } + AI T max() const { return std::max(fLo.max(), fHi.max()); } AI bool anyTrue() const { return fLo.anyTrue() || fHi.anyTrue(); } AI bool allTrue() const { return fLo.allTrue() && fHi.allTrue(); } @@ -211,6 +213,8 @@ struct SkNx<1,T> { b.store(ptr + 1*sizeof(T)); } + AI T min() const { return fVal; } + AI T max() const { return fVal; } AI bool anyTrue() const { return fVal != 0; } AI bool allTrue() const { return fVal != 0; } |