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(); |