Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1732)

Unified Diff: src/utils/mac/SkStream_mac.cpp

Issue 2343933002: Revert of SkFontData to use smart pointers. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/utils/mac/SkCreateCGImageRef.cpp ('k') | tests/BadIcoTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « src/utils/mac/SkCreateCGImageRef.cpp ('k') | tests/BadIcoTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698