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

Unified Diff: src/pdf/SkPDFPage.cpp

Issue 1033543002: SKPDF: refactor pdfcatalog and pdfdocument (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-03-25 (Wednesday) 14:17:42 EDT 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pdf/SkPDFPage.h ('k') | src/pdf/SkPDFTypes.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFPage.cpp
diff --git a/src/pdf/SkPDFPage.cpp b/src/pdf/SkPDFPage.cpp
index f86b252105d59f5056ac1b9af4c9a2e7b3007c97..13a7ffe4ed3f2d8fec722397e22994d71b5157a8 100644
--- a/src/pdf/SkPDFPage.cpp
+++ b/src/pdf/SkPDFPage.cpp
@@ -21,9 +21,7 @@ SkPDFPage::SkPDFPage(const SkPDFDevice* content)
SkPDFPage::~SkPDFPage() {}
-void SkPDFPage::finalizePage(SkPDFCatalog* catalog, bool firstPage,
- const SkTSet<SkPDFObject*>& knownResourceObjects,
- SkTSet<SkPDFObject*>* newResourceObjects) {
+void SkPDFPage::finalizePage() {
if (fContentStream.get() == NULL) {
SkAutoTUnref<SkPDFResourceDict> deviceResourceDict(
fDevice->createResourceDict());
@@ -38,12 +36,10 @@ void SkPDFPage::finalizePage(SkPDFCatalog* catalog, bool firstPage,
fContentStream.reset(new SkPDFStream(content.get()));
insert("Contents", new SkPDFObjRef(fContentStream.get()))->unref();
}
- catalog->addObject(fContentStream.get(), firstPage);
}
// static
void SkPDFPage::GeneratePageTree(const SkTDArray<SkPDFPage*>& pages,
- SkPDFCatalog* catalog,
SkTDArray<SkPDFDict*>* pageTree,
SkPDFDict** rootNode) {
// PDF wants a tree describing all the pages in the document. We arbitrary
@@ -94,10 +90,8 @@ void SkPDFPage::GeneratePageTree(const SkTDArray<SkPDFPage*>& pages,
// Probably doesn't matter because they are so small.
if (curNodes[i] != pages[0]) {
pageTree->push(curNodes[i]); // Transfer reference.
- catalog->addObject(curNodes[i], false);
} else {
SkSafeUnref(curNodes[i]);
- catalog->addObject(curNodes[i], true);
}
}
@@ -123,7 +117,6 @@ void SkPDFPage::GeneratePageTree(const SkTDArray<SkPDFPage*>& pages,
} while (curNodes.count() > 1);
pageTree->push(curNodes[0]); // Transfer reference.
- catalog->addObject(curNodes[0], false);
if (rootNode) {
*rootNode = curNodes[0];
}
« no previous file with comments | « src/pdf/SkPDFPage.h ('k') | src/pdf/SkPDFTypes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698