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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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<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 |
73 SkTDArray<SkPDFPage*> pages; | 74 SkTDArray<SkPDFPage*> pages; |
74 for (int i = 0; i < pageDevices.count(); i++) { | 75 for (int i = 0; i < pageDevices.count(); i++) { |
75 SkASSERT(pageDevices[i]); | 76 SkASSERT(pageDevices[i]); |
| 77 SkASSERT(i == 0 || |
| 78 pageDevices[i - 1]->getCanon() == pageDevices[i]->getCanon()); |
76 // Reference from new passed to pages. | 79 // Reference from new passed to pages. |
77 pages.push(SkNEW_ARGS(SkPDFPage, (pageDevices[i]))); | 80 pages.push(SkNEW_ARGS(SkPDFPage, (pageDevices[i]))); |
78 } | 81 } |
79 SkPDFCatalog catalog; | 82 SkPDFCatalog catalog; |
80 | 83 |
81 SkTDArray<SkPDFDict*> pageTree; | 84 SkTDArray<SkPDFDict*> pageTree; |
82 SkAutoTUnref<SkPDFDict> docCatalog(SkNEW_ARGS(SkPDFDict, ("Catalog"))); | 85 SkAutoTUnref<SkPDFDict> docCatalog(SkNEW_ARGS(SkPDFDict, ("Catalog"))); |
83 SkTSet<SkPDFObject*> firstPageResources; | 86 SkTSet<SkPDFObject*> firstPageResources; |
84 SkTSet<SkPDFObject*> otherPageResources; | 87 SkTSet<SkPDFObject*> otherPageResources; |
85 SkTDArray<SkPDFObject*> substitutes; | 88 SkTDArray<SkPDFObject*> substitutes; |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 } | 223 } |
221 } | 224 } |
222 if (notSubsettableCount) { | 225 if (notSubsettableCount) { |
223 *notSubsettableCount = notSubsettable; | 226 *notSubsettableCount = notSubsettable; |
224 | 227 |
225 } | 228 } |
226 if (notEmbeddableCount) { | 229 if (notEmbeddableCount) { |
227 *notEmbeddableCount = notEmbeddable; | 230 *notEmbeddableCount = notEmbeddable; |
228 } | 231 } |
229 } | 232 } |
OLD | NEW |