Index: src/utils/mac/SkStream_mac.cpp |
diff --git a/src/utils/mac/SkStream_mac.cpp b/src/utils/mac/SkStream_mac.cpp |
index a1d63b5fd61306b8045ccff791abbc8ac4cd72e9..36e5194a1990b3e65bdbf0fe3654bcff5659b167 100644 |
--- a/src/utils/mac/SkStream_mac.cpp |
+++ b/src/utils/mac/SkStream_mac.cpp |
@@ -48,13 +48,13 @@ |
delete (SkStream*)info; |
} |
-CGDataProviderRef SkCreateDataProviderFromStream(std::unique_ptr<SkStream> stream) { |
+CGDataProviderRef SkCreateDataProviderFromStream(SkStream* stream) { |
// TODO: Replace with SkStream::getData() when that is added. Then we only |
// have one version of CGDataProviderCreateWithData (i.e. same release proc) |
const void* addr = stream->getMemoryBase(); |
if (addr) { |
// special-case when the stream is just a block of ram |
- return CGDataProviderCreateWithData(stream.release(), addr, stream->getLength(), |
+ return CGDataProviderCreateWithData(stream, addr, stream->getLength(), |
delete_stream_proc); |
} |
@@ -65,15 +65,17 @@ |
rec.skipForward = skip_forward_proc; |
rec.rewind = rewind_proc; |
rec.releaseInfo = release_info_proc; |
- return CGDataProviderCreateSequential(stream.release(), &rec); |
+ return CGDataProviderCreateSequential(stream, &rec); |
} |
/////////////////////////////////////////////////////////////////////////////// |
#include "SkData.h" |
-CGDataProviderRef SkCreateDataProviderFromData(sk_sp<SkData> data) { |
- return CGDataProviderCreateWithData(data.release(), data->data(), data->size(), unref_proc); |
+CGDataProviderRef SkCreateDataProviderFromData(SkData* data) { |
+ data->ref(); |
+ return CGDataProviderCreateWithData(data, data->data(), data->size(), |
+ unref_proc); |
} |
#endif//defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) |