| Index: src/opts/SkPMFloat_SSSE3.h
|
| diff --git a/src/opts/SkPMFloat_SSSE3.h b/src/opts/SkPMFloat_SSSE3.h
|
| index 2765048ad365355eac61d36a653483540e1cdffd..c1c6d67446e0fb385220c0b53a0e7e1c512ffd67 100644
|
| --- a/src/opts/SkPMFloat_SSSE3.h
|
| +++ b/src/opts/SkPMFloat_SSSE3.h
|
| @@ -8,9 +8,9 @@
|
| // For SkPMFloat(SkPMColor), we widen our 8 bit components (fix8) to 8-bit components in 32 bits
|
| // (fix8_32), then convert those to floats.
|
|
|
| -// get() does the opposite, working from floats to 8-bit-in-32-bits, then back to packed 8 bit.
|
| +// round() does the opposite, working from floats to 8-bit-in-32-bits, then back to packed 8 bit.
|
|
|
| -// clamped() is the same as _SSE2: floats to 8-in-32, to 8-in-16, to packed 8 bit, with
|
| +// roundClamp() is the same as _SSE2: floats to 8-in-32, to 8-in-16, to packed 8 bit, with
|
| // _mm_packus_epi16() both clamping and narrowing.
|
|
|
| inline SkPMFloat::SkPMFloat(SkPMColor c) {
|
| @@ -31,11 +31,11 @@ inline SkPMColor SkPMFloat::trunc() const {
|
| return c;
|
| }
|
|
|
| -inline SkPMColor SkPMFloat::get() const {
|
| +inline SkPMColor SkPMFloat::round() const {
|
| return SkPMFloat(Sk4f(0.5f) + *this).trunc();
|
| }
|
|
|
| -inline SkPMColor SkPMFloat::clamped() const {
|
| +inline SkPMColor SkPMFloat::roundClamp() const {
|
| // We don't use _mm_cvtps_epi32, because we want precise control over how 0.5 rounds (up).
|
| __m128i fix8_32 = _mm_cvttps_epi32(_mm_add_ps(_mm_set1_ps(0.5f), fColors.vec())),
|
| fix8_16 = _mm_packus_epi16(fix8_32, fix8_32),
|
| @@ -54,17 +54,17 @@ inline void SkPMFloat::From4PMColors(const SkPMColor colors[4],
|
| *d = FromPMColor(colors[3]);
|
| }
|
|
|
| -inline void SkPMFloat::To4PMColors(
|
| +inline void SkPMFloat::RoundTo4PMColors(
|
| const SkPMFloat& a, const SkPMFloat& b, const SkPMFloat&c, const SkPMFloat& d,
|
| SkPMColor colors[4]) {
|
| - // Haven't beaten this yet. Still faster than ClampTo4PMColors?
|
| - colors[0] = a.get();
|
| - colors[1] = b.get();
|
| - colors[2] = c.get();
|
| - colors[3] = d.get();
|
| + // Haven't beaten this yet. Still faster than RoundClampTo4PMColors?
|
| + colors[0] = a.round();
|
| + colors[1] = b.round();
|
| + colors[2] = c.round();
|
| + colors[3] = d.round();
|
| }
|
|
|
| -inline void SkPMFloat::ClampTo4PMColors(
|
| +inline void SkPMFloat::RoundClampTo4PMColors(
|
| const SkPMFloat& a, const SkPMFloat& b, const SkPMFloat&c, const SkPMFloat& d,
|
| SkPMColor colors[4]) {
|
| // Same as _SSE2.h's. We use 3 _mm_packus_epi16() where the naive loop uses 8.
|
|
|