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

Unified Diff: src/doc/SkDocument_PDF.cpp

Issue 1069103003: SkPDF: Refactor SkPDFObject heiararchy. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-04-25 (Saturday) 09:40:48 EDT Created 5 years, 8 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 | « no previous file | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/doc/SkDocument_PDF.cpp
diff --git a/src/doc/SkDocument_PDF.cpp b/src/doc/SkDocument_PDF.cpp
index e812cd5cf300cf215ba7ba68b0f76a313357101d..1e2148bc885da643602e03486104096afe88b184 100644
--- a/src/doc/SkDocument_PDF.cpp
+++ b/src/doc/SkDocument_PDF.cpp
@@ -94,10 +94,6 @@ static void generate_page_tree(const SkTDArray<SkPDFDict*>& pages,
// one child.
static const int kNodeSize = 8;
- SkAutoTUnref<SkPDFName> kidsName(new SkPDFName("Kids"));
- SkAutoTUnref<SkPDFName> countName(new SkPDFName("Count"));
- SkAutoTUnref<SkPDFName> parentName(new SkPDFName("Parent"));
-
// curNodes takes a reference to its items, which it passes to pageTree.
SkTDArray<SkPDFDict*> curNodes;
curNodes.setReserve(pages.count());
@@ -126,7 +122,7 @@ static void generate_page_tree(const SkTDArray<SkPDFDict*>& pages,
int count = 0;
for (; i < curNodes.count() && count < kNodeSize; i++, count++) {
- curNodes[i]->insert(parentName.get(), newNodeRef.get());
+ curNodes[i]->insert("Parent", newNodeRef.get());
kids->append(new SkPDFObjRef(curNodes[i]))->unref();
// TODO(vandebo): put the objects in strict access order.
@@ -149,8 +145,8 @@ static void generate_page_tree(const SkTDArray<SkPDFDict*>& pages,
if (i == curNodes.count()) {
pageCount = ((pages.count() - 1) % treeCapacity) + 1;
}
- newNode->insert(countName.get(), new SkPDFInt(pageCount))->unref();
- newNode->insert(kidsName.get(), kids.get());
+ newNode->insert("Count", new SkPDFInt(pageCount))->unref();
+ newNode->insert("Kids", kids.get());
nextRoundNodes.push(newNode); // Transfer reference.
}
« no previous file with comments | « no previous file | src/pdf/SkPDFDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698