diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkMipMap.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/SkMipMap.cpp b/src/core/SkMipMap.cpp index 987949fea0..ba3cb18749 100644 --- a/src/core/SkMipMap.cpp +++ b/src/core/SkMipMap.cpp @@ -23,6 +23,7 @@ struct ColorTypeFilter_8888 { typedef uint32_t Type; +#if defined(SKNX_IS_FAST) static Sk4h Expand(uint32_t x) { return SkNx_cast<uint16_t>(Sk4b::Load(&x)); } @@ -31,6 +32,14 @@ struct ColorTypeFilter_8888 { SkNx_cast<uint8_t>(x).store(&r); return r; } +#else + static uint64_t Expand(uint32_t x) { + return (x & 0xFF00FF) | ((uint64_t)(x & 0xFF00FF00) << 24); + } + static uint32_t Compact(uint64_t x) { + return (uint32_t)((x & 0xFF00FF) | ((x >> 24) & 0xFF00FF00)); + } +#endif }; struct ColorTypeFilter_S32 { |