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 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1201 | 1201 |
1202 /////////////////////////////////////////////////////////////////////////////// | 1202 /////////////////////////////////////////////////////////////////////////////// |
1203 | 1203 |
1204 static const char* rrect_type(const SkRRect& rr) { | 1204 static const char* rrect_type(const SkRRect& rr) { |
1205 switch (rr.getType()) { | 1205 switch (rr.getType()) { |
1206 case SkRRect::kUnknown_Type: return "unknown"; | 1206 case SkRRect::kUnknown_Type: return "unknown"; |
1207 case SkRRect::kEmpty_Type: return "empty"; | 1207 case SkRRect::kEmpty_Type: return "empty"; |
1208 case SkRRect::kRect_Type: return "rect"; | 1208 case SkRRect::kRect_Type: return "rect"; |
1209 case SkRRect::kOval_Type: return "oval"; | 1209 case SkRRect::kOval_Type: return "oval"; |
1210 case SkRRect::kSimple_Type: return "simple"; | 1210 case SkRRect::kSimple_Type: return "simple"; |
1211 case SkRRect::kNinePatch_Type: return "nine-patch"; | |
1212 case SkRRect::kComplex_Type: return "complex"; | 1211 case SkRRect::kComplex_Type: return "complex"; |
1213 } | 1212 } |
1214 SkDEBUGFAIL("never get here"); | 1213 SkDEBUGFAIL("never get here"); |
1215 return ""; | 1214 return ""; |
1216 } | 1215 } |
1217 | 1216 |
1218 static int lrrect_rect(lua_State* L) { | 1217 static int lrrect_rect(lua_State* L) { |
1219 SkLua(L).pushRect(get_obj<SkRRect>(L, 1)->rect()); | 1218 SkLua(L).pushRect(get_obj<SkRRect>(L, 1)->rect()); |
1220 return 1; | 1219 return 1; |
1221 } | 1220 } |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1425 REG_CLASS(L, SkShader); | 1424 REG_CLASS(L, SkShader); |
1426 REG_CLASS(L, SkTypeface); | 1425 REG_CLASS(L, SkTypeface); |
1427 REG_CLASS(L, SkMatrix); | 1426 REG_CLASS(L, SkMatrix); |
1428 } | 1427 } |
1429 | 1428 |
1430 extern "C" int luaopen_skia(lua_State* L); | 1429 extern "C" int luaopen_skia(lua_State* L); |
1431 extern "C" int luaopen_skia(lua_State* L) { | 1430 extern "C" int luaopen_skia(lua_State* L) { |
1432 SkLua::Load(L); | 1431 SkLua::Load(L); |
1433 return 0; | 1432 return 0; |
1434 } | 1433 } |
OLD | NEW |