return pictures as sk_sp
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1811703002
Review URL: https://codereview.chromium.org/1811703002
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 7212223..05d6ce0 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -1389,7 +1389,7 @@
}
if (fSaveToSKP) {
- SkAutoTUnref<const SkPicture> picture(fRecorder.endRecording());
+ sk_sp<SkPicture> picture(fRecorder.finishRecordingAsPicture());
SkFILEWStream stream("sample_app.skp");
picture->serialize(&stream);
fSaveToSKP = false;
@@ -1398,7 +1398,7 @@
}
if (fUsePicture) {
- SkAutoTUnref<const SkPicture> picture(fRecorder.endRecording());
+ sk_sp<SkPicture> picture(fRecorder.finishRecordingAsPicture());
// serialize/deserialize?
if (false) {
@@ -1406,9 +1406,9 @@
picture->serialize(&wstream);
SkAutoTDelete<SkStream> rstream(wstream.detachAsStream());
- picture.reset(SkPicture::CreateFromStream(rstream));
+ picture = SkPicture::MakeFromStream(rstream);
}
- orig->drawPicture(picture);
+ orig->drawPicture(picture.get());
}
// Do this after presentGL and other finishing, rather than in afterChild