Index: src/utils/SkLua.cpp |
diff --git a/src/utils/SkLua.cpp b/src/utils/SkLua.cpp |
index 57df014baaec1d357539c87bbeee3e97f6401111..4fdb71404d810318a97fbe580b1eb5adcaac6476 100644 |
--- a/src/utils/SkLua.cpp |
+++ b/src/utils/SkLua.cpp |
@@ -615,6 +615,12 @@ static int lcanvas_save(lua_State* L) { |
return 1; |
} |
+static int lcanvas_saveLayer(lua_State* L) { |
+ SkPaint paint; |
+ lua_pushinteger(L, get_ref<SkCanvas>(L, 1)->saveLayer(NULL, lua2OptionalPaint(L, 2, &paint))); |
+ return 1; |
+} |
+ |
static int lcanvas_restore(lua_State* L) { |
get_ref<SkCanvas>(L, 1)->restore(); |
return 0; |
@@ -682,6 +688,7 @@ const struct luaL_Reg gSkCanvas_Methods[] = { |
{ "getReducedClipStack", SkLua::lcanvas_getReducedClipStack }, |
#endif |
{ "save", lcanvas_save }, |
+ { "saveLayer", lcanvas_saveLayer }, |
{ "restore", lcanvas_restore }, |
{ "scale", lcanvas_scale }, |
{ "translate", lcanvas_translate }, |