Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: src/sfnt/SkOTTableTypes.h

Issue 219023011: Fold SkTSetBit into SkOTSet*Bit. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add back asserts Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkTemplates.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/sfnt/SkOTTableTypes.h
diff --git a/src/sfnt/SkOTTableTypes.h b/src/sfnt/SkOTTableTypes.h
index c978cc017911b08beefafa8699ab345c8e250839..1f49518d5915028943b6429af459bfd2752fc8af 100644
--- a/src/sfnt/SkOTTableTypes.h
+++ b/src/sfnt/SkOTTableTypes.h
@@ -48,13 +48,15 @@ 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;
+ SK_COMPILE_ASSERT(N < 16, NTooBig);
+ static const uint16_t bit = 1u << N;
static const SK_OT_USHORT value = SkTEndian_SwapBE16(bit);
};
-/** SkOTSetUSHORTBit<N>::value is an SK_OT_ULONG with the Nth BE bit set. */
+/** SkOTSetULONGBit<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;
+ SK_COMPILE_ASSERT(N < 32, NTooBig);
+ static const uint32_t bit = 1u << N;
static const SK_OT_ULONG value = SkTEndian_SwapBE32(bit);
};
« no previous file with comments | « include/core/SkTemplates.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698