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

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

Issue 1785473002: SkImage now has makeShader to return sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use build guard for impl of newShader Created 4 years, 9 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
« no previous file with comments | « src/image/SkImageShader.cpp ('k') | tests/FlattenableFactoryToName.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1693 matching lines...) Expand 10 before | Expand all | Expand 10 after
1704 } 1704 }
1705 1705
1706 static int limage_height(lua_State* L) { 1706 static int limage_height(lua_State* L) {
1707 lua_pushinteger(L, get_ref<SkImage>(L, 1)->height()); 1707 lua_pushinteger(L, get_ref<SkImage>(L, 1)->height());
1708 return 1; 1708 return 1;
1709 } 1709 }
1710 1710
1711 static int limage_newShader(lua_State* L) { 1711 static int limage_newShader(lua_State* L) {
1712 SkShader::TileMode tmode = SkShader::kClamp_TileMode; 1712 SkShader::TileMode tmode = SkShader::kClamp_TileMode;
1713 const SkMatrix* localM = nullptr; 1713 const SkMatrix* localM = nullptr;
1714 SkAutoTUnref<SkShader> shader(get_ref<SkImage>(L, 1)->newShader(tmode, tmode , localM)); 1714 push_ref(L, get_ref<SkImage>(L, 1)->makeShader(tmode, tmode, localM));
1715 push_ref(L, shader.get());
1716 return 1; 1715 return 1;
1717 } 1716 }
1718 1717
1719 static int limage_gc(lua_State* L) { 1718 static int limage_gc(lua_State* L) {
1720 get_ref<SkImage>(L, 1)->unref(); 1719 get_ref<SkImage>(L, 1)->unref();
1721 return 0; 1720 return 0;
1722 } 1721 }
1723 1722
1724 static const struct luaL_Reg gSkImage_Methods[] = { 1723 static const struct luaL_Reg gSkImage_Methods[] = {
1725 { "width", limage_width }, 1724 { "width", limage_width },
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
2137 REG_CLASS(L, SkTextBlob); 2136 REG_CLASS(L, SkTextBlob);
2138 REG_CLASS(L, SkTypeface); 2137 REG_CLASS(L, SkTypeface);
2139 REG_CLASS(L, SkXfermode); 2138 REG_CLASS(L, SkXfermode);
2140 } 2139 }
2141 2140
2142 extern "C" int luaopen_skia(lua_State* L); 2141 extern "C" int luaopen_skia(lua_State* L);
2143 extern "C" int luaopen_skia(lua_State* L) { 2142 extern "C" int luaopen_skia(lua_State* L) {
2144 SkLua::Load(L); 2143 SkLua::Load(L);
2145 return 0; 2144 return 0;
2146 } 2145 }
OLDNEW
« no previous file with comments | « src/image/SkImageShader.cpp ('k') | tests/FlattenableFactoryToName.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698