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

Unified Diff: tests/ImageTest.cpp

Issue 1811703002: return pictures as sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rely on RVO in picturerecorder Created 4 years, 9 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/ImageFilterTest.cpp ('k') | tests/PathOpsSkpClipTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ImageTest.cpp
diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp
index 4781aea6255dfc14e43a7cb32e759094aa3dd4db..ce3cb99265bca94a54cd034e03c5c8f19069d991 100644
--- a/tests/ImageTest.cpp
+++ b/tests/ImageTest.cpp
@@ -111,8 +111,8 @@ static sk_sp<SkImage> create_picture_image() {
SkPictureRecorder recorder;
SkCanvas* canvas = recorder.beginRecording(10, 10);
canvas->clear(SK_ColorCYAN);
- sk_sp<SkPicture> picture(recorder.endRecording());
- return SkImage::MakeFromPicture(picture, SkISize::Make(10, 10), nullptr, nullptr);
+ return SkImage::MakeFromPicture(recorder.finishRecordingAsPicture(), SkISize::Make(10, 10),
+ nullptr, nullptr);
};
#endif
// Want to ensure that our Release is called when the owning image is destroyed
@@ -232,7 +232,7 @@ DEF_TEST(Image_Serialize_Encoding_Failure, reporter) {
SkPictureRecorder recorder;
SkCanvas* canvas = recorder.beginRecording(100, 100);
canvas->drawImage(image, 0, 0);
- SkAutoTUnref<SkPicture> picture(recorder.endRecording());
+ sk_sp<SkPicture> picture(recorder.finishRecordingAsPicture());
REPORTER_ASSERT(reporter, picture);
REPORTER_ASSERT(reporter, picture->approximateOpCount() > 0);
@@ -247,7 +247,7 @@ DEF_TEST(Image_Serialize_Encoding_Failure, reporter) {
REPORTER_ASSERT(reporter, serializers[i]->didEncode());
SkAutoTDelete<SkStream> rstream(wstream.detachAsStream());
- SkAutoTUnref<SkPicture> deserialized(SkPicture::CreateFromStream(rstream));
+ sk_sp<SkPicture> deserialized(SkPicture::MakeFromStream(rstream));
REPORTER_ASSERT(reporter, deserialized);
REPORTER_ASSERT(reporter, deserialized->approximateOpCount() > 0);
}
« no previous file with comments | « tests/ImageFilterTest.cpp ('k') | tests/PathOpsSkpClipTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698