switch surface to sk_sp
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1817383002
CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot
Review URL: https://codereview.chromium.org/1817383002
diff --git a/src/utils/SkLua.cpp b/src/utils/SkLua.cpp
index d0b6a4b..c25bbf4 100644
--- a/src/utils/SkLua.cpp
+++ b/src/utils/SkLua.cpp
@@ -716,11 +716,11 @@
int width = lua2int_def(L, 2, 0);
int height = lua2int_def(L, 3, 0);
SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);
- SkSurface* surface = get_ref<SkCanvas>(L, 1)->newSurface(info);
+ auto surface = get_ref<SkCanvas>(L, 1)->makeSurface(info);
if (nullptr == surface) {
lua_pushnil(L);
} else {
- push_ref(L, surface)->unref();
+ push_ref(L, surface);
}
return 1;
}
@@ -1769,11 +1769,11 @@
int width = lua2int_def(L, 2, 0);
int height = lua2int_def(L, 3, 0);
SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);
- SkSurface* surface = get_ref<SkSurface>(L, 1)->newSurface(info);
+ auto surface = get_ref<SkSurface>(L, 1)->makeSurface(info);
if (nullptr == surface) {
lua_pushnil(L);
} else {
- push_ref(L, surface)->unref();
+ push_ref(L, surface);
}
return 1;
}
@@ -2063,11 +2063,11 @@
int height = lua2int_def(L, 2, 0);
SkImageInfo info = SkImageInfo::MakeN32Premul(width, height);
SkSurfaceProps props(0, kUnknown_SkPixelGeometry);
- SkSurface* surface = SkSurface::NewRaster(info, &props);
+ auto surface = SkSurface::MakeRaster(info, &props);
if (nullptr == surface) {
lua_pushnil(L);
} else {
- push_ref(L, surface)->unref();
+ push_ref(L, surface);
}
return 1;
}