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

Unified Diff: src/utils/SkLua.cpp

Issue 1817383002: switch surface to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/pdf/SkPDFDevice.cpp ('k') | src/utils/SkRGBAToYUV.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 d0b6a4b1ac27d3b665b512b873d4b26cbc4ff0eb..c25bbf4409ffe412cadc4a1f20a0f9679bac975e 100644
--- a/src/utils/SkLua.cpp
+++ b/src/utils/SkLua.cpp
@@ -716,11 +716,11 @@ static int lcanvas_newSurface(lua_State* L) {
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 @@ static int lsurface_newSurface(lua_State* L) {
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 @@ static int lsk_newRasterSurface(lua_State* L) {
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;
}
« no previous file with comments | « src/pdf/SkPDFDevice.cpp ('k') | src/utils/SkRGBAToYUV.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698