OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkLua.h" | 8 #include "SkLua.h" |
9 | 9 |
10 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
(...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 SkLua lua(L); | 1130 SkLua lua(L); |
1131 lua.pushRect(rects[0]); | 1131 lua.pushRect(rects[0]); |
1132 lua.pushRect(rects[1]); | 1132 lua.pushRect(rects[1]); |
1133 lua_pushstring(L, dir2string(dirs[0])); | 1133 lua_pushstring(L, dir2string(dirs[0])); |
1134 lua_pushstring(L, dir2string(dirs[0])); | 1134 lua_pushstring(L, dir2string(dirs[0])); |
1135 ret_count += 4; | 1135 ret_count += 4; |
1136 } | 1136 } |
1137 return ret_count; | 1137 return ret_count; |
1138 } | 1138 } |
1139 | 1139 |
| 1140 static int lpath_countPoints(lua_State* L) { |
| 1141 lua_pushinteger(L, get_obj<SkPath>(L, 1)->countPoints()); |
| 1142 return 1; |
| 1143 } |
| 1144 |
1140 static int lpath_reset(lua_State* L) { | 1145 static int lpath_reset(lua_State* L) { |
1141 get_obj<SkPath>(L, 1)->reset(); | 1146 get_obj<SkPath>(L, 1)->reset(); |
1142 return 0; | 1147 return 0; |
1143 } | 1148 } |
1144 | 1149 |
1145 static int lpath_moveTo(lua_State* L) { | 1150 static int lpath_moveTo(lua_State* L) { |
1146 get_obj<SkPath>(L, 1)->moveTo(lua2scalar(L, 2), lua2scalar(L, 3)); | 1151 get_obj<SkPath>(L, 1)->moveTo(lua2scalar(L, 2), lua2scalar(L, 3)); |
1147 return 0; | 1152 return 0; |
1148 } | 1153 } |
1149 | 1154 |
(...skipping 26 matching lines...) Expand all Loading... |
1176 } | 1181 } |
1177 | 1182 |
1178 static const struct luaL_Reg gSkPath_Methods[] = { | 1183 static const struct luaL_Reg gSkPath_Methods[] = { |
1179 { "getBounds", lpath_getBounds }, | 1184 { "getBounds", lpath_getBounds }, |
1180 { "getFillType", lpath_getFillType }, | 1185 { "getFillType", lpath_getFillType }, |
1181 { "getSegmentTypes", lpath_getSegementTypes }, | 1186 { "getSegmentTypes", lpath_getSegementTypes }, |
1182 { "isConvex", lpath_isConvex }, | 1187 { "isConvex", lpath_isConvex }, |
1183 { "isEmpty", lpath_isEmpty }, | 1188 { "isEmpty", lpath_isEmpty }, |
1184 { "isRect", lpath_isRect }, | 1189 { "isRect", lpath_isRect }, |
1185 { "isNestedRects", lpath_isNestedRects }, | 1190 { "isNestedRects", lpath_isNestedRects }, |
| 1191 { "countPoints", lpath_countPoints }, |
1186 { "reset", lpath_reset }, | 1192 { "reset", lpath_reset }, |
1187 { "moveTo", lpath_moveTo }, | 1193 { "moveTo", lpath_moveTo }, |
1188 { "lineTo", lpath_lineTo }, | 1194 { "lineTo", lpath_lineTo }, |
1189 { "quadTo", lpath_quadTo }, | 1195 { "quadTo", lpath_quadTo }, |
1190 { "cubicTo", lpath_cubicTo }, | 1196 { "cubicTo", lpath_cubicTo }, |
1191 { "close", lpath_close }, | 1197 { "close", lpath_close }, |
1192 { "__gc", lpath_gc }, | 1198 { "__gc", lpath_gc }, |
1193 { NULL, NULL } | 1199 { NULL, NULL } |
1194 }; | 1200 }; |
1195 | 1201 |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1418 REG_CLASS(L, SkShader); | 1424 REG_CLASS(L, SkShader); |
1419 REG_CLASS(L, SkTypeface); | 1425 REG_CLASS(L, SkTypeface); |
1420 REG_CLASS(L, SkMatrix); | 1426 REG_CLASS(L, SkMatrix); |
1421 } | 1427 } |
1422 | 1428 |
1423 extern "C" int luaopen_skia(lua_State* L); | 1429 extern "C" int luaopen_skia(lua_State* L); |
1424 extern "C" int luaopen_skia(lua_State* L) { | 1430 extern "C" int luaopen_skia(lua_State* L) { |
1425 SkLua::Load(L); | 1431 SkLua::Load(L); |
1426 return 0; | 1432 return 0; |
1427 } | 1433 } |
OLD | NEW |