| * Copyright 2013 Google Inc. |
| * Use of this source code is governed by a BSD-style license that can be |
| * found in the LICENSE file. |
| static sk_sp<SkData> read_into_data(const char file[]) { |
| sk_sp<SkData> data(SkData::MakeFromFileName(file)); |
| data = SkData::MakeEmpty(); |
| int main(int argc, char** argv) { |
| for (int i = 1; i < argc; ++i) { |
| if (!strcmp(argv[i], "--lua") && i < argc-1) { |
| len = strlen(argv[i + 1]); |
| data = read_into_data(argv[i]); |
| if (!L.runCode(ptr, len)) { |
| SkDebugf("failed to load %s\n", argv[i]); |