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

Side by Side Diff: src/utils/SkLua.cpp

Issue 1832223002: switch xfermodes over to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 8 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 unified diff | Download patch
OLDNEW
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 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 SkXfermode* xfermode = paint->getXfermode(); 1091 SkXfermode* xfermode = paint->getXfermode();
1092 if (xfermode) { 1092 if (xfermode) {
1093 push_ref(L, xfermode); 1093 push_ref(L, xfermode);
1094 return 1; 1094 return 1;
1095 } 1095 }
1096 return 0; 1096 return 0;
1097 } 1097 }
1098 1098
1099 static int lpaint_setXfermode(lua_State* L) { 1099 static int lpaint_setXfermode(lua_State* L) {
1100 SkPaint* paint = get_obj<SkPaint>(L, 1); 1100 SkPaint* paint = get_obj<SkPaint>(L, 1);
1101 paint->setXfermode(get_ref<SkXfermode>(L, 2)); 1101 paint->setXfermode(sk_ref_sp(get_ref<SkXfermode>(L, 2)));
1102 return 0; 1102 return 0;
1103 } 1103 }
1104 1104
1105 static int lpaint_getColorFilter(lua_State* L) { 1105 static int lpaint_getColorFilter(lua_State* L) {
1106 const SkPaint* paint = get_obj<SkPaint>(L, 1); 1106 const SkPaint* paint = get_obj<SkPaint>(L, 1);
1107 SkColorFilter* cf = paint->getColorFilter(); 1107 SkColorFilter* cf = paint->getColorFilter();
1108 if (cf) { 1108 if (cf) {
1109 push_ref(L, cf); 1109 push_ref(L, cf);
1110 return 1; 1110 return 1;
1111 } 1111 }
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698