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 #include "SkLuaCanvas.h" | 9 #include "SkLuaCanvas.h" |
10 #include "SkPicture.h" | 10 #include "SkPicture.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 const char* summary = gSummarizeFunc; | 79 const char* summary = gSummarizeFunc; |
80 if (!FLAGS_tailFunc.isEmpty()) { | 80 if (!FLAGS_tailFunc.isEmpty()) { |
81 summary = FLAGS_tailFunc[0]; | 81 summary = FLAGS_tailFunc[0]; |
82 } | 82 } |
83 | 83 |
84 SkAutoGraphics ag; | 84 SkAutoGraphics ag; |
85 SkLua L(summary); | 85 SkLua L(summary); |
86 | 86 |
87 for (int i = 0; i < FLAGS_luaFile.count(); ++i) { | 87 for (int i = 0; i < FLAGS_luaFile.count(); ++i) { |
88 SkAutoDataUnref data(SkData::NewFromFileName(FLAGS_luaFile[i])); | 88 sk_sp<SkData> data(SkData::MakeFromFileName(FLAGS_luaFile[i])); |
89 if (nullptr == data.get()) { | 89 if (!data) { |
90 data.reset(SkData::NewEmpty()); | 90 data = SkData::MakeEmpty(); |
91 } | 91 } |
92 if (!FLAGS_quiet) { | 92 if (!FLAGS_quiet) { |
93 SkDebugf("loading %s...\n", FLAGS_luaFile[i]); | 93 SkDebugf("loading %s...\n", FLAGS_luaFile[i]); |
94 } | 94 } |
95 if (!L.runCode(data->data(), data->size())) { | 95 if (!L.runCode(data->data(), data->size())) { |
96 SkDebugf("failed to load luaFile %s\n", FLAGS_luaFile[i]); | 96 SkDebugf("failed to load luaFile %s\n", FLAGS_luaFile[i]); |
97 exit(-1); | 97 exit(-1); |
98 } | 98 } |
99 } | 99 } |
100 | 100 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 } | 159 } |
160 } | 160 } |
161 return 0; | 161 return 0; |
162 } | 162 } |
163 | 163 |
164 #if !defined SK_BUILD_FOR_IOS | 164 #if !defined SK_BUILD_FOR_IOS |
165 int main(int argc, char * const argv[]) { | 165 int main(int argc, char * const argv[]) { |
166 return tool_main(argc, (char**) argv); | 166 return tool_main(argc, (char**) argv); |
167 } | 167 } |
168 #endif | 168 #endif |
OLD | NEW |