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 "SkCommandLineFlags.h" | 8 #include "SkCommandLineFlags.h" |
9 #include "SkForceLinking.h" | 9 #include "SkForceLinking.h" |
10 #include "SkGraphics.h" | 10 #include "SkGraphics.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 overheadEstimate /= kOverheadLoops; | 142 overheadEstimate /= kOverheadLoops; |
143 | 143 |
144 SkOSFile::Iter it(FLAGS_skps[0], ".skp"); | 144 SkOSFile::Iter it(FLAGS_skps[0], ".skp"); |
145 SkString filename; | 145 SkString filename; |
146 bool failed = false; | 146 bool failed = false; |
147 while (it.next(&filename)) { | 147 while (it.next(&filename)) { |
148 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, filename.c_str())) { | 148 if (SkCommandLineFlags::ShouldSkip(FLAGS_match, filename.c_str())) { |
149 continue; | 149 continue; |
150 } | 150 } |
151 | 151 |
152 const SkString path = SkOSPath::SkPathJoin(FLAGS_skps[0], filename.c_str
()); | 152 const SkString path = SkOSPath::Join(FLAGS_skps[0], filename.c_str()); |
153 | 153 |
154 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(path.c_str())); | 154 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(path.c_str())); |
155 if (!stream) { | 155 if (!stream) { |
156 SkDebugf("Could not read %s.\n", path.c_str()); | 156 SkDebugf("Could not read %s.\n", path.c_str()); |
157 failed = true; | 157 failed = true; |
158 continue; | 158 continue; |
159 } | 159 } |
160 SkAutoTUnref<SkPicture> src( | 160 SkAutoTUnref<SkPicture> src( |
161 SkPicture::CreateFromStream(stream, sk_tools::LazyDecodeBitmap)); | 161 SkPicture::CreateFromStream(stream, sk_tools::LazyDecodeBitmap)); |
162 if (!src) { | 162 if (!src) { |
163 SkDebugf("Could not read %s as an SkPicture.\n", path.c_str()); | 163 SkDebugf("Could not read %s as an SkPicture.\n", path.c_str()); |
164 failed = true; | 164 failed = true; |
165 continue; | 165 continue; |
166 } | 166 } |
167 bench_record(*src, overheadEstimate, filename.c_str(), bbhFactory.get())
; | 167 bench_record(*src, overheadEstimate, filename.c_str(), bbhFactory.get())
; |
168 } | 168 } |
169 return failed ? 1 : 0; | 169 return failed ? 1 : 0; |
170 } | 170 } |
171 | 171 |
172 #if !defined SK_BUILD_FOR_IOS | 172 #if !defined SK_BUILD_FOR_IOS |
173 int main(int argc, char * const argv[]) { | 173 int main(int argc, char * const argv[]) { |
174 return tool_main(argc, (char**) argv); | 174 return tool_main(argc, (char**) argv); |
175 } | 175 } |
176 #endif | 176 #endif |
OLD | NEW |