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

Unified Diff: gm/verylargebitmap.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 | « gm/recordopts.cpp ('k') | include/core/SkCanvas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/verylargebitmap.cpp
diff --git a/gm/verylargebitmap.cpp b/gm/verylargebitmap.cpp
index 4ce5b7b379cf3973877a852a17b755483c316999..b3ed5603a61dafe893ce4d953457053885823989 100644
--- a/gm/verylargebitmap.cpp
+++ b/gm/verylargebitmap.cpp
@@ -31,9 +31,8 @@ static sk_sp<SkImage> make_raster_image(int width, int height, SkColor colors[2]
static sk_sp<SkImage> make_picture_image(int width, int height, SkColor colors[2]) {
SkPictureRecorder recorder;
draw(recorder.beginRecording(SkRect::MakeIWH(width, height)), width, height, colors);
- SkAutoTUnref<SkPicture> picture(recorder.endRecording());
- return SkImage::MakeFromPicture(sk_ref_sp(picture.get()), SkISize::Make(width, height),
- nullptr, nullptr);
+ return SkImage::MakeFromPicture(recorder.finishRecordingAsPicture(),
+ SkISize::Make(width, height), nullptr, nullptr);
}
typedef sk_sp<SkImage> (*ImageMakerProc)(int width, int height, SkColor colors[2]);
« no previous file with comments | « gm/recordopts.cpp ('k') | include/core/SkCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698