Index: src/core/SkMathPriv.h |
diff --git a/src/core/SkMathPriv.h b/src/core/SkMathPriv.h |
index 6cca44e958295fbaf58f151ca0aefab4bc23f7f9..1b64a6cd33937a2303414d78ed5a563e336cd87c 100644 |
--- a/src/core/SkMathPriv.h |
+++ b/src/core/SkMathPriv.h |
@@ -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 |