OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkOTTable_OS_2_DEFINED | 8 #ifndef SkOTTable_OS_2_DEFINED |
9 #define SkOTTable_OS_2_DEFINED | 9 #define SkOTTable_OS_2_DEFINED |
10 | 10 |
11 #include "SkOTTable_OS_2_VA.h" | 11 #include "SkOTTable_OS_2_VA.h" |
12 #include "SkOTTable_OS_2_V0.h" | 12 #include "SkOTTable_OS_2_V0.h" |
13 #include "SkOTTable_OS_2_V1.h" | 13 #include "SkOTTable_OS_2_V1.h" |
14 #include "SkOTTable_OS_2_V2.h" | 14 #include "SkOTTable_OS_2_V2.h" |
15 #include "SkOTTable_OS_2_V3.h" | 15 #include "SkOTTable_OS_2_V3.h" |
16 #include "SkOTTable_OS_2_V4.h" | 16 #include "SkOTTable_OS_2_V4.h" |
17 | 17 |
18 #pragma pack(push, 1) | 18 #pragma pack(push, 1) |
19 | 19 |
20 struct SkOTTableOS2 { | 20 struct SkOTTableOS2 { |
21 static const SK_OT_CHAR TAG0 = 'O'; | 21 static constexpr SK_OT_CHAR TAG0 = 'O'; |
22 static const SK_OT_CHAR TAG1 = 'S'; | 22 static constexpr SK_OT_CHAR TAG1 = 'S'; |
23 static const SK_OT_CHAR TAG2 = '/'; | 23 static constexpr SK_OT_CHAR TAG2 = '/'; |
24 static const SK_OT_CHAR TAG3 = '2'; | 24 static constexpr SK_OT_CHAR TAG3 = '2'; |
25 static const SK_OT_ULONG TAG = SkOTTableTAG<SkOTTableOS2>::value; | 25 static constexpr SK_OT_ULONG TAG = SkOTTableTAG<SkOTTableOS2>::value; |
26 | 26 |
27 union Version { | 27 union Version { |
28 SK_OT_USHORT version; | 28 SK_OT_USHORT version; |
29 | 29 |
30 //original V0 TT | 30 //original V0 TT |
31 struct VA : SkOTTableOS2_VA { } vA; | 31 struct VA : SkOTTableOS2_VA { } vA; |
32 struct V0 : SkOTTableOS2_V0 { } v0; | 32 struct V0 : SkOTTableOS2_V0 { } v0; |
33 struct V1 : SkOTTableOS2_V1 { } v1; | 33 struct V1 : SkOTTableOS2_V1 { } v1; |
34 struct V2 : SkOTTableOS2_V2 { } v2; | 34 struct V2 : SkOTTableOS2_V2 { } v2; |
35 //makes fsType 0-3 exclusive | 35 //makes fsType 0-3 exclusive |
36 struct V3 : SkOTTableOS2_V3 { } v3; | 36 struct V3 : SkOTTableOS2_V3 { } v3; |
37 //defines fsSelection bits 7-9 | 37 //defines fsSelection bits 7-9 |
38 struct V4 : SkOTTableOS2_V4 { } v4; | 38 struct V4 : SkOTTableOS2_V4 { } v4; |
39 } version; | 39 } version; |
40 }; | 40 }; |
41 | 41 |
42 #pragma pack(pop) | 42 #pragma pack(pop) |
43 | 43 |
44 | 44 |
45 static_assert(sizeof(SkOTTableOS2::Version::VA) == 68, "sizeof_SkOTTableOS2__VA_
not_68"); | 45 static_assert(sizeof(SkOTTableOS2::Version::VA) == 68, "sizeof_SkOTTableOS2__VA_
not_68"); |
46 static_assert(sizeof(SkOTTableOS2::Version::V0) == 78, "sizeof_SkOTTableOS2__V0_
not_78"); | 46 static_assert(sizeof(SkOTTableOS2::Version::V0) == 78, "sizeof_SkOTTableOS2__V0_
not_78"); |
47 static_assert(sizeof(SkOTTableOS2::Version::V1) == 86, "sizeof_SkOTTableOS2__V1_
not_86"); | 47 static_assert(sizeof(SkOTTableOS2::Version::V1) == 86, "sizeof_SkOTTableOS2__V1_
not_86"); |
48 static_assert(sizeof(SkOTTableOS2::Version::V2) == 96, "sizeof_SkOTTableOS2__V2_
not_96"); | 48 static_assert(sizeof(SkOTTableOS2::Version::V2) == 96, "sizeof_SkOTTableOS2__V2_
not_96"); |
49 static_assert(sizeof(SkOTTableOS2::Version::V3) == 96, "sizeof_SkOTTableOS2__V3_
not_96"); | 49 static_assert(sizeof(SkOTTableOS2::Version::V3) == 96, "sizeof_SkOTTableOS2__V3_
not_96"); |
50 static_assert(sizeof(SkOTTableOS2::Version::V4) == 96, "sizeof_SkOTTableOS2__V4_
not_96"); | 50 static_assert(sizeof(SkOTTableOS2::Version::V4) == 96, "sizeof_SkOTTableOS2__V4_
not_96"); |
51 | 51 |
52 #endif | 52 #endif |
OLD | NEW |