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

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

Issue 12315131: Make SkTDArray accessors const-friendly (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/images/SkImageDecoder_libbmp.cpp ('k') | src/pdf/SkPDFFont.h » ('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 25 matching lines...) Expand all
36 const SkTDArray<SkPDFPage*>& pages, 36 const SkTDArray<SkPDFPage*>& pages,
37 SkTDArray<SkPDFObject*>* substitutes) { 37 SkTDArray<SkPDFObject*>* substitutes) {
38 SkASSERT(catalog); 38 SkASSERT(catalog);
39 SkASSERT(substitutes); 39 SkASSERT(substitutes);
40 40
41 SkPDFGlyphSetMap usage; 41 SkPDFGlyphSetMap usage;
42 for (int i = 0; i < pages.count(); ++i) { 42 for (int i = 0; i < pages.count(); ++i) {
43 usage.merge(pages[i]->getFontGlyphUsage()); 43 usage.merge(pages[i]->getFontGlyphUsage());
44 } 44 }
45 SkPDFGlyphSetMap::F2BIter iterator(usage); 45 SkPDFGlyphSetMap::F2BIter iterator(usage);
46 SkPDFGlyphSetMap::FontGlyphSetPair* entry = iterator.next(); 46 const SkPDFGlyphSetMap::FontGlyphSetPair* entry = iterator.next();
47 while (entry) { 47 while (entry) {
48 SkPDFFont* subsetFont = 48 SkPDFFont* subsetFont =
49 entry->fFont->getFontSubset(entry->fGlyphSet); 49 entry->fFont->getFontSubset(entry->fGlyphSet);
50 if (subsetFont) { 50 if (subsetFont) {
51 catalog->setSubstitute(entry->fFont, subsetFont); 51 catalog->setSubstitute(entry->fFont, subsetFont);
52 substitutes->push(subsetFont); // Transfer ownership to substitutes 52 substitutes->push(subsetFont); // Transfer ownership to substitutes
53 } 53 }
54 entry = iterator.next(); 54 entry = iterator.next();
55 } 55 }
56 } 56 }
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 fTrailerDict->insertInt("Size", int(objCount)); 267 fTrailerDict->insertInt("Size", int(objCount));
268 fTrailerDict->insert("Root", new SkPDFObjRef(fDocCatalog))->unref(); 268 fTrailerDict->insert("Root", new SkPDFObjRef(fDocCatalog))->unref();
269 } 269 }
270 270
271 stream->writeText("trailer\n"); 271 stream->writeText("trailer\n");
272 fTrailerDict->emitObject(stream, fCatalog.get(), false); 272 fTrailerDict->emitObject(stream, fCatalog.get(), false);
273 stream->writeText("\nstartxref\n"); 273 stream->writeText("\nstartxref\n");
274 stream->writeBigDecAsText(fXRefFileOffset); 274 stream->writeBigDecAsText(fXRefFileOffset);
275 stream->writeText("\n%%EOF"); 275 stream->writeText("\n%%EOF");
276 } 276 }
OLDNEW
« no previous file with comments | « src/images/SkImageDecoder_libbmp.cpp ('k') | src/pdf/SkPDFFont.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698