aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/opts
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2016-02-21 10:54:19 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-21 10:54:19 -0800
commit7c249e531900929c2fe2cdde76619fa6d2538c49 (patch)
treec6473872ddc5eaac740016ca30d469a7afe44b5d /src/opts
parentd98ef6377269e3596423225ab922301ed40529a0 (diff)
SkNx: kth<...>() -> [...]
Just some syntax cleanup. No real change: kth<...>() was calling [...] already. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1714363002 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Review URL: https://codereview.chromium.org/1714363002
Diffstat (limited to 'src/opts')
-rw-r--r--src/opts/Sk4px_none.h40
-rw-r--r--src/opts/SkNx_neon.h5
-rw-r--r--src/opts/SkNx_sse.h6
-rw-r--r--src/opts/SkXfermode_opts.h2
4 files changed, 21 insertions, 32 deletions
diff --git a/src/opts/Sk4px_none.h b/src/opts/Sk4px_none.h
index b43ee875b2..10c3dedd0f 100644
--- a/src/opts/Sk4px_none.h
+++ b/src/opts/Sk4px_none.h
@@ -40,10 +40,10 @@ inline void Sk4px::store2(SkPMColor px[2]) const { memcpy(px, this, 8); }
inline void Sk4px::store1(SkPMColor px[1]) const { memcpy(px, this, 4); }
inline Sk4px::Wide Sk4px::widenLo() const {
- return Sk16h(this->kth< 0>(), this->kth< 1>(), this->kth< 2>(), this->kth< 3>(),
- this->kth< 4>(), this->kth< 5>(), this->kth< 6>(), this->kth< 7>(),
- this->kth< 8>(), this->kth< 9>(), this->kth<10>(), this->kth<11>(),
- this->kth<12>(), this->kth<13>(), this->kth<14>(), this->kth<15>());
+ return Sk16h((*this)[ 0], (*this)[ 1], (*this)[ 2], (*this)[ 3],
+ (*this)[ 4], (*this)[ 5], (*this)[ 6], (*this)[ 7],
+ (*this)[ 8], (*this)[ 9], (*this)[10], (*this)[11],
+ (*this)[12], (*this)[13], (*this)[14], (*this)[15]);
}
inline Sk4px::Wide Sk4px::widenHi() const { return this->widenLo() << 8; }
@@ -56,10 +56,10 @@ inline Sk4px::Wide Sk4px::mulWiden(const Sk16b& other) const {
inline Sk4px Sk4px::Wide::addNarrowHi(const Sk16h& other) const {
Sk4px::Wide r = (*this + other) >> 8;
- return Sk16b(r.kth< 0>(), r.kth< 1>(), r.kth< 2>(), r.kth< 3>(),
- r.kth< 4>(), r.kth< 5>(), r.kth< 6>(), r.kth< 7>(),
- r.kth< 8>(), r.kth< 9>(), r.kth<10>(), r.kth<11>(),
- r.kth<12>(), r.kth<13>(), r.kth<14>(), r.kth<15>());
+ return Sk16b(r[ 0], r[ 1], r[ 2], r[ 3],
+ r[ 4], r[ 5], r[ 6], r[ 7],
+ r[ 8], r[ 9], r[10], r[11],
+ r[12], r[13], r[14], r[15]);
}
inline Sk4px Sk4px::Wide::div255() const {
@@ -70,10 +70,10 @@ inline Sk4px Sk4px::Wide::div255() const {
inline Sk4px Sk4px::alphas() const {
static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian.");
- return Sk16b(this->kth< 3>(), this->kth< 3>(), this->kth< 3>(), this->kth< 3>(),
- this->kth< 7>(), this->kth< 7>(), this->kth< 7>(), this->kth< 7>(),
- this->kth<11>(), this->kth<11>(), this->kth<11>(), this->kth<11>(),
- this->kth<15>(), this->kth<15>(), this->kth<15>(), this->kth<15>());
+ return Sk16b((*this)[ 3], (*this)[ 3], (*this)[ 3], (*this)[ 3],
+ (*this)[ 7], (*this)[ 7], (*this)[ 7], (*this)[ 7],
+ (*this)[11], (*this)[11], (*this)[11], (*this)[11],
+ (*this)[15], (*this)[15], (*this)[15], (*this)[15]);
}
inline Sk4px Sk4px::Load4Alphas(const SkAlpha a[4]) {
@@ -92,18 +92,18 @@ inline Sk4px Sk4px::Load2Alphas(const SkAlpha a[2]) {
inline Sk4px Sk4px::zeroAlphas() const {
static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian.");
- return Sk16b(this->kth< 0>(), this->kth< 1>(), this->kth< 2>(), 0,
- this->kth< 4>(), this->kth< 5>(), this->kth< 6>(), 0,
- this->kth< 8>(), this->kth< 9>(), this->kth<10>(), 0,
- this->kth<12>(), this->kth<13>(), this->kth<14>(), 0);
+ return Sk16b((*this)[ 0], (*this)[ 1], (*this)[ 2], 0,
+ (*this)[ 4], (*this)[ 5], (*this)[ 6], 0,
+ (*this)[ 8], (*this)[ 9], (*this)[10], 0,
+ (*this)[12], (*this)[13], (*this)[14], 0);
}
inline Sk4px Sk4px::zeroColors() const {
static_assert(SK_A32_SHIFT == 24, "This method assumes little-endian.");
- return Sk16b(0,0,0, this->kth< 3>(),
- 0,0,0, this->kth< 7>(),
- 0,0,0, this->kth<11>(),
- 0,0,0, this->kth<15>());
+ return Sk16b(0,0,0, (*this)[ 3],
+ 0,0,0, (*this)[ 7],
+ 0,0,0, (*this)[11],
+ 0,0,0, (*this)[15]);
}
} // namespace
diff --git a/src/opts/SkNx_neon.h b/src/opts/SkNx_neon.h
index be37baf3cb..1acd7a00f4 100644
--- a/src/opts/SkNx_neon.h
+++ b/src/opts/SkNx_neon.h
@@ -111,7 +111,6 @@ public:
union { float32x2_t v; float fs[2]; } pun = {fVec};
return pun.fs[k&1];
}
- template <int k> float kth() const { return (*this)[k]; }
bool allTrue() const {
auto v = vreinterpret_u32_f32(fVec);
@@ -203,7 +202,6 @@ public:
union { float32x4_t v; float fs[4]; } pun = {fVec};
return pun.fs[k&3];
}
- template <int k> float kth() const { return (*this)[k]; }
bool allTrue() const {
auto v = vreinterpretq_u32_f32(fVec);
@@ -255,7 +253,6 @@ public:
union { uint16x4_t v; uint16_t us[4]; } pun = {fVec};
return pun.us[k&3];
}
- template <int k> uint16_t kth() const { return (*this)[k]; }
SkNx thenElse(const SkNx& t, const SkNx& e) const {
return vbsl_u16(fVec, t.fVec, e.fVec);
@@ -294,7 +291,6 @@ public:
union { uint16x8_t v; uint16_t us[8]; } pun = {fVec};
return pun.us[k&7];
}
- template <int k> uint16_t kth() const { return (*this)[k]; }
SkNx thenElse(const SkNx& t, const SkNx& e) const {
return vbslq_u16(fVec, t.fVec, e.fVec);
@@ -352,7 +348,6 @@ public:
union { uint8x16_t v; uint8_t us[16]; } pun = {fVec};
return pun.us[k&15];
}
- template <int k> uint8_t kth() const { return (*this)[k]; }
SkNx thenElse(const SkNx& t, const SkNx& e) const {
return vbslq_u8(fVec, t.fVec, e.fVec);
diff --git a/src/opts/SkNx_sse.h b/src/opts/SkNx_sse.h
index be521a1a31..b6da080317 100644
--- a/src/opts/SkNx_sse.h
+++ b/src/opts/SkNx_sse.h
@@ -65,7 +65,6 @@ public:
union { __m128 v; float fs[4]; } pun = {fVec};
return pun.fs[k&1];
}
- template <int k> float kth() const { return (*this)[k]; }
bool allTrue() const { return 0xff == (_mm_movemask_epi8(_mm_castps_si128(fVec)) & 0xff); }
bool anyTrue() const { return 0x00 != (_mm_movemask_epi8(_mm_castps_si128(fVec)) & 0xff); }
@@ -117,7 +116,6 @@ public:
union { __m128 v; float fs[4]; } pun = {fVec};
return pun.fs[k&3];
}
- template <int k> float kth() const { return (*this)[k]; }
bool allTrue() const { return 0xffff == _mm_movemask_epi8(_mm_castps_si128(fVec)); }
bool anyTrue() const { return 0x0000 != _mm_movemask_epi8(_mm_castps_si128(fVec)); }
@@ -159,7 +157,6 @@ public:
union { __m128i v; int is[4]; } pun = {fVec};
return pun.is[k&3];
}
- template <int k> int kth() const { return (*this)[k]; }
__m128i fVec;
};
@@ -188,7 +185,6 @@ public:
union { __m128i v; uint16_t us[8]; } pun = {fVec};
return pun.us[k&3];
}
- template <int k> uint16_t kth() const { return (*this)[k]; }
__m128i fVec;
};
@@ -232,7 +228,6 @@ public:
union { __m128i v; uint16_t us[8]; } pun = {fVec};
return pun.us[k&7];
}
- template <int k> uint16_t kth() const { return (*this)[k]; }
__m128i fVec;
};
@@ -284,7 +279,6 @@ public:
union { __m128i v; uint8_t us[16]; } pun = {fVec};
return pun.us[k&15];
}
- template <int k> uint8_t kth() const { return (*this)[k]; }
SkNx thenElse(const SkNx& t, const SkNx& e) const {
return _mm_or_si128(_mm_and_si128 (fVec, t.fVec),
diff --git a/src/opts/SkXfermode_opts.h b/src/opts/SkXfermode_opts.h
index b049c6315c..8b64d0b74a 100644
--- a/src/opts/SkXfermode_opts.h
+++ b/src/opts/SkXfermode_opts.h
@@ -122,7 +122,7 @@ static inline Sk4f a_rgb(const Sk4f& a, const Sk4f& rgb) {
return a * Sk4f(0,0,0,1) + rgb * Sk4f(1,1,1,0);
}
static inline Sk4f alphas(const Sk4f& f) {
- return f.kth<SK_A32_SHIFT/8>();
+ return f[SK_A32_SHIFT/8];
}
XFERMODE(ColorDodge) {