gfx/skia/trunk/src/sfnt/SkOTTable_OS_2_VA.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 /*
michael@0 2 * Copyright 2012 Google Inc.
michael@0 3 *
michael@0 4 * Use of this source code is governed by a BSD-style license that can be
michael@0 5 * found in the LICENSE file.
michael@0 6 */
michael@0 7
michael@0 8 #ifndef SkOTTable_OS_2_VA_DEFINED
michael@0 9 #define SkOTTable_OS_2_VA_DEFINED
michael@0 10
michael@0 11 #include "SkEndian.h"
michael@0 12 #include "SkIBMFamilyClass.h"
michael@0 13 #include "SkOTTableTypes.h"
michael@0 14 #include "SkPanose.h"
michael@0 15 #include "SkTypedEnum.h"
michael@0 16
michael@0 17 #pragma pack(push, 1)
michael@0 18
michael@0 19 //Original V0 TT
michael@0 20 struct SkOTTableOS2_VA {
michael@0 21 SK_OT_USHORT version;
michael@0 22 //SkOTTableOS2_VA::VERSION and SkOTTableOS2_V0::VERSION are both 0.
michael@0 23 //The only way to differentiate these two versions is by the size of the table.
michael@0 24 static const SK_OT_USHORT VERSION = SkTEndian_SwapBE16(0);
michael@0 25
michael@0 26 SK_OT_SHORT xAvgCharWidth;
michael@0 27 struct WeightClass {
michael@0 28 SK_TYPED_ENUM(Value, SK_OT_USHORT,
michael@0 29 ((UltraLight, SkTEndian_SwapBE16(1)))
michael@0 30 ((ExtraLight, SkTEndian_SwapBE16(2)))
michael@0 31 ((Light, SkTEndian_SwapBE16(3)))
michael@0 32 ((SemiLight, SkTEndian_SwapBE16(4)))
michael@0 33 ((Medium, SkTEndian_SwapBE16(5)))
michael@0 34 ((SemiBold, SkTEndian_SwapBE16(6)))
michael@0 35 ((Bold, SkTEndian_SwapBE16(7)))
michael@0 36 ((ExtraBold, SkTEndian_SwapBE16(8)))
michael@0 37 ((UltraBold, SkTEndian_SwapBE16(9)))
michael@0 38 SK_SEQ_END,
michael@0 39 (value)SK_SEQ_END)
michael@0 40 } usWeightClass;
michael@0 41 struct WidthClass {
michael@0 42 SK_TYPED_ENUM(Value, SK_OT_USHORT,
michael@0 43 ((UltraCondensed, SkTEndian_SwapBE16(1)))
michael@0 44 ((ExtraCondensed, SkTEndian_SwapBE16(2)))
michael@0 45 ((Condensed, SkTEndian_SwapBE16(3)))
michael@0 46 ((SemiCondensed, SkTEndian_SwapBE16(4)))
michael@0 47 ((Medium, SkTEndian_SwapBE16(5)))
michael@0 48 ((SemiExpanded, SkTEndian_SwapBE16(6)))
michael@0 49 ((Expanded, SkTEndian_SwapBE16(7)))
michael@0 50 ((ExtraExpanded, SkTEndian_SwapBE16(8)))
michael@0 51 ((UltraExpanded, SkTEndian_SwapBE16(9)))
michael@0 52 SK_SEQ_END,
michael@0 53 (value)SK_SEQ_END)
michael@0 54 } usWidthClass;
michael@0 55 union Type {
michael@0 56 struct Field {
michael@0 57 //8-15
michael@0 58 SK_OT_BYTE_BITFIELD(
michael@0 59 Reserved08,
michael@0 60 Reserved09,
michael@0 61 Reserved10,
michael@0 62 Reserved11,
michael@0 63 Reserved12,
michael@0 64 Reserved13,
michael@0 65 Reserved14,
michael@0 66 Reserved15)
michael@0 67 //0-7
michael@0 68 SK_OT_BYTE_BITFIELD(
michael@0 69 Reserved00,
michael@0 70 Restricted,
michael@0 71 PreviewPrint,
michael@0 72 Editable,
michael@0 73 Reserved04,
michael@0 74 Reserved05,
michael@0 75 Reserved06,
michael@0 76 Reserved07)
michael@0 77 } field;
michael@0 78 struct Raw {
michael@0 79 static const SK_OT_USHORT Installable = 0;
michael@0 80 static const SK_OT_USHORT RestrictedMask = SkOTSetUSHORTBit<1>::value;
michael@0 81 static const SK_OT_USHORT PreviewPrintMask = SkOTSetUSHORTBit<2>::value;
michael@0 82 static const SK_OT_USHORT EditableMask = SkOTSetUSHORTBit<3>::value;
michael@0 83 SK_OT_USHORT value;
michael@0 84 } raw;
michael@0 85 } fsType;
michael@0 86 SK_OT_SHORT ySubscriptXSize;
michael@0 87 SK_OT_SHORT ySubscriptYSize;
michael@0 88 SK_OT_SHORT ySubscriptXOffset;
michael@0 89 SK_OT_SHORT ySubscriptYOffset;
michael@0 90 SK_OT_SHORT ySuperscriptXSize;
michael@0 91 SK_OT_SHORT ySuperscriptYSize;
michael@0 92 SK_OT_SHORT ySuperscriptXOffset;
michael@0 93 SK_OT_SHORT ySuperscriptYOffset;
michael@0 94 SK_OT_SHORT yStrikeoutSize;
michael@0 95 SK_OT_SHORT yStrikeoutPosition;
michael@0 96 SkIBMFamilyClass sFamilyClass;
michael@0 97 SkPanose panose;
michael@0 98 SK_OT_ULONG ulCharRange[4];
michael@0 99 SK_OT_CHAR achVendID[4];
michael@0 100 union Selection {
michael@0 101 struct Field {
michael@0 102 //8-15
michael@0 103 SK_OT_BYTE_BITFIELD(
michael@0 104 Reserved08,
michael@0 105 Reserved09,
michael@0 106 Reserved10,
michael@0 107 Reserved11,
michael@0 108 Reserved12,
michael@0 109 Reserved13,
michael@0 110 Reserved14,
michael@0 111 Reserved15)
michael@0 112 //0-7
michael@0 113 SK_OT_BYTE_BITFIELD(
michael@0 114 Italic,
michael@0 115 Underscore,
michael@0 116 Negative,
michael@0 117 Outlined,
michael@0 118 Strikeout,
michael@0 119 Bold,
michael@0 120 Reserved06,
michael@0 121 Reserved07)
michael@0 122 } field;
michael@0 123 struct Raw {
michael@0 124 static const SK_OT_USHORT ItalicMask = SkOTSetUSHORTBit<0>::value;
michael@0 125 static const SK_OT_USHORT UnderscoreMask = SkOTSetUSHORTBit<1>::value;
michael@0 126 static const SK_OT_USHORT NegativeMask = SkOTSetUSHORTBit<2>::value;
michael@0 127 static const SK_OT_USHORT OutlinedMask = SkOTSetUSHORTBit<3>::value;
michael@0 128 static const SK_OT_USHORT StrikeoutMask = SkOTSetUSHORTBit<4>::value;
michael@0 129 static const SK_OT_USHORT BoldMask = SkOTSetUSHORTBit<5>::value;
michael@0 130 SK_OT_USHORT value;
michael@0 131 } raw;
michael@0 132 } fsSelection;
michael@0 133 SK_OT_USHORT usFirstCharIndex;
michael@0 134 SK_OT_USHORT usLastCharIndex;
michael@0 135 };
michael@0 136
michael@0 137 #pragma pack(pop)
michael@0 138
michael@0 139
michael@0 140 SK_COMPILE_ASSERT(sizeof(SkOTTableOS2_VA) == 68, sizeof_SkOTTableOS2_VA_not_68);
michael@0 141
michael@0 142 #endif

mercurial