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 1975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1986 face = SkTypeface::RefDefault(); | 1986 face = SkTypeface::RefDefault(); |
1987 } | 1987 } |
1988 push_ref(L, face)->unref(); | 1988 push_ref(L, face)->unref(); |
1989 return 1; | 1989 return 1; |
1990 } | 1990 } |
1991 | 1991 |
1992 static int lsk_newRasterSurface(lua_State* L) { | 1992 static int lsk_newRasterSurface(lua_State* L) { |
1993 int width = lua2int_def(L, 1, 0); | 1993 int width = lua2int_def(L, 1, 0); |
1994 int height = lua2int_def(L, 2, 0); | 1994 int height = lua2int_def(L, 2, 0); |
1995 SkImageInfo info = SkImageInfo::MakeN32Premul(width, height); | 1995 SkImageInfo info = SkImageInfo::MakeN32Premul(width, height); |
1996 SkSurface* surface = SkSurface::NewRaster(info); | 1996 SkSurfaceProps props(0, kUnknown_SkPixelGeometry); |
| 1997 SkSurface* surface = SkSurface::NewRaster(info, &props); |
1997 if (NULL == surface) { | 1998 if (NULL == surface) { |
1998 lua_pushnil(L); | 1999 lua_pushnil(L); |
1999 } else { | 2000 } else { |
2000 push_ref(L, surface)->unref(); | 2001 push_ref(L, surface)->unref(); |
2001 } | 2002 } |
2002 return 1; | 2003 return 1; |
2003 } | 2004 } |
2004 | 2005 |
2005 static int lsk_loadImage(lua_State* L) { | 2006 static int lsk_loadImage(lua_State* L) { |
2006 if (lua_gettop(L) > 0 && lua_isstring(L, 1)) { | 2007 if (lua_gettop(L) > 0 && lua_isstring(L, 1)) { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2064 REG_CLASS(L, SkSurface); | 2065 REG_CLASS(L, SkSurface); |
2065 REG_CLASS(L, SkTextBlob); | 2066 REG_CLASS(L, SkTextBlob); |
2066 REG_CLASS(L, SkTypeface); | 2067 REG_CLASS(L, SkTypeface); |
2067 } | 2068 } |
2068 | 2069 |
2069 extern "C" int luaopen_skia(lua_State* L); | 2070 extern "C" int luaopen_skia(lua_State* L); |
2070 extern "C" int luaopen_skia(lua_State* L) { | 2071 extern "C" int luaopen_skia(lua_State* L) { |
2071 SkLua::Load(L); | 2072 SkLua::Load(L); |
2072 return 0; | 2073 return 0; |
2073 } | 2074 } |
OLD | NEW |