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 "LazyDecodeBitmap.h" | 8 #include "LazyDecodeBitmap.h" |
9 #include "SkLua.h" | 9 #include "SkLua.h" |
10 #include "SkLuaCanvas.h" | 10 #include "SkLuaCanvas.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 // for i in {0..5}; do lua_pictures --skpPath SKP_PATH -l YOUR_SCRIPT --modulo $
i 6 &; done | 32 // for i in {0..5}; do lua_pictures --skpPath SKP_PATH -l YOUR_SCRIPT --modulo $
i 6 &; done |
33 DEFINE_string(modulo, "", "[--modulo <remainder> <divisor>]: only run tests for
which " | 33 DEFINE_string(modulo, "", "[--modulo <remainder> <divisor>]: only run tests for
which " |
34 "testIndex %% divisor == remainder."); | 34 "testIndex %% divisor == remainder."); |
35 DEFINE_string2(skpPath, r, "", "Read this .skp file or .skp files from this dir"
); | 35 DEFINE_string2(skpPath, r, "", "Read this .skp file or .skp files from this dir"
); |
36 DEFINE_string2(luaFile, l, "", "File containing lua script to run"); | 36 DEFINE_string2(luaFile, l, "", "File containing lua script to run"); |
37 DEFINE_string2(headCode, s, "", "Optional lua code to call at beginning"); | 37 DEFINE_string2(headCode, s, "", "Optional lua code to call at beginning"); |
38 DEFINE_string2(tailFunc, s, "", "Optional lua function to call at end"); | 38 DEFINE_string2(tailFunc, s, "", "Optional lua function to call at end"); |
39 DEFINE_bool2(quiet, q, false, "Silence all non-error related output"); | 39 DEFINE_bool2(quiet, q, false, "Silence all non-error related output"); |
40 | 40 |
41 static SkPicture* load_picture(const char path[]) { | 41 static SkPicture* load_picture(const char path[]) { |
42 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(path)); | 42 SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(path)); |
43 SkPicture* pic = NULL; | 43 SkPicture* pic = NULL; |
44 if (stream.get()) { | 44 if (stream.get()) { |
45 pic = SkPicture::CreateFromStream(stream.get(), &sk_tools::LazyDecodeBit
map); | 45 pic = SkPicture::CreateFromStream(stream.get(), &sk_tools::LazyDecodeBit
map); |
46 } | 46 } |
47 return pic; | 47 return pic; |
48 } | 48 } |
49 | 49 |
50 static void call_canvas(lua_State* L, SkLuaCanvas* canvas, | 50 static void call_canvas(lua_State* L, SkLuaCanvas* canvas, |
51 const char pictureFile[], const char funcName[]) { | 51 const char pictureFile[], const char funcName[]) { |
52 lua_getglobal(L, funcName); | 52 lua_getglobal(L, funcName); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 } | 160 } |
161 } | 161 } |
162 return 0; | 162 return 0; |
163 } | 163 } |
164 | 164 |
165 #if !defined SK_BUILD_FOR_IOS | 165 #if !defined SK_BUILD_FOR_IOS |
166 int main(int argc, char * const argv[]) { | 166 int main(int argc, char * const argv[]) { |
167 return tool_main(argc, (char**) argv); | 167 return tool_main(argc, (char**) argv); |
168 } | 168 } |
169 #endif | 169 #endif |
OLD | NEW |