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

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

Issue 1035513003: SkPDF: skpdfdocument and skpdfpage use skpdfdevice in a const way (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 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/SkPDFDocument.h ('k') | src/pdf/SkPDFFormXObject.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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFDocument.h ('k') | src/pdf/SkPDFFormXObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698