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

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: Fix warnings Created 5 years, 5 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 eeb8aa83fd96d5ccce9381a0e32a2dd1bb5eb3d2..a2c270a24c3dcea080c3fa6068b49e1c503758d9 100644
--- a/src/doc/SkDocument_PDF.cpp
+++ b/src/doc/SkDocument_PDF.cpp
@@ -70,10 +70,9 @@ static SkPDFDict* create_pdf_page(const SkPDFDevice* pageDevice) {
SkAutoTUnref<SkPDFDict> page(SkNEW_ARGS(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(SkNEW(SkPDFArray));
+ pageDevice->appendAnnotations(annotations);
hal.canary 2015/09/16 17:30:46 if (annotations->size() > 0) { page->insertObj
+ 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