aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/utils/mac
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-02-24 15:29:00 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-02-24 15:29:00 +0000
commit61c22047dcc04be9fe7342f7e557996566f7f289 (patch)
tree36e56f848c7f3baa1644b79a03445069b000af32 /include/utils/mac
parent3a2b35f0af0c079187c36087fe6dd279f69a80b7 (diff)
add SkCreateDataProviderFromStream to SkCGUtils
implement SkFontHost create_from_file/stream using SkCGUtils git-svn-id: http://skia.googlecode.com/svn/trunk@3249 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/utils/mac')
-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