1cb93a386Sopenharmony_ci/* 2cb93a386Sopenharmony_ci * Copyright 2014 Google Inc. 3cb93a386Sopenharmony_ci * 4cb93a386Sopenharmony_ci * Use of this source code is governed by a BSD-style license that can be 5cb93a386Sopenharmony_ci * found in the LICENSE file. 6cb93a386Sopenharmony_ci */ 7cb93a386Sopenharmony_ci 8cb93a386Sopenharmony_ci#ifndef SkOTTable_gasp_DEFINED 9cb93a386Sopenharmony_ci#define SkOTTable_gasp_DEFINED 10cb93a386Sopenharmony_ci 11cb93a386Sopenharmony_ci#include "src/core/SkEndian.h" 12cb93a386Sopenharmony_ci#include "src/sfnt/SkOTTableTypes.h" 13cb93a386Sopenharmony_ci 14cb93a386Sopenharmony_ci#pragma pack(push, 1) 15cb93a386Sopenharmony_ci 16cb93a386Sopenharmony_cistruct SkOTTableGridAndScanProcedure { 17cb93a386Sopenharmony_ci static const SK_OT_CHAR TAG0 = 'g'; 18cb93a386Sopenharmony_ci static const SK_OT_CHAR TAG1 = 'a'; 19cb93a386Sopenharmony_ci static const SK_OT_CHAR TAG2 = 's'; 20cb93a386Sopenharmony_ci static const SK_OT_CHAR TAG3 = 'p'; 21cb93a386Sopenharmony_ci static const SK_OT_ULONG TAG = SkOTTableTAG<SkOTTableGridAndScanProcedure>::value; 22cb93a386Sopenharmony_ci 23cb93a386Sopenharmony_ci SK_OT_USHORT version; 24cb93a386Sopenharmony_ci static const SK_OT_USHORT version0 = SkTEndian_SwapBE16(0); 25cb93a386Sopenharmony_ci static const SK_OT_USHORT version1 = SkTEndian_SwapBE16(1); 26cb93a386Sopenharmony_ci 27cb93a386Sopenharmony_ci SK_OT_USHORT numRanges; 28cb93a386Sopenharmony_ci 29cb93a386Sopenharmony_ci struct GaspRange { 30cb93a386Sopenharmony_ci SK_OT_USHORT maxPPEM; 31cb93a386Sopenharmony_ci union behavior { 32cb93a386Sopenharmony_ci struct Field { 33cb93a386Sopenharmony_ci //8-15 34cb93a386Sopenharmony_ci SK_OT_BYTE_BITFIELD( 35cb93a386Sopenharmony_ci Reserved08, 36cb93a386Sopenharmony_ci Reserved09, 37cb93a386Sopenharmony_ci Reserved10, 38cb93a386Sopenharmony_ci Reserved11, 39cb93a386Sopenharmony_ci Reserved12, 40cb93a386Sopenharmony_ci Reserved13, 41cb93a386Sopenharmony_ci Reserved14, 42cb93a386Sopenharmony_ci Reserved15) 43cb93a386Sopenharmony_ci //0-7 44cb93a386Sopenharmony_ci SK_OT_BYTE_BITFIELD( 45cb93a386Sopenharmony_ci Gridfit, 46cb93a386Sopenharmony_ci DoGray, 47cb93a386Sopenharmony_ci SymmetricGridfit, // Version 1 48cb93a386Sopenharmony_ci SymmetricSmoothing, // Version 1 49cb93a386Sopenharmony_ci Reserved04, 50cb93a386Sopenharmony_ci Reserved05, 51cb93a386Sopenharmony_ci Reserved06, 52cb93a386Sopenharmony_ci Reserved07) 53cb93a386Sopenharmony_ci } field; 54cb93a386Sopenharmony_ci struct Raw { 55cb93a386Sopenharmony_ci static const SK_OT_USHORT GridfitMask = SkTEndian_SwapBE16(1 << 0); 56cb93a386Sopenharmony_ci static const SK_OT_USHORT DoGrayMask = SkTEndian_SwapBE16(1 << 1); 57cb93a386Sopenharmony_ci static const SK_OT_USHORT SymmetricGridfitMask = SkTEndian_SwapBE16(1 << 2); 58cb93a386Sopenharmony_ci static const SK_OT_USHORT SymmetricSmoothingMask = SkTEndian_SwapBE16(1 << 3); 59cb93a386Sopenharmony_ci SK_OT_USHORT value; 60cb93a386Sopenharmony_ci } raw; 61cb93a386Sopenharmony_ci } flags; 62cb93a386Sopenharmony_ci }; //gaspRange[numRanges] 63cb93a386Sopenharmony_ci}; 64cb93a386Sopenharmony_ci 65cb93a386Sopenharmony_ci#pragma pack(pop) 66cb93a386Sopenharmony_ci 67cb93a386Sopenharmony_ci 68cb93a386Sopenharmony_ci#include <stddef.h> 69cb93a386Sopenharmony_cistatic_assert(offsetof(SkOTTableGridAndScanProcedure, numRanges) == 2, "SkOTTableGridAndScanProcedure_numRanges_not_at_2"); 70cb93a386Sopenharmony_cistatic_assert(sizeof(SkOTTableGridAndScanProcedure) == 4, "sizeof_SkOTTableGridAndScanProcedure_not_4"); 71cb93a386Sopenharmony_ci 72cb93a386Sopenharmony_ci#endif 73