[PDF] Clean up ref counting.
Return ref'd objs where possible enabling removal of many SkRefPtr<> variables.
Review URL: http://codereview.appspot.com/4029051
git-svn-id: http://skia.googlecode.com/svn/trunk@750 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/pdf/SkPDFImage.h b/include/pdf/SkPDFImage.h
index 9b4e4f9..7966e99 100644
--- a/include/pdf/SkPDFImage.h
+++ b/include/pdf/SkPDFImage.h
@@ -49,10 +49,11 @@
virtual ~SkPDFImage();
- /** Add a Soft Mask (alpha or shape channel) to the image.
+ /** Add a Soft Mask (alpha or shape channel) to the image. Refs mask.
* @param mask A gray scale image representing the mask.
+ * @return The mask argument is returned.
*/
- void addSMask(SkPDFImage* mask);
+ SkPDFImage* addSMask(SkPDFImage* mask);
// The SkPDFObject interface.
virtual void emitObject(SkWStream* stream, SkPDFCatalog* catalog,
@@ -76,17 +77,19 @@
SkPDFImage(SkStream* imageData, const SkBitmap& bitmap,
const SkIRect& srcRect, bool alpha, const SkPaint& paint);
- /** Add the value to the stream dictionary with the given key.
+ /** Add the value to the stream dictionary with the given key. Refs value.
* @param key The key for this dictionary entry.
* @param value The value for this dictionary entry.
+ * @return The value argument is returned.
*/
- void insert(SkPDFName* key, SkPDFObject* value);
+ SkPDFObject* insert(SkPDFName* key, SkPDFObject* value);
- /** Add the value to the stream dictionary with the given key.
+ /** Add the value to the stream dictionary with the given key. Refs value.
* @param key The text of the key for this dictionary entry.
* @param value The value for this dictionary entry.
+ * @return The value argument is returned.
*/
- void insert(const char key[], SkPDFObject* value);
+ SkPDFObject* insert(const char key[], SkPDFObject* value);
};
#endif