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

Unified Diff: src/doc/SkDocument_PDF.cpp

Issue 1257533004: Merge sub-device annotations in SkPDFDevice::drawDevice() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase and address comment Created 5 years, 3 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 | « gm/annotated_text.cpp ('k') | src/pdf/SkPDFDevice.h » ('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 6c4737995173f00bb7f1545716cb964467bde4d8..4ea9d89dd7d83cc938617e1d892c420f76eead27 100644
--- a/src/doc/SkDocument_PDF.cpp
+++ b/src/doc/SkDocument_PDF.cpp
@@ -70,9 +70,10 @@ static SkPDFDict* create_pdf_page(const SkPDFDevice* pageDevice) {
SkAutoTUnref<SkPDFDict> page(new SkPDFDict("Page"));
page->insertObject("Resources", pageDevice->createResourceDict());
page->insertObject("MediaBox", pageDevice->copyMediaBox());
- if (SkPDFArray* annots = pageDevice->getAnnotations()) {
- SkASSERT(annots->size() > 0);
- page->insertObject("Annots", SkRef(annots));
+ SkAutoTUnref<SkPDFArray> annotations(new SkPDFArray);
+ pageDevice->appendAnnotations(annotations);
+ if (annotations->size() > 0) {
+ page->insertObject("Annots", annotations.detach());
}
page->insertObjRef("Contents", create_pdf_page_content(pageDevice));
return page.detach();
« no previous file with comments | « gm/annotated_text.cpp ('k') | src/pdf/SkPDFDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698