diff options
Diffstat (limited to 'src/opts/SkPMFloat_sse.h')
-rw-r--r-- | src/opts/SkPMFloat_sse.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/opts/SkPMFloat_sse.h b/src/opts/SkPMFloat_sse.h index 016644e052..28aa90bf29 100644 --- a/src/opts/SkPMFloat_sse.h +++ b/src/opts/SkPMFloat_sse.h @@ -5,7 +5,9 @@ * found in the LICENSE file. */ -SK_ALWAYS_INLINE SkPMFloat::SkPMFloat(SkPMColor c) { +namespace { // See SkPMFloat.h + +inline SkPMFloat::SkPMFloat(SkPMColor c) { SkPMColorAssert(c); #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3 const int _ = 255; // Zero these bytes. @@ -20,7 +22,7 @@ SK_ALWAYS_INLINE SkPMFloat::SkPMFloat(SkPMColor c) { SkASSERT(this->isValid()); } -SK_ALWAYS_INLINE SkPMColor SkPMFloat::round() const { +inline SkPMColor SkPMFloat::round() const { // We don't use _mm_cvtps_epi32, because we want precise control over how 0.5 rounds (up). __m128 scaled = _mm_mul_ps(_mm_set1_ps(255), fVec); __m128i fix8_32 = _mm_cvttps_epi32(_mm_add_ps(_mm_set1_ps(0.5f), scaled)), @@ -31,7 +33,9 @@ SK_ALWAYS_INLINE SkPMColor SkPMFloat::round() const { return c; } -SK_ALWAYS_INLINE Sk4f SkPMFloat::alphas() const { +inline Sk4f SkPMFloat::alphas() const { static_assert(SK_A32_SHIFT == 24, ""); return _mm_shuffle_ps(fVec, fVec, 0xff); // Read as 11 11 11 11, copying lane 3 to all lanes. } + +} // namespace |