replace SkRefPtr for parameters with simple pointers
git-svn-id: http://skia.googlecode.com/svn/trunk@1913 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/pdf/SkPDFDevice.h b/include/pdf/SkPDFDevice.h
index 4c526d2..7a3e7bb 100644
--- a/include/pdf/SkPDFDevice.h
+++ b/include/pdf/SkPDFDevice.h
@@ -123,9 +123,9 @@
// 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 1a5d835..3f171f5 100644
--- a/include/pdf/SkPDFDocument.h
+++ b/include/pdf/SkPDFDocument.h
@@ -60,14 +60,14 @@
* @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 2a0fe16..a397874 100644
--- a/include/pdf/SkPDFPage.h
+++ b/include/pdf/SkPDFPage.h
@@ -37,7 +37,7 @@
* 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 caba822..619d55d 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -983,7 +983,7 @@
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 @@
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 d60512e..55aadf4 100644
--- a/src/pdf/SkPDFDocument.cpp
+++ b/src/pdf/SkPDFDocument.cpp
@@ -165,8 +165,7 @@
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 @@
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 0a75d2a..57745f8 100644
--- a/src/pdf/SkPDFFormXObject.cpp
+++ b/src/pdf/SkPDFFormXObject.cpp
@@ -36,7 +36,7 @@
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 3823f74..09849b0 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 @@
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 ee22517..17f8b27 100644
--- a/src/pdf/SkPDFShader.cpp
+++ b/src/pdf/SkPDFShader.cpp
@@ -707,7 +707,7 @@
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();