Index: src/core/SkNx.h |
diff --git a/src/core/SkNx.h b/src/core/SkNx.h |
index ed939c3e4feb9824a7a3b011166df5b9c459cd4b..af7194840a4f028c8bc9dca0c339349a4a79866a 100644 |
--- a/src/core/SkNx.h |
+++ b/src/core/SkNx.h |
@@ -68,7 +68,11 @@ public: |
SkNi operator << (int bits) const { return SkNi(fLo << bits, fHi << bits); } |
SkNi operator >> (int bits) const { return SkNi(fLo >> bits, fHi >> bits); } |
- // TODO: comparisons, min, max? |
+ static SkNi Min(const SkNi& a, const SkNi& b) { |
+ return SkNi(SkNi<N/2, T>::Min(a.fLo, b.fLo), SkNi<N/2, T>::Min(a.fHi, b.fHi)); |
+ } |
+ |
+ // TODO: comparisons, max? |
template <int k> T kth() const { |
SkASSERT(0 <= k && k < N); |
@@ -183,6 +187,8 @@ public: |
SkNi operator << (int bits) const { return SkNi(fVal << bits); } |
SkNi operator >> (int bits) const { return SkNi(fVal >> bits); } |
+ static SkNi Min(const SkNi& a, const SkNi& b) { return SkNi(SkTMin(a.fVal, b.fVal)); } |
+ |
template <int k> T kth() const { |
SkASSERT(0 == k); |
return fVal; |