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

Unified Diff: src/pdf/SkPDFPage.cpp

Issue 1035513003: SkPDF: skpdfdocument and skpdfpage use skpdfdevice in a const way (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 9 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 | « src/pdf/SkPDFPage.h ('k') | src/pdf/SkPDFShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « src/pdf/SkPDFPage.h ('k') | src/pdf/SkPDFShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698