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

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

Issue 936403002: PDF: why do we have flags no one uses (or can use)? (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 10 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/SkPDFDocument.h ('k') | src/pdf/SkPDFImage.cpp » ('j') | 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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkPDFCatalog.h" 10 #include "SkPDFCatalog.h"
(...skipping 29 matching lines...) Expand all
40 SkPDFFont* subsetFont = 40 SkPDFFont* subsetFont =
41 entry->fFont->getFontSubset(entry->fGlyphSet); 41 entry->fFont->getFontSubset(entry->fGlyphSet);
42 if (subsetFont) { 42 if (subsetFont) {
43 catalog->setSubstitute(entry->fFont, subsetFont); 43 catalog->setSubstitute(entry->fFont, subsetFont);
44 substitutes->push(subsetFont); // Transfer ownership to substitutes 44 substitutes->push(subsetFont); // Transfer ownership to substitutes
45 } 45 }
46 entry = iterator.next(); 46 entry = iterator.next();
47 } 47 }
48 } 48 }
49 49
50 SkPDFDocument::SkPDFDocument(Flags flags) 50 SkPDFDocument::SkPDFDocument()
51 : fXRefFileOffset(0), 51 : fXRefFileOffset(0),
52 fTrailerDict(NULL) { 52 fTrailerDict(NULL) {
53 fCatalog.reset(new SkPDFCatalog(flags)); 53 fCatalog.reset(SkNEW(SkPDFCatalog));
54 fDocCatalog = SkNEW_ARGS(SkPDFDict, ("Catalog")); 54 fDocCatalog = SkNEW_ARGS(SkPDFDict, ("Catalog"));
55 fCatalog->addObject(fDocCatalog, true); 55 fCatalog->addObject(fDocCatalog, true);
56 fFirstPageResources = NULL; 56 fFirstPageResources = NULL;
57 fOtherPageResources = NULL; 57 fOtherPageResources = NULL;
58 } 58 }
59 59
60 SkPDFDocument::~SkPDFDocument() { 60 SkPDFDocument::~SkPDFDocument() {
61 fPages.safeUnrefAll(); 61 fPages.safeUnrefAll();
62 62
63 // The page tree has both child and parent pointers, so it creates a 63 // The page tree has both child and parent pointers, so it creates a
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 fTrailerDict->insertInt("Size", int(objCount)); 302 fTrailerDict->insertInt("Size", int(objCount));
303 fTrailerDict->insert("Root", new SkPDFObjRef(fDocCatalog))->unref(); 303 fTrailerDict->insert("Root", new SkPDFObjRef(fDocCatalog))->unref();
304 } 304 }
305 305
306 stream->writeText("trailer\n"); 306 stream->writeText("trailer\n");
307 fTrailerDict->emitObject(stream, fCatalog.get()); 307 fTrailerDict->emitObject(stream, fCatalog.get());
308 stream->writeText("\nstartxref\n"); 308 stream->writeText("\nstartxref\n");
309 stream->writeBigDecAsText(fXRefFileOffset); 309 stream->writeBigDecAsText(fXRefFileOffset);
310 stream->writeText("\n%%EOF"); 310 stream->writeText("\n%%EOF");
311 } 311 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFDocument.h ('k') | src/pdf/SkPDFImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698