aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/utils/mac/SkCGUtils.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/utils/mac/SkCGUtils.h')
-rw-r--r--include/utils/mac/SkCGUtils.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/utils/mac/SkCGUtils.h b/include/utils/mac/SkCGUtils.h
index 9848d221db..46f89960f8 100644
--- a/include/utils/mac/SkCGUtils.h
+++ b/include/utils/mac/SkCGUtils.h
@@ -46,4 +46,19 @@ void SkCGDrawBitmap(CGContextRef, const SkBitmap&, float x, float y);
bool SkPDFDocumentToBitmap(SkStream* stream, SkBitmap* output);
+/**
+ * Return a provider that wraps the specified stream. It will become an
+ * owner of the stream, so the caller must still manage its ownership.
+ *
+ * To hand-off ownership of the stream to the provider, the caller must do
+ * something like the following:
+ *
+ * SkStream* stream = new ...;
+ * CGDataProviderRef provider = SkStreamToDataProvider(stream);
+ * stream->unref();
+ *
+ * Now when the provider is finally deleted, it will delete the stream.
+ */
+CGDataProviderRef SkCreateDataProviderFromStream(SkStream*);
+
#endif