diff options
author | reed <reed@google.com> | 2016-03-17 10:51:11 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-17 10:51:11 -0700 |
commit | 9ce9d6772df650ceb0511f275e1a83dffa78ff72 (patch) | |
tree | 1c0d54a75945863947490ec45cccf7c30eaa2ca4 /src/utils/SkLua.cpp | |
parent | 42d95a0afb26560586232961445ba36de387ca37 (diff) |
update callsites for Make image factories
not forced yet, as we still have the build-guard. waiting on chrome CL
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1810813003
TBR=
Review URL: https://codereview.chromium.org/1810813003
Diffstat (limited to 'src/utils/SkLua.cpp')
-rw-r--r-- | src/utils/SkLua.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/utils/SkLua.cpp b/src/utils/SkLua.cpp index 95ca5adc07..868a8250ef 100644 --- a/src/utils/SkLua.cpp +++ b/src/utils/SkLua.cpp @@ -1756,11 +1756,11 @@ static int lsurface_getCanvas(lua_State* L) { } static int lsurface_newImageSnapshot(lua_State* L) { - SkImage* image = get_ref<SkSurface>(L, 1)->newImageSnapshot(); - if (nullptr == image) { + sk_sp<SkImage> image = get_ref<SkSurface>(L, 1)->makeImageSnapshot(); + if (!image) { lua_pushnil(L); } else { - push_ref(L, image)->unref(); + push_ref(L, image); } return 1; } @@ -2075,11 +2075,11 @@ static int lsk_newRasterSurface(lua_State* L) { static int lsk_loadImage(lua_State* L) { if (lua_gettop(L) > 0 && lua_isstring(L, 1)) { const char* name = lua_tolstring(L, 1, nullptr); - SkAutoDataUnref data(SkData::NewFromFileName(name)); - if (data.get()) { - SkImage* image = SkImage::NewFromEncoded(data); + sk_sp<SkData> data(SkData::MakeFromFileName(name)); + if (data) { + auto image = SkImage::MakeFromEncoded(std::move(data)); if (image) { - push_ref(L, image)->unref(); + push_ref(L, std::move(image)); return 1; } } |