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

Unified Diff: src/images/SkImageEncoder.cpp

Issue 2333713002: change SkStreams to work with sk_sp<SkData> instead of SkData* (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
Index: src/images/SkImageEncoder.cpp
diff --git a/src/images/SkImageEncoder.cpp b/src/images/SkImageEncoder.cpp
index 22bbc57c2f593a083734311f0c2dadb5f4994947..6101839a25e102653b2450299f16f399844a175a 100644
--- a/src/images/SkImageEncoder.cpp
+++ b/src/images/SkImageEncoder.cpp
@@ -31,7 +31,7 @@ SkData* SkImageEncoder::encodeData(const SkBitmap& bm, int quality) {
SkDynamicMemoryWStream stream;
quality = SkMin32(100, SkMax32(0, quality));
if (this->onEncode(&stream, bm, quality)) {
- return stream.copyToData();
+ return stream.makeCopy().release();
}
return nullptr;
}
« include/core/SkStream.h ('K') | « src/core/SkStream.cpp ('k') | tests/AnnotationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698