aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sfnt/SkOTTableTypes.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sfnt/SkOTTableTypes.h')
-rw-r--r--src/sfnt/SkOTTableTypes.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/sfnt/SkOTTableTypes.h b/src/sfnt/SkOTTableTypes.h
index 9adec9b81e..c978cc0179 100644
--- a/src/sfnt/SkOTTableTypes.h
+++ b/src/sfnt/SkOTTableTypes.h
@@ -8,6 +8,7 @@
#ifndef SkOTTableTypes_DEFINED
#define SkOTTableTypes_DEFINED
+#include "SkTemplates.h"
#include "SkTypes.h"
#include "SkEndian.h"
@@ -45,4 +46,16 @@ public:
);
};
+/** SkOTSetUSHORTBit<N>::value is an SK_OT_USHORT with the Nth BE bit set. */
+template <unsigned N> struct SkOTSetUSHORTBit {
+ static const uint16_t bit = SkTSetBit<N, uint16_t>::value;
+ static const SK_OT_USHORT value = SkTEndian_SwapBE16(bit);
+};
+
+/** SkOTSetUSHORTBit<N>::value is an SK_OT_ULONG with the Nth BE bit set. */
+template <unsigned N> struct SkOTSetULONGBit {
+ static const uint32_t bit = SkTSetBit<N, uint32_t>::value;
+ static const SK_OT_ULONG value = SkTEndian_SwapBE32(bit);
+};
+
#endif