| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 <stdio.h> | 8 #include <stdio.h> |
| 9 | 9 |
| 10 #include "SkCommandLineFlags.h" | 10 #include "SkCommandLineFlags.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 int tool_main(int argc, char** argv); | 39 int tool_main(int argc, char** argv); |
| 40 int tool_main(int argc, char** argv) { | 40 int tool_main(int argc, char** argv) { |
| 41 SkCommandLineFlags::Parse(argc, argv); | 41 SkCommandLineFlags::Parse(argc, argv); |
| 42 SkAutoGraphics ag; | 42 SkAutoGraphics ag; |
| 43 | 43 |
| 44 for (int i = 0; i < FLAGS_skps.count(); i++) { | 44 for (int i = 0; i < FLAGS_skps.count(); i++) { |
| 45 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, FLAGS_skps[i])) { | 45 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, FLAGS_skps[i])) { |
| 46 continue; | 46 continue; |
| 47 } | 47 } |
| 48 | 48 |
| 49 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(FLAGS_skps[i])); | 49 SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(FLAGS_skps[i])); |
| 50 if (!stream) { | 50 if (!stream) { |
| 51 SkDebugf("Could not read %s.\n", FLAGS_skps[i]); | 51 SkDebugf("Could not read %s.\n", FLAGS_skps[i]); |
| 52 exit(1); | 52 exit(1); |
| 53 } | 53 } |
| 54 SkAutoTUnref<SkPicture> src( | 54 SkAutoTUnref<SkPicture> src( |
| 55 SkPicture::CreateFromStream(stream, sk_tools::LazyDecodeBitmap))
; | 55 SkPicture::CreateFromStream(stream, sk_tools::LazyDecodeBitmap))
; |
| 56 if (!src) { | 56 if (!src) { |
| 57 SkDebugf("Could not read %s as an SkPicture.\n", FLAGS_skps[i]); | 57 SkDebugf("Could not read %s as an SkPicture.\n", FLAGS_skps[i]); |
| 58 exit(1); | 58 exit(1); |
| 59 } | 59 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 72 } | 72 } |
| 73 | 73 |
| 74 return 0; | 74 return 0; |
| 75 } | 75 } |
| 76 | 76 |
| 77 #if !defined SK_BUILD_FOR_IOS | 77 #if !defined SK_BUILD_FOR_IOS |
| 78 int main(int argc, char * const argv[]) { | 78 int main(int argc, char * const argv[]) { |
| 79 return tool_main(argc, (char**) argv); | 79 return tool_main(argc, (char**) argv); |
| 80 } | 80 } |
| 81 #endif | 81 #endif |
| OLD | NEW |