| OLD | NEW |
| 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" |
| 11 #include "SkPDFDevice.h" | 11 #include "SkPDFDevice.h" |
| 12 #include "SkPDFDocument.h" | 12 #include "SkPDFDocument.h" |
| 13 #include "SkPDFFont.h" | 13 #include "SkPDFFont.h" |
| 14 #include "SkPDFPage.h" | 14 #include "SkPDFPage.h" |
| 15 #include "SkPDFTypes.h" | 15 #include "SkPDFTypes.h" |
| 16 #include "SkStream.h" | 16 #include "SkStream.h" |
| 17 #include "SkTSet.h" | |
| 18 | 17 |
| 19 static void addResourcesToCatalog(bool firstPage, | 18 static void addResourcesToCatalog(bool firstPage, |
| 20 SkTSet<SkPDFObject*>* resourceSet, | 19 SkTSet<SkPDFObject*>* resourceSet, |
| 21 SkPDFCatalog* catalog) { | 20 SkPDFCatalog* catalog) { |
| 22 for (int i = 0; i < resourceSet->count(); i++) { | 21 for (int i = 0; i < resourceSet->count(); i++) { |
| 23 catalog->addObject((*resourceSet)[i], firstPage); | 22 catalog->addObject((*resourceSet)[i], firstPage); |
| 24 } | 23 } |
| 25 } | 24 } |
| 26 | 25 |
| 27 static void perform_font_subsetting(SkPDFCatalog* catalog, | 26 static void perform_font_subsetting(SkPDFCatalog* catalog, |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 fTrailerDict->insertInt("Size", int(objCount)); | 301 fTrailerDict->insertInt("Size", int(objCount)); |
| 303 fTrailerDict->insert("Root", new SkPDFObjRef(fDocCatalog))->unref(); | 302 fTrailerDict->insert("Root", new SkPDFObjRef(fDocCatalog))->unref(); |
| 304 } | 303 } |
| 305 | 304 |
| 306 stream->writeText("trailer\n"); | 305 stream->writeText("trailer\n"); |
| 307 fTrailerDict->emitObject(stream, fCatalog.get()); | 306 fTrailerDict->emitObject(stream, fCatalog.get()); |
| 308 stream->writeText("\nstartxref\n"); | 307 stream->writeText("\nstartxref\n"); |
| 309 stream->writeBigDecAsText(fXRefFileOffset); | 308 stream->writeBigDecAsText(fXRefFileOffset); |
| 310 stream->writeText("\n%%EOF"); | 309 stream->writeText("\n%%EOF"); |
| 311 } | 310 } |
| OLD | NEW |