| 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" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 trailerDict.insertInt("Size", int(objCount)); | 58 trailerDict.insertInt("Size", int(objCount)); |
| 59 trailerDict.insert("Root", new SkPDFObjRef(docCatalog))->unref(); | 59 trailerDict.insert("Root", new SkPDFObjRef(docCatalog))->unref(); |
| 60 | 60 |
| 61 stream->writeText("trailer\n"); | 61 stream->writeText("trailer\n"); |
| 62 trailerDict.emitObject(stream, catalog); | 62 trailerDict.emitObject(stream, catalog); |
| 63 stream->writeText("\nstartxref\n"); | 63 stream->writeText("\nstartxref\n"); |
| 64 stream->writeBigDecAsText(xRefFileOffset); | 64 stream->writeBigDecAsText(xRefFileOffset); |
| 65 stream->writeText("\n%%EOF"); | 65 stream->writeText("\n%%EOF"); |
| 66 } | 66 } |
| 67 | 67 |
| 68 bool SkPDFDocument::EmitPDF(const SkTDArray<SkPDFDevice*>& pageDevices, | 68 bool SkPDFDocument::EmitPDF(const SkTDArray<const SkPDFDevice*>& pageDevices, |
| 69 SkWStream* stream) { | 69 SkWStream* stream) { |
| 70 if (pageDevices.isEmpty()) { | 70 if (pageDevices.isEmpty()) { |
| 71 return false; | 71 return false; |
| 72 } | 72 } |
| 73 SkTDArray<SkPDFPage*> pages; | 73 SkTDArray<SkPDFPage*> pages; |
| 74 for (int i = 0; i < pageDevices.count(); i++) { | 74 for (int i = 0; i < pageDevices.count(); i++) { |
| 75 SkASSERT(pageDevices[i]); | 75 SkASSERT(pageDevices[i]); |
| 76 // Reference from new passed to pages. | 76 // Reference from new passed to pages. |
| 77 pages.push(SkNEW_ARGS(SkPDFPage, (pageDevices[i]))); | 77 pages.push(SkNEW_ARGS(SkPDFPage, (pageDevices[i]))); |
| 78 } | 78 } |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 } | 220 } |
| 221 } | 221 } |
| 222 if (notSubsettableCount) { | 222 if (notSubsettableCount) { |
| 223 *notSubsettableCount = notSubsettable; | 223 *notSubsettableCount = notSubsettable; |
| 224 | 224 |
| 225 } | 225 } |
| 226 if (notEmbeddableCount) { | 226 if (notEmbeddableCount) { |
| 227 *notEmbeddableCount = notEmbeddable; | 227 *notEmbeddableCount = notEmbeddable; |
| 228 } | 228 } |
| 229 } | 229 } |
| OLD | NEW |