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 "SkCanvas.h" | 8 #include "SkCanvas.h" |
9 #include "SkCommandLineFlags.h" | 9 #include "SkCommandLineFlags.h" |
10 #include "SkForceLinking.h" | 10 #include "SkForceLinking.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 SkAutoTMalloc<SkPMColor> scratch(kMaxArea); | 99 SkAutoTMalloc<SkPMColor> scratch(kMaxArea); |
100 | 100 |
101 SkOSFile::Iter it(FLAGS_skps[0], ".skp"); | 101 SkOSFile::Iter it(FLAGS_skps[0], ".skp"); |
102 SkString filename; | 102 SkString filename; |
103 bool failed = false; | 103 bool failed = false; |
104 while (it.next(&filename)) { | 104 while (it.next(&filename)) { |
105 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, filename.c_str())) { | 105 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, filename.c_str())) { |
106 continue; | 106 continue; |
107 } | 107 } |
108 | 108 |
109 const SkString path = SkOSPath::SkPathJoin(FLAGS_skps[0], filename.c_str
()); | 109 const SkString path = SkOSPath::Join(FLAGS_skps[0], filename.c_str()); |
110 | 110 |
111 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(path.c_str())); | 111 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(path.c_str())); |
112 if (!stream) { | 112 if (!stream) { |
113 SkDebugf("Could not read %s.\n", path.c_str()); | 113 SkDebugf("Could not read %s.\n", path.c_str()); |
114 failed = true; | 114 failed = true; |
115 continue; | 115 continue; |
116 } | 116 } |
117 SkAutoTUnref<const SkPicture> src(SkPicture::CreateFromStream(stream)); | 117 SkAutoTUnref<const SkPicture> src(SkPicture::CreateFromStream(stream)); |
118 if (!src) { | 118 if (!src) { |
119 SkDebugf("Could not read %s as an SkPicture.\n", path.c_str()); | 119 SkDebugf("Could not read %s as an SkPicture.\n", path.c_str()); |
(...skipping 11 matching lines...) Expand all Loading... |
131 bench(scratch.get(), *src, filename.c_str()); | 131 bench(scratch.get(), *src, filename.c_str()); |
132 } | 132 } |
133 return failed ? 1 : 0; | 133 return failed ? 1 : 0; |
134 } | 134 } |
135 | 135 |
136 #if !defined SK_BUILD_FOR_IOS | 136 #if !defined SK_BUILD_FOR_IOS |
137 int main(int argc, char * const argv[]) { | 137 int main(int argc, char * const argv[]) { |
138 return tool_main(argc, (char**) argv); | 138 return tool_main(argc, (char**) argv); |
139 } | 139 } |
140 #endif | 140 #endif |
OLD | NEW |