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

Unified Diff: src/core/SkNx.h

Issue 1109883003: Revert of Mike's radial gradient CL with better float -> int. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 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 | « gm/gradients.cpp ('k') | src/effects/gradients/SkRadialGradient.cpp » ('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 5b2110bdac8983e63761441f368486c3a79d3ad6..8244e9026cc69436ca754761dea60797250d538a 100644
--- a/src/core/SkNx.h
+++ b/src/core/SkNx.h
@@ -77,10 +77,6 @@
template <int N, typename T>
class SkNf {
typedef SkNb<N, sizeof(T)> Nb;
-
- static int32_t MyNi(float);
- static int64_t MyNi(double);
- typedef SkNi<N, decltype(MyNi(T()))> Ni;
public:
SkNf() {}
explicit SkNf(T val) : fLo(val), fHi(val) {}
@@ -96,8 +92,6 @@
fLo.store(vals);
fHi.store(vals+N/2);
}
-
- Ni castTrunc() const { return Ni(fLo.castTrunc(), fHi.castTrunc()); }
SkNf operator + (const SkNf& o) const { return SkNf(fLo + o.fLo, fHi + o.fHi); }
SkNf operator - (const SkNf& o) const { return SkNf(fLo - o.fLo, fHi - o.fHi); }
@@ -178,18 +172,12 @@
template <typename T>
class SkNf<1,T> {
typedef SkNb<1, sizeof(T)> Nb;
-
- static int32_t MyNi(float);
- static int64_t MyNi(double);
- typedef SkNi<1, decltype(MyNi(T()))> Ni;
public:
SkNf() {}
explicit SkNf(T val) : fVal(val) {}
static SkNf Load(const T vals[1]) { return SkNf(vals[0]); }
void store(T vals[1]) const { vals[0] = fVal; }
-
- Ni castTrunc() const { return Ni(fVal); }
SkNf operator + (const SkNf& o) const { return SkNf(fVal + o.fVal); }
SkNf operator - (const SkNf& o) const { return SkNf(fVal - o.fVal); }
@@ -260,6 +248,4 @@
typedef SkNi<4, uint16_t> Sk4h;
typedef SkNi<8, uint16_t> Sk8h;
-typedef SkNi<4, int> Sk4i;
-
#endif//SkNx_DEFINED
« no previous file with comments | « gm/gradients.cpp ('k') | src/effects/gradients/SkRadialGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698