replace SkRefPtr for parameters with simple pointers

git-svn-id: http://skia.googlecode.com/svn/trunk@1913 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2011-07-20 18:43:19 +00:00
Родитель 06f7f4051e
Коммит 1feb33068b
8 изменённых файлов: 13 добавлений и 14 удалений

Просмотреть файл

@ -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.

Просмотреть файл

@ -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.
*/

Просмотреть файл

@ -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

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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

Просмотреть файл

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

Просмотреть файл

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