| 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 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
| 10 #include "SkData.h" | 10 #include "SkData.h" |
| (...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1022 SkLua(L).pushRect(get_obj<SkRRect>(L, 1)->rect()); | 1022 SkLua(L).pushRect(get_obj<SkRRect>(L, 1)->rect()); |
| 1023 return 1; | 1023 return 1; |
| 1024 } | 1024 } |
| 1025 | 1025 |
| 1026 static int lrrect_type(lua_State* L) { | 1026 static int lrrect_type(lua_State* L) { |
| 1027 lua_pushstring(L, rrect_type(*get_obj<SkRRect>(L, 1))); | 1027 lua_pushstring(L, rrect_type(*get_obj<SkRRect>(L, 1))); |
| 1028 return 1; | 1028 return 1; |
| 1029 } | 1029 } |
| 1030 | 1030 |
| 1031 static int lrrect_radii(lua_State* L) { | 1031 static int lrrect_radii(lua_State* L) { |
| 1032 int corner = lua_tointeger(L, 2); | 1032 int corner = SkToInt(lua_tointeger(L, 2)); |
| 1033 SkVector v; | 1033 SkVector v; |
| 1034 if (corner < 0 || corner > 3) { | 1034 if (corner < 0 || corner > 3) { |
| 1035 SkDebugf("bad corner index %d", corner); | 1035 SkDebugf("bad corner index %d", corner); |
| 1036 v.set(0, 0); | 1036 v.set(0, 0); |
| 1037 } else { | 1037 } else { |
| 1038 v = get_obj<SkRRect>(L, 1)->radii((SkRRect::Corner)corner); | 1038 v = get_obj<SkRRect>(L, 1)->radii((SkRRect::Corner)corner); |
| 1039 } | 1039 } |
| 1040 lua_pushnumber(L, v.fX); | 1040 lua_pushnumber(L, v.fX); |
| 1041 lua_pushnumber(L, v.fY); | 1041 lua_pushnumber(L, v.fY); |
| 1042 return 2; | 1042 return 2; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1228 REG_CLASS(L, SkShader); | 1228 REG_CLASS(L, SkShader); |
| 1229 REG_CLASS(L, SkTypeface); | 1229 REG_CLASS(L, SkTypeface); |
| 1230 REG_CLASS(L, SkMatrix); | 1230 REG_CLASS(L, SkMatrix); |
| 1231 } | 1231 } |
| 1232 | 1232 |
| 1233 extern "C" int luaopen_skia(lua_State* L); | 1233 extern "C" int luaopen_skia(lua_State* L); |
| 1234 extern "C" int luaopen_skia(lua_State* L) { | 1234 extern "C" int luaopen_skia(lua_State* L) { |
| 1235 SkLua::Load(L); | 1235 SkLua::Load(L); |
| 1236 return 0; | 1236 return 0; |
| 1237 } | 1237 } |
| OLD | NEW |