1f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com/*
2f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com * Copyright 2012 Google Inc.
3f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com *
4f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com * Use of this source code is governed by a BSD-style license that can be
5f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com * found in the LICENSE file.
6f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com */
7f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com
8f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com#ifndef SkOTTable_OS_2_DEFINED
9f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com#define SkOTTable_OS_2_DEFINED
10f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com
11f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com#include "SkOTTable_OS_2_VA.h"
12f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com#include "SkOTTable_OS_2_V0.h"
13f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com#include "SkOTTable_OS_2_V1.h"
14f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com#include "SkOTTable_OS_2_V2.h"
15f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com#include "SkOTTable_OS_2_V3.h"
16f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com#include "SkOTTable_OS_2_V4.h"
17f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com
18f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com#pragma pack(push, 1)
19f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com
20ec95a4ae45e9bff1a92627372fd771b389813fecbungeman@google.comstruct SkOTTableOS2 {
21ec95a4ae45e9bff1a92627372fd771b389813fecbungeman@google.com    static const SK_OT_CHAR TAG0 = 'O';
22ec95a4ae45e9bff1a92627372fd771b389813fecbungeman@google.com    static const SK_OT_CHAR TAG1 = 'S';
23ec95a4ae45e9bff1a92627372fd771b389813fecbungeman@google.com    static const SK_OT_CHAR TAG2 = '/';
24ec95a4ae45e9bff1a92627372fd771b389813fecbungeman@google.com    static const SK_OT_CHAR TAG3 = '2';
25ec95a4ae45e9bff1a92627372fd771b389813fecbungeman@google.com    static const SK_OT_ULONG TAG = SkOTTableTAG<SkOTTableOS2>::value;
26ec95a4ae45e9bff1a92627372fd771b389813fecbungeman@google.com
27ec95a4ae45e9bff1a92627372fd771b389813fecbungeman@google.com    union Version {
28a544f29496758de6ed2ebf5a53558574019c9da1bungeman@google.com        SK_OT_USHORT version;
29b0a327e9390da5865d4c56db5e5259adc3380d37skia.committer@gmail.com
30ec95a4ae45e9bff1a92627372fd771b389813fecbungeman@google.com        //original V0 TT
31ec95a4ae45e9bff1a92627372fd771b389813fecbungeman@google.com        struct VA : SkOTTableOS2_VA { } vA;
32ec95a4ae45e9bff1a92627372fd771b389813fecbungeman@google.com        struct V0 : SkOTTableOS2_V0 { } v0;
33ec95a4ae45e9bff1a92627372fd771b389813fecbungeman@google.com        struct V1 : SkOTTableOS2_V1 { } v1;
34ec95a4ae45e9bff1a92627372fd771b389813fecbungeman@google.com        struct V2 : SkOTTableOS2_V2 { } v2;
35ec95a4ae45e9bff1a92627372fd771b389813fecbungeman@google.com        //makes fsType 0-3 exclusive
36ec95a4ae45e9bff1a92627372fd771b389813fecbungeman@google.com        struct V3 : SkOTTableOS2_V3 { } v3;
37ec95a4ae45e9bff1a92627372fd771b389813fecbungeman@google.com        //defines fsSelection bits 7-9
38ec95a4ae45e9bff1a92627372fd771b389813fecbungeman@google.com        struct V4 : SkOTTableOS2_V4 { } v4;
39ec95a4ae45e9bff1a92627372fd771b389813fecbungeman@google.com    } version;
40f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com};
41f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com
42f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com#pragma pack(pop)
43f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com
44f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com
452880df2609eba09b555ca37be04b6ad89290c765Tom Hudsonstatic_assert(sizeof(SkOTTableOS2::Version::VA) == 68, "sizeof_SkOTTableOS2__VA_not_68");
462880df2609eba09b555ca37be04b6ad89290c765Tom Hudsonstatic_assert(sizeof(SkOTTableOS2::Version::V0) == 78, "sizeof_SkOTTableOS2__V0_not_78");
472880df2609eba09b555ca37be04b6ad89290c765Tom Hudsonstatic_assert(sizeof(SkOTTableOS2::Version::V1) == 86, "sizeof_SkOTTableOS2__V1_not_86");
482880df2609eba09b555ca37be04b6ad89290c765Tom Hudsonstatic_assert(sizeof(SkOTTableOS2::Version::V2) == 96, "sizeof_SkOTTableOS2__V2_not_96");
492880df2609eba09b555ca37be04b6ad89290c765Tom Hudsonstatic_assert(sizeof(SkOTTableOS2::Version::V3) == 96, "sizeof_SkOTTableOS2__V3_not_96");
502880df2609eba09b555ca37be04b6ad89290c765Tom Hudsonstatic_assert(sizeof(SkOTTableOS2::Version::V4) == 96, "sizeof_SkOTTableOS2__V4_not_96");
51f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com
52f8d1aee2526a384a570b082b17f3a19fe72bd15ebungeman@google.com#endif
53