mtklein 2016-01-22 07:54:08 -08:00 committed by Commit bot
parent 8bf7b79cf9
commit 6a377e629d

View File

@ -82,4 +82,14 @@ static inline float SkPinToUnitFloat(float x) {
return SkTMin(SkTMax(x, 0.0f), 1.0f); return SkTMin(SkTMax(x, 0.0f), 1.0f);
} }
/**
* Swap byte order of a 4-byte value, e.g. 0xaarrggbb -> 0xbbggrraa.
*/
#if defined(_MSC_VER)
#include <intrin.h>
static inline uint32_t SkBSwap32(uint32_t v) { return _byteswap_ulong(v); }
#else
static inline uint32_t SkBSwap32(uint32_t v) { return __builtin_bswap32(v); }
#endif
#endif #endif