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); |