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

Unified Diff: src/utils/SkLua.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 | « src/effects/SkPictureImageFilter.cpp ('k') | tests/CanvasTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkLua.cpp
diff --git a/src/utils/SkLua.cpp b/src/utils/SkLua.cpp
index 868a8250ef3a658b91c213101ca82e58a7c7e600..56e2b41a454e5f81b22c81be895e07155aa5f56a 100644
--- a/src/utils/SkLua.cpp
+++ b/src/utils/SkLua.cpp
@@ -1824,12 +1824,12 @@ static int lpicturerecorder_getCanvas(lua_State* L) {
}
static int lpicturerecorder_endRecording(lua_State* L) {
- SkPicture* pic = get_obj<SkPictureRecorder>(L, 1)->endRecording();
- if (nullptr == pic) {
+ sk_sp<SkPicture> pic = get_obj<SkPictureRecorder>(L, 1)->finishRecordingAsPicture();
+ if (!pic) {
lua_pushnil(L);
return 1;
}
- push_ref(L, pic)->unref();
+ push_ref(L, std::move(pic));
return 1;
}
« no previous file with comments | « src/effects/SkPictureImageFilter.cpp ('k') | tests/CanvasTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698