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

Unified Diff: src/utils/SkLua.cpp

Issue 679903002: add saveLayer to lua (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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 | « resources/slides_utils.lua ('k') | no next file » | 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 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 },
« no previous file with comments | « resources/slides_utils.lua ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698