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

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

Issue 958433003: SkPDF: replace SkPDFDevice::copyContentToData (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/SkPDFFormXObject.cpp ('k') | src/pdf/SkPDFShader.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 2010 The Android Open Source Project 3 * Copyright 2010 The Android Open Source Project
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 "SkData.h" 10 #include "SkData.h"
(...skipping 14 matching lines...) Expand all
25 const SkTSet<SkPDFObject*>& knownResourceObjects, 25 const SkTSet<SkPDFObject*>& knownResourceObjects,
26 SkTSet<SkPDFObject*>* newResourceObjects) { 26 SkTSet<SkPDFObject*>* newResourceObjects) {
27 if (fContentStream.get() == NULL) { 27 if (fContentStream.get() == NULL) {
28 this->insert("Resources", fDevice->getResourceDict()); 28 this->insert("Resources", fDevice->getResourceDict());
29 SkSafeUnref(this->insert("MediaBox", fDevice->copyMediaBox())); 29 SkSafeUnref(this->insert("MediaBox", fDevice->copyMediaBox()));
30 SkPDFArray* annots = fDevice->getAnnotations(); 30 SkPDFArray* annots = fDevice->getAnnotations();
31 if (annots && annots->size() > 0) { 31 if (annots && annots->size() > 0) {
32 insert("Annots", annots); 32 insert("Annots", annots);
33 } 33 }
34 34
35 SkAutoTUnref<SkData> content(fDevice->copyContentToData()); 35 SkAutoTDelete<SkStreamAsset> content(fDevice->content());
36 fContentStream.reset(new SkPDFStream(content.get())); 36 fContentStream.reset(new SkPDFStream(content.get()));
37 insert("Contents", new SkPDFObjRef(fContentStream.get()))->unref(); 37 insert("Contents", new SkPDFObjRef(fContentStream.get()))->unref();
38 } 38 }
39 catalog->addObject(fContentStream.get(), firstPage); 39 catalog->addObject(fContentStream.get(), firstPage);
40 } 40 }
41 41
42 // static 42 // static
43 void SkPDFPage::GeneratePageTree(const SkTDArray<SkPDFPage*>& pages, 43 void SkPDFPage::GeneratePageTree(const SkTDArray<SkPDFPage*>& pages,
44 SkPDFCatalog* catalog, 44 SkPDFCatalog* catalog,
45 SkTDArray<SkPDFDict*>* pageTree, 45 SkTDArray<SkPDFDict*>* pageTree,
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 return fDevice->getFontGlyphUsage(); 135 return fDevice->getFontGlyphUsage();
136 } 136 }
137 137
138 void SkPDFPage::appendDestinations(SkPDFDict* dict) { 138 void SkPDFPage::appendDestinations(SkPDFDict* dict) {
139 fDevice->appendDestinations(dict, this); 139 fDevice->appendDestinations(dict, this);
140 } 140 }
141 141
142 SkPDFObject* SkPDFPage::getContentStream() const { 142 SkPDFObject* SkPDFPage::getContentStream() const {
143 return fContentStream.get(); 143 return fContentStream.get();
144 } 144 }
OLDNEW
« no previous file with comments | « src/pdf/SkPDFFormXObject.cpp ('k') | src/pdf/SkPDFShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698