caryclark | 5ef194c | 2015-08-31 09:22:38 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2013 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #include "SkForceLinking.h" |
| 9 | #include "SkGraphics.h" |
| 10 | |
| 11 | __SK_FORCE_IMAGE_DECODER_LINKING; |
| 12 | |
| 13 | extern bool CheckChecksums(); |
| 14 | extern bool GenerateChecksums(); |
| 15 | |
| 16 | int tool_main(int argc, char** argv); |
| 17 | int tool_main(int argc, char** argv) { |
| 18 | if (argc == 2) { |
| 19 | SkAutoGraphics ag; // Enable use of SkRTConfig |
| 20 | if (!strcmp(argv[1], "--check")) { |
| 21 | return (int) !CheckChecksums(); |
| 22 | } |
| 23 | if (!strcmp(argv[1], "--generate")) { |
| 24 | if (!GenerateChecksums()) { |
| 25 | return 2; |
| 26 | } |
| 27 | return 0; |
| 28 | } |
| 29 | } |
| 30 | SkDebugf("Usage:\n %s [--check] [--generate]\n\n", argv[0]); |
| 31 | return 3; |
| 32 | } |
| 33 | |
| 34 | #if !defined SK_BUILD_FOR_IOS |
| 35 | int main(int argc, char * const argv[]) { |
| 36 | return tool_main(argc, (char**) argv); |
| 37 | } |
| 38 | #endif |