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 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 SkShader* shader = paint->getShader(); | 1139 SkShader* shader = paint->getShader(); |
1140 if (shader) { | 1140 if (shader) { |
1141 push_ref(L, shader); | 1141 push_ref(L, shader); |
1142 return 1; | 1142 return 1; |
1143 } | 1143 } |
1144 return 0; | 1144 return 0; |
1145 } | 1145 } |
1146 | 1146 |
1147 static int lpaint_setShader(lua_State* L) { | 1147 static int lpaint_setShader(lua_State* L) { |
1148 SkPaint* paint = get_obj<SkPaint>(L, 1); | 1148 SkPaint* paint = get_obj<SkPaint>(L, 1); |
1149 paint->setShader(get_ref<SkShader>(L, 2)); | 1149 paint->setShader(sk_ref_sp(get_ref<SkShader>(L, 2))); |
1150 return 0; | 1150 return 0; |
1151 } | 1151 } |
1152 | 1152 |
1153 static int lpaint_getPathEffect(lua_State* L) { | 1153 static int lpaint_getPathEffect(lua_State* L) { |
1154 const SkPaint* paint = get_obj<SkPaint>(L, 1); | 1154 const SkPaint* paint = get_obj<SkPaint>(L, 1); |
1155 SkPathEffect* pe = paint->getPathEffect(); | 1155 SkPathEffect* pe = paint->getPathEffect(); |
1156 if (pe) { | 1156 if (pe) { |
1157 push_ref(L, pe); | 1157 push_ref(L, pe); |
1158 return 1; | 1158 return 1; |
1159 } | 1159 } |
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2136 REG_CLASS(L, SkTextBlob); | 2136 REG_CLASS(L, SkTextBlob); |
2137 REG_CLASS(L, SkTypeface); | 2137 REG_CLASS(L, SkTypeface); |
2138 REG_CLASS(L, SkXfermode); | 2138 REG_CLASS(L, SkXfermode); |
2139 } | 2139 } |
2140 | 2140 |
2141 extern "C" int luaopen_skia(lua_State* L); | 2141 extern "C" int luaopen_skia(lua_State* L); |
2142 extern "C" int luaopen_skia(lua_State* L) { | 2142 extern "C" int luaopen_skia(lua_State* L) { |
2143 SkLua::Load(L); | 2143 SkLua::Load(L); |
2144 return 0; | 2144 return 0; |
2145 } | 2145 } |
OLD | NEW |