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

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

Issue 827733004: Change function signature of SkPDFObject::emitObject. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | src/pdf/SkPDFFont.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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 184
185 for (int i = 0; i < fOtherPageResources->count(); i++) { 185 for (int i = 0; i < fOtherPageResources->count(); i++) {
186 fileOffset += SkToOffT(fCatalog->setFileOffset((*fOtherPageResources )[i], fileOffset)); 186 fileOffset += SkToOffT(fCatalog->setFileOffset((*fOtherPageResources )[i], fileOffset));
187 } 187 }
188 188
189 fileOffset += fCatalog->setSubstituteResourcesOffsets(fileOffset, false) ; 189 fileOffset += fCatalog->setSubstituteResourcesOffsets(fileOffset, false) ;
190 fXRefFileOffset = fileOffset; 190 fXRefFileOffset = fileOffset;
191 } 191 }
192 192
193 emitHeader(stream); 193 emitHeader(stream);
194 fDocCatalog->emitObject(stream, fCatalog.get(), true); 194 fDocCatalog->emitIndirectObject(stream, fCatalog.get());
195 fPages[0]->emitObject(stream, fCatalog.get(), true); 195 fPages[0]->emitIndirectObject(stream, fCatalog.get());
196 fPages[0]->emitPage(stream, fCatalog.get()); 196 fPages[0]->emitPage(stream, fCatalog.get());
197 for (int i = 0; i < fFirstPageResources->count(); i++) { 197 for (int i = 0; i < fFirstPageResources->count(); i++) {
198 (*fFirstPageResources)[i]->emit(stream, fCatalog.get(), true); 198 (*fFirstPageResources)[i]->emit(stream, fCatalog.get(), true);
199 } 199 }
200 fCatalog->emitSubstituteResources(stream, true); 200 fCatalog->emitSubstituteResources(stream, true);
201 // TODO(vandebo): Support linearized format 201 // TODO(vandebo): Support linearized format
202 // if (fPages.size() > 1) { 202 // if (fPages.size() > 1) {
203 // // TODO(vandebo): Save the file offset for the first page xref table. 203 // // TODO(vandebo): Save the file offset for the first page xref table.
204 // fCatalog->emitXrefTable(stream, true); 204 // fCatalog->emitXrefTable(stream, true);
205 // } 205 // }
206 206
207 for (int i = 0; i < fPageTree.count(); i++) { 207 for (int i = 0; i < fPageTree.count(); i++) {
208 fPageTree[i]->emitObject(stream, fCatalog.get(), true); 208 fPageTree[i]->emitIndirectObject(stream, fCatalog.get());
209 } 209 }
210 210
211 for (int i = 1; i < fPages.count(); i++) { 211 for (int i = 1; i < fPages.count(); i++) {
212 fPages[i]->emitPage(stream, fCatalog.get()); 212 fPages[i]->emitPage(stream, fCatalog.get());
213 } 213 }
214 214
215 for (int i = 0; i < fOtherPageResources->count(); i++) { 215 for (int i = 0; i < fOtherPageResources->count(); i++) {
216 (*fOtherPageResources)[i]->emit(stream, fCatalog.get(), true); 216 (*fOtherPageResources)[i]->emit(stream, fCatalog.get(), true);
217 } 217 }
218 218
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 if (NULL == fTrailerDict) { 333 if (NULL == fTrailerDict) {
334 fTrailerDict = SkNEW(SkPDFDict); 334 fTrailerDict = SkNEW(SkPDFDict);
335 335
336 // TODO(vandebo): Linearized format will take a Prev entry too. 336 // TODO(vandebo): Linearized format will take a Prev entry too.
337 // TODO(vandebo): PDF/A requires an ID entry. 337 // TODO(vandebo): PDF/A requires an ID entry.
338 fTrailerDict->insertInt("Size", int(objCount)); 338 fTrailerDict->insertInt("Size", int(objCount));
339 fTrailerDict->insert("Root", new SkPDFObjRef(fDocCatalog))->unref(); 339 fTrailerDict->insert("Root", new SkPDFObjRef(fDocCatalog))->unref();
340 } 340 }
341 341
342 stream->writeText("trailer\n"); 342 stream->writeText("trailer\n");
343 fTrailerDict->emitObject(stream, fCatalog.get(), false); 343 fTrailerDict->emitObject(stream, fCatalog.get());
344 stream->writeText("\nstartxref\n"); 344 stream->writeText("\nstartxref\n");
345 stream->writeBigDecAsText(fXRefFileOffset); 345 stream->writeBigDecAsText(fXRefFileOffset);
346 stream->writeText("\n%%EOF"); 346 stream->writeText("\n%%EOF");
347 } 347 }
OLDNEW
« no previous file with comments | « no previous file | src/pdf/SkPDFFont.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698