OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #include <ctype.h> | 8 #include <ctype.h> |
9 | 9 |
10 #include "SkData.h" | 10 #include "SkData.h" |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 | 657 |
658 /////////////////////////////////////////////////////////////////////////////// | 658 /////////////////////////////////////////////////////////////////////////////// |
659 // class SkPDFGlyphSetMap | 659 // class SkPDFGlyphSetMap |
660 /////////////////////////////////////////////////////////////////////////////// | 660 /////////////////////////////////////////////////////////////////////////////// |
661 SkPDFGlyphSetMap::FontGlyphSetPair::FontGlyphSetPair(SkPDFFont* font, | 661 SkPDFGlyphSetMap::FontGlyphSetPair::FontGlyphSetPair(SkPDFFont* font, |
662 SkPDFGlyphSet* glyphSet) | 662 SkPDFGlyphSet* glyphSet) |
663 : fFont(font), | 663 : fFont(font), |
664 fGlyphSet(glyphSet) { | 664 fGlyphSet(glyphSet) { |
665 } | 665 } |
666 | 666 |
667 SkPDFGlyphSetMap::F2BIter::F2BIter(const SkPDFGlyphSetMap& map) { | |
668 reset(map); | |
669 } | |
670 | |
671 const SkPDFGlyphSetMap::FontGlyphSetPair* SkPDFGlyphSetMap::F2BIter::next() cons
t { | |
672 if (fIndex >= fMap->count()) { | |
673 return nullptr; | |
674 } | |
675 return &((*fMap)[fIndex++]); | |
676 } | |
677 | |
678 void SkPDFGlyphSetMap::F2BIter::reset(const SkPDFGlyphSetMap& map) { | |
679 fMap = &(map.fMap); | |
680 fIndex = 0; | |
681 } | |
682 | |
683 SkPDFGlyphSetMap::SkPDFGlyphSetMap() { | 667 SkPDFGlyphSetMap::SkPDFGlyphSetMap() { |
684 } | 668 } |
685 | 669 |
686 SkPDFGlyphSetMap::~SkPDFGlyphSetMap() { | 670 SkPDFGlyphSetMap::~SkPDFGlyphSetMap() { |
687 reset(); | 671 reset(); |
688 } | 672 } |
689 | 673 |
690 void SkPDFGlyphSetMap::merge(const SkPDFGlyphSetMap& usage) { | 674 void SkPDFGlyphSetMap::merge(const SkPDFGlyphSetMap& usage) { |
691 for (int i = 0; i < usage.fMap.count(); ++i) { | 675 for (int i = 0; i < usage.fMap.count(); ++i) { |
692 SkPDFGlyphSet* myUsage = getGlyphSetForFont(usage.fMap[i].fFont); | 676 SkPDFGlyphSet* myUsage = getGlyphSetForFont(usage.fMap[i].fFont); |
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1434 } | 1418 } |
1435 return *canon->fCanEmbedTypeface.set(id, canEmbed); | 1419 return *canon->fCanEmbedTypeface.set(id, canEmbed); |
1436 } | 1420 } |
1437 | 1421 |
1438 void SkPDFFont::drop() { | 1422 void SkPDFFont::drop() { |
1439 fTypeface = nullptr; | 1423 fTypeface = nullptr; |
1440 fFontInfo = nullptr; | 1424 fFontInfo = nullptr; |
1441 fDescriptor = nullptr; | 1425 fDescriptor = nullptr; |
1442 this->SkPDFDict::drop(); | 1426 this->SkPDFDict::drop(); |
1443 } | 1427 } |
OLD | NEW |