Index: src/pdf/SkPDFPage.cpp |
diff --git a/src/pdf/SkPDFPage.cpp b/src/pdf/SkPDFPage.cpp |
index da0179a283563513c7f3921edac589e4684abf24..f86b252105d59f5056ac1b9af4c9a2e7b3007c97 100644 |
--- a/src/pdf/SkPDFPage.cpp |
+++ b/src/pdf/SkPDFPage.cpp |
@@ -13,7 +13,7 @@ |
#include "SkPDFPage.h" |
#include "SkPDFResourceDict.h" |
-SkPDFPage::SkPDFPage(SkPDFDevice* content) |
+SkPDFPage::SkPDFPage(const SkPDFDevice* content) |
: SkPDFDict("Page"), |
fDevice(content) { |
SkSafeRef(content); |
@@ -25,7 +25,9 @@ void SkPDFPage::finalizePage(SkPDFCatalog* catalog, bool firstPage, |
const SkTSet<SkPDFObject*>& knownResourceObjects, |
SkTSet<SkPDFObject*>* newResourceObjects) { |
if (fContentStream.get() == NULL) { |
- this->insert("Resources", fDevice->getResourceDict()); |
+ SkAutoTUnref<SkPDFResourceDict> deviceResourceDict( |
+ fDevice->createResourceDict()); |
+ this->insert("Resources", deviceResourceDict.get()); |
SkSafeUnref(this->insert("MediaBox", fDevice->copyMediaBox())); |
SkPDFArray* annots = fDevice->getAnnotations(); |
if (annots && annots->size() > 0) { |