From 9d3cdb6886a6a6ee41aea32b04bb950b565cdd9f Mon Sep 17 00:00:00 2001 From: bungeman Date: Tue, 15 Jul 2014 20:01:56 -0700 Subject: Fix some issues with sfnt maxp headers. The TT version was missing the second to last member, and the names of the asserts in the CFF version were wrong. R=mtklein@google.com Author: bungeman@google.com Review URL: https://codereview.chromium.org/390203003 --- src/sfnt/SkOTTable_maxp_CFF.h | 4 ++-- src/sfnt/SkOTTable_maxp_TT.h | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src/sfnt') diff --git a/src/sfnt/SkOTTable_maxp_CFF.h b/src/sfnt/SkOTTable_maxp_CFF.h index 873fb66c9f..f97bff9efc 100644 --- a/src/sfnt/SkOTTable_maxp_CFF.h +++ b/src/sfnt/SkOTTable_maxp_CFF.h @@ -24,7 +24,7 @@ struct SkOTTableMaximumProfile_CFF { #include -SK_COMPILE_ASSERT(offsetof(SkOTTableMaximumProfile_CFF, numGlyphs) == 4, SkOTTableHead_glyphDataFormat_not_at_2); -SK_COMPILE_ASSERT(sizeof(SkOTTableMaximumProfile_CFF) == 6, sizeof_SkOTTableHead_not_4); +SK_COMPILE_ASSERT(offsetof(SkOTTableMaximumProfile_CFF, numGlyphs) == 4, SkOTTableMaximumProfile_CFF_numGlyphs_not_at_4); +SK_COMPILE_ASSERT(sizeof(SkOTTableMaximumProfile_CFF) == 6, sizeof_SkOTTableMaximumProfile_CFF_not_6); #endif diff --git a/src/sfnt/SkOTTable_maxp_TT.h b/src/sfnt/SkOTTable_maxp_TT.h index ad472a1f16..9aa557ff30 100644 --- a/src/sfnt/SkOTTable_maxp_TT.h +++ b/src/sfnt/SkOTTable_maxp_TT.h @@ -24,7 +24,7 @@ struct SkOTTableMaximumProfile_TT { SK_OT_USHORT maxCompositePoints; SK_OT_USHORT maxCompositeContours; struct MaxZones { - SK_TYPED_ENUM(Value, SK_OT_SHORT, + SK_TYPED_ENUM(Value, SK_OT_USHORT, ((DoesNotUseTwilightZone, SkTEndian_SwapBE16(1))) ((UsesTwilightZone, SkTEndian_SwapBE16(2))) SK_SEQ_END, @@ -36,6 +36,7 @@ struct SkOTTableMaximumProfile_TT { SK_OT_USHORT maxInstructionDefs; SK_OT_USHORT maxStackElements; SK_OT_USHORT maxSizeOfInstructions; + SK_OT_USHORT maxComponentElements; SK_OT_USHORT maxComponentDepth; }; @@ -43,7 +44,7 @@ struct SkOTTableMaximumProfile_TT { #include -SK_COMPILE_ASSERT(offsetof(SkOTTableMaximumProfile_TT, maxComponentDepth) == 28, SkOTTableMaximumProfile_TT_maxComponentDepth_not_at_26); -SK_COMPILE_ASSERT(sizeof(SkOTTableMaximumProfile_TT) == 30, sizeof_SkOTTableMaximumProfile_TT_not_28); +SK_COMPILE_ASSERT(offsetof(SkOTTableMaximumProfile_TT, maxComponentDepth) == 30, SkOTTableMaximumProfile_TT_maxComponentDepth_not_at_30); +SK_COMPILE_ASSERT(sizeof(SkOTTableMaximumProfile_TT) == 32, sizeof_SkOTTableMaximumProfile_TT_not_32); #endif -- cgit v1.2.3