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

Unified Diff: src/core/SkNx.h

Issue 1132273004: Sk4px (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: a smidge faster Created 5 years, 7 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/SkBlitRow_D32.cpp ('k') | src/opts/Sk4px_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 4cfc6e3d9ae05aff619c590f9ef57ff5fe9d2e10..9d319623a6f473e34795eb91a1983bf8aa8ef74b 100644
--- a/src/core/SkNx.h
+++ b/src/core/SkNx.h
@@ -30,7 +30,7 @@ public:
bool allTrue() const { return fLo.allTrue() && fHi.allTrue(); }
bool anyTrue() const { return fLo.anyTrue() || fHi.anyTrue(); }
-private:
+protected:
REQUIRE(0 == (N & (N-1)));
SkNb<N/2, Bytes> fLo, fHi;
};
@@ -45,9 +45,12 @@ public:
return SkNi(SkNi<N/2,T>::Load(vals), SkNi<N/2,T>::Load(vals+N/2));
}
- SkNi(T a, T b) : fLo(a), fHi(b) { REQUIRE(N==2); }
- SkNi(T a, T b, T c, T d) : fLo(a,b), fHi(c,d) { REQUIRE(N==4); }
- SkNi(T a, T b, T c, T d, T e, T f, T g, T h) : fLo(a,b,c,d), fHi(e,f,g,h) { REQUIRE(N==8); }
+ SkNi(T a, T b) : fLo(a), fHi(b) { REQUIRE(N==2); }
+ SkNi(T a, T b, T c, T d) : fLo(a,b), fHi(c,d) { REQUIRE(N==4); }
+ SkNi(T a, T b, T c, T d, T e, T f, T g, T h) : fLo(a,b,c,d), fHi(e,f,g,h) { REQUIRE(N==8); }
+ SkNi(T a, T b, T c, T d, T e, T f, T g, T h,
+ T i, T j, T k, T l, T m, T n, T o, T p)
+ : fLo(a,b,c,d, e,f,g,h), fHi(i,j,k,l, m,n,o,p) { REQUIRE(N==16); }
void store(T vals[N]) const {
fLo.store(vals);
@@ -68,7 +71,7 @@ public:
return k < N/2 ? fLo.template kth<k>() : fHi.template kth<k-N/2>();
}
-private:
+protected:
REQUIRE(0 == (N & (N-1)));
SkNi<N/2, T> fLo, fHi;
@@ -133,7 +136,7 @@ public:
return k < N/2 ? fLo.template kth<k>() : fHi.template kth<k-N/2>();
}
-private:
+protected:
REQUIRE(0 == (N & (N-1)));
SkNf(const SkNf<N/2, T>& lo, const SkNf<N/2, T>& hi) : fLo(lo), fHi(hi) {}
@@ -150,7 +153,7 @@ public:
explicit SkNb(bool val) : fVal(val) {}
bool allTrue() const { return fVal; }
bool anyTrue() const { return fVal; }
-private:
+protected:
bool fVal;
};
@@ -175,7 +178,7 @@ public:
return fVal;
}
-private:
+protected:
T fVal;
};
@@ -223,7 +226,7 @@ public:
return fVal;
}
-private:
+protected:
// We do double sqrts natively, or via floats for any other type.
template <typename U>
static U Sqrt(U val) { return (U) ::sqrtf((float)val); }
@@ -263,9 +266,13 @@ typedef SkNf<4, float> Sk4f;
typedef SkNf<4, double> Sk4d;
typedef SkNf<4, SkScalar> Sk4s;
-typedef SkNi<4, uint16_t> Sk4h;
-typedef SkNi<8, uint16_t> Sk8h;
+typedef SkNi<4, uint16_t> Sk4h;
+typedef SkNi<8, uint16_t> Sk8h;
+typedef SkNi<16, uint16_t> Sk16h;
-typedef SkNi<4, int> Sk4i;
+typedef SkNi<16, uint8_t> Sk16b;
+
+typedef SkNi<4, int32_t> Sk4i;
+typedef SkNi<4, uint32_t> Sk4u;
#endif//SkNx_DEFINED
« no previous file with comments | « src/core/SkBlitRow_D32.cpp ('k') | src/opts/Sk4px_NEON.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698