SkBSwap32
Seems handy. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1619923002 Review URL: https://codereview.chromium.org/1619923002
This commit is contained in:
parent
8bf7b79cf9
commit
6a377e629d
@ -82,4 +82,14 @@ static inline float SkPinToUnitFloat(float x) {
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user