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

Side by Side Diff: src/pdf/SkPDFFont.cpp

Issue 1823683005: SkPDF: Hold page objects, not SkPDFDevices. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-03-22 (Tuesday) 17:16:46 EDT Created 4 years, 9 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 | « src/pdf/SkPDFFont.h ('k') | 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 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
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
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 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFFont.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698