Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: src/sfnt/SkOTTable_name.h

Issue 474313002: Correct order for alignment in name iterator record. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698