aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/pdf/SkPDFDevice.h4
-rw-r--r--include/pdf/SkPDFDocument.h4
-rw-r--r--include/pdf/SkPDFPage.h2
-rw-r--r--src/pdf/SkPDFDevice.cpp4
-rw-r--r--src/pdf/SkPDFDocument.cpp5
-rw-r--r--src/pdf/SkPDFFormXObject.cpp2
-rw-r--r--src/pdf/SkPDFPage.cpp4
-rw-r--r--src/pdf/SkPDFShader.cpp2
8 files changed, 13 insertions, 14 deletions
diff --git a/include/pdf/SkPDFDevice.h b/include/pdf/SkPDFDevice.h
index 4c526d2291..7a3e7bb7f1 100644
--- a/include/pdf/SkPDFDevice.h
+++ b/include/pdf/SkPDFDevice.h
@@ -123,9 +123,9 @@ public:
// PDF specific methods.
- /** Returns a reference to the resource dictionary for this device.
+ /** Returns the resource dictionary for this device.
*/
- SK_API const SkRefPtr<SkPDFDict>& getResourceDict();
+ SK_API SkPDFDict* getResourceDict();
/** Get the list of resources (PDF objects) used on this page.
* @param resourceList A list to append the resources to.
diff --git a/include/pdf/SkPDFDocument.h b/include/pdf/SkPDFDocument.h
index 1a5d8354e9..3f171f5f27 100644
--- a/include/pdf/SkPDFDocument.h
+++ b/include/pdf/SkPDFDocument.h
@@ -60,14 +60,14 @@ public:
* @param pageNumber The position to add the passed device (1 based).
* @param pdfDevice The page to add to this document.
*/
- SK_API bool setPage(int pageNumber, const SkRefPtr<SkPDFDevice>& pdfDevice);
+ SK_API bool setPage(int pageNumber, SkPDFDevice* pdfDevice);
/** Append the passed pdf device to the document as a new page. Returns
* true if successful. Will fail if the document has already been emitted.
*
* @param pdfDevice The page to add to this document.
*/
- SK_API bool appendPage(const SkRefPtr<SkPDFDevice>& pdfDevice);
+ SK_API bool appendPage(SkPDFDevice* pdfDevice);
/** Get the list of pages in this document.
*/
diff --git a/include/pdf/SkPDFPage.h b/include/pdf/SkPDFPage.h
index 2a0fe166f3..a3978744e7 100644
--- a/include/pdf/SkPDFPage.h
+++ b/include/pdf/SkPDFPage.h
@@ -37,7 +37,7 @@ public:
* have content on it yet.
* @param content The page content.
*/
- explicit SkPDFPage(const SkRefPtr<SkPDFDevice>& content);
+ explicit SkPDFPage(SkPDFDevice* content);
~SkPDFPage();
/** Before a page and its contents can be sized and emitted, it must
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index caba8226b4..619d55d4c1 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -983,7 +983,7 @@ void SkPDFDevice::setDrawingArea(DrawingArea drawingArea) {
fDrawingArea = drawingArea;
}
-const SkRefPtr<SkPDFDict>& SkPDFDevice::getResourceDict() {
+SkPDFDict* SkPDFDevice::getResourceDict() {
if (fResourceDict.get() == NULL) {
fResourceDict = new SkPDFDict;
fResourceDict->unref(); // SkRefPtr and new both took a reference.
@@ -1048,7 +1048,7 @@ const SkRefPtr<SkPDFDict>& SkPDFDevice::getResourceDict() {
procSets->appendName(procs[i]);
fResourceDict->insert("ProcSet", procSets.get());
}
- return fResourceDict;
+ return fResourceDict.get();
}
void SkPDFDevice::getResources(SkTDArray<SkPDFObject*>* resourceList) const {
diff --git a/src/pdf/SkPDFDocument.cpp b/src/pdf/SkPDFDocument.cpp
index d60512e7ac..55aadf4077 100644
--- a/src/pdf/SkPDFDocument.cpp
+++ b/src/pdf/SkPDFDocument.cpp
@@ -165,8 +165,7 @@ bool SkPDFDocument::emitPDF(SkWStream* stream) {
return true;
}
-bool SkPDFDocument::setPage(int pageNumber,
- const SkRefPtr<SkPDFDevice>& pdfDevice) {
+bool SkPDFDocument::setPage(int pageNumber, SkPDFDevice* pdfDevice) {
if (fPageTree.count() != 0) {
return false;
}
@@ -188,7 +187,7 @@ bool SkPDFDocument::setPage(int pageNumber,
return true;
}
-bool SkPDFDocument::appendPage(const SkRefPtr<SkPDFDevice>& pdfDevice) {
+bool SkPDFDocument::appendPage(SkPDFDevice* pdfDevice) {
if (fPageTree.count() != 0) {
return false;
}
diff --git a/src/pdf/SkPDFFormXObject.cpp b/src/pdf/SkPDFFormXObject.cpp
index 0a75d2a25e..57745f8da1 100644
--- a/src/pdf/SkPDFFormXObject.cpp
+++ b/src/pdf/SkPDFFormXObject.cpp
@@ -36,7 +36,7 @@ SkPDFFormXObject::SkPDFFormXObject(SkPDFDevice* device) {
insertName("Type", "XObject");
insertName("Subtype", "Form");
insert("BBox", device->getMediaBox().get());
- insert("Resources", device->getResourceDict().get());
+ insert("Resources", device->getResourceDict());
// We invert the initial transform and apply that to the xobject so that
// it doesn't get applied twice. We can't just undo it because it's
diff --git a/src/pdf/SkPDFPage.cpp b/src/pdf/SkPDFPage.cpp
index 3823f745d7..09849b0ac8 100644
--- a/src/pdf/SkPDFPage.cpp
+++ b/src/pdf/SkPDFPage.cpp
@@ -19,7 +19,7 @@
#include "SkPDFPage.h"
#include "SkStream.h"
-SkPDFPage::SkPDFPage(const SkRefPtr<SkPDFDevice>& content)
+SkPDFPage::SkPDFPage(SkPDFDevice* content)
: SkPDFDict("Page"),
fDevice(content) {
}
@@ -29,7 +29,7 @@ SkPDFPage::~SkPDFPage() {}
void SkPDFPage::finalizePage(SkPDFCatalog* catalog, bool firstPage,
SkTDArray<SkPDFObject*>* resourceObjects) {
if (fContentStream.get() == NULL) {
- insert("Resources", fDevice->getResourceDict().get());
+ insert("Resources", fDevice->getResourceDict());
insert("MediaBox", fDevice->getMediaBox().get());
SkRefPtr<SkStream> content = fDevice->content();
diff --git a/src/pdf/SkPDFShader.cpp b/src/pdf/SkPDFShader.cpp
index ee225173b7..17f8b27742 100644
--- a/src/pdf/SkPDFShader.cpp
+++ b/src/pdf/SkPDFShader.cpp
@@ -707,7 +707,7 @@ SkPDFImageShader::SkPDFImageShader(SkPDFShader::State* state) : fState(state) {
insert("BBox", patternBBoxArray.get());
insertScalar("XStep", patternBBox.width());
insertScalar("YStep", patternBBox.height());
- insert("Resources", pattern.getResourceDict().get());
+ insert("Resources", pattern.getResourceDict());
insert("Matrix", SkPDFUtils::MatrixToArray(finalMatrix))->unref();
fState.get()->fImage.unlockPixels();