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

Unified Diff: tests/PictureTest.cpp

Issue 2333713002: change SkStreams to work with sk_sp<SkData> instead of SkData* (Closed)
Patch Set: fix xpsdevice 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 | « tests/PathTest.cpp ('k') | tests/StreamTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PictureTest.cpp
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index 7b187b44099820d82529ff2be5d64d6c3a13811d..6ab57c04d741a207fb92f6fe9ab3ba7522c3b8ca 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -632,7 +632,7 @@ static sk_sp<SkData> serialized_picture_from_bitmap(const SkBitmap& bitmap) {
SkAutoTUnref<SkPixelSerializer> serializer(
SkImageEncoder::CreatePixelSerializer());
picture->serialize(&wStream, serializer);
- return sk_sp<SkData>(wStream.copyToData());
+ return wStream.detachAsData();
}
struct ErrorContext {
@@ -670,7 +670,7 @@ DEF_TEST(Picture_EncodedData, reporter) {
if (!SkImageEncoder::EncodeStream(&wStream, original, SkImageEncoder::kPNG_Type, 100)) {
return;
}
- sk_sp<SkData> data(wStream.copyToData());
+ sk_sp<SkData> data = wStream.detachAsData();
SkBitmap bm;
bool installSuccess = SkDEPRECATED_InstallDiscardablePixelRef(data.get(), &bm);
« no previous file with comments | « tests/PathTest.cpp ('k') | tests/StreamTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698