Chromium Code Reviews| 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_name_DEFINED | 8 #ifndef SkOTTable_name_DEFINED |
| 9 #define SkOTTable_name_DEFINED | 9 #define SkOTTable_name_DEFINED |
| 10 | 10 |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 540 /** The length of the string in SK_OT_BYTEs. */ | 540 /** The length of the string in SK_OT_BYTEs. */ |
| 541 SK_OT_USHORT length; | 541 SK_OT_USHORT length; |
| 542 | 542 |
| 543 /** Offset in SK_OT_BYTEs from start of string storage area | 543 /** Offset in SK_OT_BYTEs from start of string storage area |
| 544 * (see SkOTTableName::stringOffset). | 544 * (see SkOTTableName::stringOffset). |
| 545 */ | 545 */ |
| 546 SK_OT_USHORT offset; | 546 SK_OT_USHORT offset; |
| 547 }; //langTagRecord[langTagCount] | 547 }; //langTagRecord[langTagCount] |
| 548 }; //format1ext (if format == format_1) | 548 }; //format1ext (if format == format_1) |
| 549 | 549 |
| 550 class Iterator { | 550 class Iterator { |
|
mtklein
2014/08/15 19:45:06
Follow up by moving the Iterator out?
| |
| 551 public: | 551 public: |
| 552 Iterator(const SkOTTableName& name) : fName(name), fIndex(0), fType(-1) { } | 552 Iterator(const SkOTTableName& name) : fName(name), fIndex(0), fType(-1) { } |
| 553 Iterator(const SkOTTableName& name, SkOTTableName::Record::NameID::Prede fined::Value type) | 553 Iterator(const SkOTTableName& name, SkOTTableName::Record::NameID::Prede fined::Value type) |
| 554 : fName(name), fIndex(0), fType(type) | 554 : fName(name), fIndex(0), fType(type) |
| 555 { } | 555 { } |
| 556 | 556 |
| 557 void reset(SkOTTableName::Record::NameID::Predefined::Value type) { | 557 void reset(SkOTTableName::Record::NameID::Predefined::Value type) { |
| 558 fIndex = 0; | 558 fIndex = 0; |
| 559 fType = type; | 559 fType = type; |
| 560 } | 560 } |
| 561 | 561 |
| 562 struct Record { | 562 struct Record { |
| 563 SK_OT_USHORT type; | |
| 564 SkString name; | 563 SkString name; |
| 565 SkString language; | 564 SkString language; |
| 565 SK_OT_USHORT type; | |
| 566 }; | 566 }; |
| 567 bool next(Record&); | 567 bool next(Record&); |
| 568 | 568 |
| 569 private: | 569 private: |
| 570 const SkOTTableName& fName; | 570 const SkOTTableName& fName; |
| 571 size_t fIndex; | 571 size_t fIndex; |
| 572 int fType; | 572 int fType; |
| 573 }; | 573 }; |
| 574 }; | 574 }; |
| 575 | 575 |
| 576 #pragma pack(pop) | 576 #pragma pack(pop) |
| 577 | 577 |
| 578 | 578 |
| 579 SK_COMPILE_ASSERT(sizeof(SkOTTableName) == 6, sizeof_SkOTTableName_not_6); | 579 SK_COMPILE_ASSERT(sizeof(SkOTTableName) == 6, sizeof_SkOTTableName_not_6); |
| 580 SK_COMPILE_ASSERT(sizeof(SkOTTableName::Format1Ext) == 2, sizeof_SkOTTableNameF1 _not_2); | 580 SK_COMPILE_ASSERT(sizeof(SkOTTableName::Format1Ext) == 2, sizeof_SkOTTableNameF1 _not_2); |
| 581 SK_COMPILE_ASSERT(sizeof(SkOTTableName::Format1Ext::LangTagRecord) == 4, sizeof_ SkOTTableNameLangTagRecord_not_4); | 581 SK_COMPILE_ASSERT(sizeof(SkOTTableName::Format1Ext::LangTagRecord) == 4, sizeof_ SkOTTableNameLangTagRecord_not_4); |
| 582 SK_COMPILE_ASSERT(sizeof(SkOTTableName::Record) == 12, sizeof_SkOTTableNameRecor d_not_12); | 582 SK_COMPILE_ASSERT(sizeof(SkOTTableName::Record) == 12, sizeof_SkOTTableNameRecor d_not_12); |
| 583 | 583 |
| 584 #endif | 584 #endif |
| OLD | NEW |