diff options
author | reed <reed@google.com> | 2016-03-18 07:25:55 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-18 07:25:55 -0700 |
commit | ca2622ba051829fed5f30facd74c5b41cd4b931c (patch) | |
tree | 3d8248b7764e500f857b3d6cfb6866e72b632199 /src/utils/SkLua.cpp | |
parent | eb75c7db3a7372de68347d0df8d58acebc33a9ad (diff) |
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
Diffstat (limited to 'src/utils/SkLua.cpp')
-rw-r--r-- | src/utils/SkLua.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utils/SkLua.cpp b/src/utils/SkLua.cpp index 868a8250ef..56e2b41a45 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; } |